Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.3.7 #89

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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'])

Check warning on line 13 in seispy/core/pertmod.py

View check run for this annotation

Codecov / codecov/patch

seispy/core/pertmod.py#L12-L13

Added lines #L12 - L13 were not covered by tests
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 @@
: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))

Check warning on line 196 in seispy/eq.py

View check run for this annotation

Codecov / codecov/patch

seispy/eq.py#L196

Added line #L196 was not covered by tests
# 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
Loading