From 49ce1310cc474e7b52779c8396b70d8eefc6f8dc Mon Sep 17 00:00:00 2001 From: Mijian Xu Date: Fri, 26 Apr 2024 10:38:12 +0800 Subject: [PATCH] close More than one phase were calculated with distance of 18.761302041426234 and focal depth of 10.0 #85 --- seispy/core/depmodel.py | 4 +++- seispy/eq.py | 17 ++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/seispy/core/depmodel.py b/seispy/core/depmodel.py index 825b5c36..6ed29999 100644 --- a/seispy/core/depmodel.py +++ b/seispy/core/depmodel.py @@ -3,8 +3,10 @@ import numpy as np from matplotlib import pyplot as plt from scipy.interpolate import interp1d, interpn - from seispy.utils import vs2vprho +import warnings + +warnings.filterwarnings("ignore", "invalid value encountered in sqrt") def _search_vel_file(mode_name): diff --git a/seispy/eq.py b/seispy/eq.py index 30b39be2..8f12ac07 100644 --- a/seispy/eq.py +++ b/seispy/eq.py @@ -190,17 +190,16 @@ def get_arrival(self, model, evdp, dis, phase='P'): :param phase: phase name, defaults to 'P' :type phase: str, optional """ + self.phase = phase arrivals = model.get_travel_times(evdp, dis, phase_list=[phase]) if not arrivals: - raise ValueError('The phase of {} is not exists'.format(phase)) - if len(arrivals) > 1: - raise ValueError('More than one phase were calculated with distance of {} and focal depth of {}'.format(dis, evdp)) - else: - # self.arrival = arrivals[0] - self.arr_time = arrivals[0].time - self.rayp = arrivals[0].ray_param - self.inc = arrivals[0].incident_angle - self.phase = phase + raise ValueError('The phase of {} is not exists. Please check the setting of distance and phase'.format(phase)) + # if len(arrivals) > 1: + # raise ValueError('More than one phase were calculated with distance of {} and focal depth of {}'.format(dis, evdp)) + # else: + self.arr_time = arrivals[0].time + self.rayp = arrivals[0].ray_param + self.inc = arrivals[0].incident_angle def search_inc(self, bazi): """Search incident angle for S wave