Skip to content

Commit

Permalink
close More than one phase were calculated with distance of 18.7613020…
Browse files Browse the repository at this point in the history
…41426234 and focal depth of 10.0 #85
  • Loading branch information
xumi1993 committed Apr 26, 2024
1 parent ad716ae commit 49ce131
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion seispy/core/depmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
17 changes: 8 additions & 9 deletions seispy/eq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49ce131

Please sign in to comment.