From ad716ae2e58c64bbafb87c1c7012d2ea0e551f17 Mon Sep 17 00:00:00 2001 From: Mijian Xu Date: Fri, 26 Apr 2024 10:28:58 +0800 Subject: [PATCH 1/3] debug rf2depth: invalid value encountered in sqrt #84 --- seispy/core/pertmod.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seispy/core/pertmod.py b/seispy/core/pertmod.py index dbd3691d..d6cbb322 100644 --- a/seispy/core/pertmod.py +++ b/seispy/core/pertmod.py @@ -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 From 49ce1310cc474e7b52779c8396b70d8eefc6f8dc Mon Sep 17 00:00:00 2001 From: Mijian Xu Date: Fri, 26 Apr 2024 10:38:12 +0800 Subject: [PATCH 2/3] 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 From c2cff2706344979fb88d8de54a63e7554b11c7c5 Mon Sep 17 00:00:00 2001 From: Mijian Xu Date: Tue, 7 May 2024 00:08:26 +0800 Subject: [PATCH 3/3] update version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 21d30f35..1aaa05b1 100644 --- a/setup.py +++ b/setup.py @@ -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',