Skip to content

Commit

Permalink
Merge pull request #89 from xumi1993/dev
Browse files Browse the repository at this point in the history
v1.3.7
  • Loading branch information
xumi1993 authored May 6, 2024
2 parents c02b5c8 + c2cff27 commit 167386a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 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
4 changes: 2 additions & 2 deletions seispy/core/pertmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Mod3DPerturbation:
def __init__(self, modpath, YAxisRange, velmod='iasp91'):
dep_mod = DepModel(YAxisRange, velmod=velmod)
self.model = np.load(modpath)
new1dvp = interp1d(dep_mod.depthsraw, dep_mod.vpraw)(self.model['dep'])
new1dvs = interp1d(dep_mod.depthsraw, dep_mod.vsraw)(self.model['dep'])
new1dvp = interp1d(dep_mod.depths, dep_mod.vp)(self.model['dep'])
new1dvs = interp1d(dep_mod.depths, dep_mod.vs)(self.model['dep'])
new1dvp, _, _ = np.meshgrid(new1dvp, self.model['lat'], self.model['lon'], indexing='ij')
new1dvs, _, _ = np.meshgrid(new1dvs, self.model['lat'], self.model['lon'], indexing='ij')
self.dvp = (self.model['vp'] - new1dvp) / new1dvp
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description = fh.read()


VERSION = "1.3.6"
VERSION = "1.3.7"
setup(name='python-seispy',
version=VERSION,
author='Mijian Xu',
Expand Down

0 comments on commit 167386a

Please sign in to comment.