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.9 #94

Merged
merged 2 commits into from
Nov 29, 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
15 changes: 14 additions & 1 deletion seispy/ccppara.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self):
self.stalist = 'sta.lst'
self.peakfile = 'good_410_660.dat'
self.adaptive= False
self.velmod = ''
self.velmod = 'iasp91'
self.stack_sta_list = ''
self.domperiod = 5
self.shape = 'circle'
Expand Down Expand Up @@ -59,6 +59,19 @@ def shape(self, value):
else:
self._shape = value.lower()

@property
def velmod(self):
return self._velmod

@velmod.setter
def velmod(self, value):
if not isinstance(value, str):
raise TypeError('ccppara.velmod must be str type')
elif value == "":
self._velmod = 'iasp91'
else:
self._velmod = value


def ccppara(cfg_file):
""" Read configure file for CCP stacking
Expand Down
20 changes: 14 additions & 6 deletions seispy/recalrf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from seispy.rf import RF, datestr2regex, SACFileNotFoundError
from seispy.rf import RF, datestr2regex, SACFileNotFoundError, fetch_waveform
from seispy.eq import EQ
from seispy.utils import scalar_instance
import numpy as np
Expand Down Expand Up @@ -88,12 +88,20 @@ def read_finallist(self, finallist):
return pd.DataFrame(lst, columns=cols)

def match_eq(self, **kwarg):
"""
Match or download teleseismic data according to final list.
"""
try:
self.logger.RFlog.info('Match SAC files')
self.eqs = match_eq(self.eq_lst, self.para.datapath, self.logger,
ref_comp=self.para.ref_comp, suffix=self.para.suffix,
offset=self.para.offset, tolerance=self.para.tolerance,
dateformat=self.para.dateformat)
if self.para.use_remote_data:
self.logger.RFlog.info('Fetch seismic data from {}'.format(self.para.data_server))
self.eq_lst = self.eq_lst.drop(columns=['dis', 'bazi'])
self.eqs = fetch_waveform(self.eq_lst, self.para, self.model, self.logger)
else:
self.logger.RFlog.info('Match SAC files')
self.eqs = match_eq(self.eq_lst, self.para.datapath, self.logger,
ref_comp=self.para.ref_comp, suffix=self.para.suffix,
offset=self.para.offset, tolerance=self.para.tolerance,
dateformat=self.para.dateformat)
except Exception as e:
self.logger.RFlog.error('{0}'.format(e))
raise e
Expand Down
14 changes: 9 additions & 5 deletions seispy/rf2depth_makedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def makedata(self, psphase=1):
if self.ismod1d:
if self.modfolder1d is not None:
velmod = _load_mod(self.modfolder1d, _sta.station)

else:
velmod = self.cpara.velmod

Expand All @@ -169,12 +168,17 @@ def makedata(self, psphase=1):
else:
### 3d model interp
if self.raytracing3d:
pplat_s, pplon_s, pplat_p, pplon_p, newtpds = psrf_3D_raytracing(stadatar, self.cpara.depth_axis, self.mod3d, srayp=self.srayp, sphere=sphere)
pplat_s, pplon_s, pplat_p, pplon_p, newtpds = psrf_3D_raytracing(
stadatar, self.cpara.depth_axis, self.mod3d, srayp=self.srayp, sphere=sphere
)
else:
pplat_s, pplon_s, pplat_p, pplon_p, raylength_s, raylength_p, tps = psrf_1D_raytracing(
stadatar, self.cpara.depth_axis, srayp=self.srayp, sphere=sphere, phase=psphase)
newtpds = psrf_3D_migration(pplat_s, pplon_s, pplat_p, pplon_p, raylength_s, raylength_p,
tps, self.cpara.depth_axis, self.mod3d)
stadatar, self.cpara.depth_axis, velmod=self.cpara.velmod, srayp=self.srayp, sphere=sphere, phase=psphase
)
newtpds = psrf_3D_migration(
pplat_s, pplon_s, pplat_p, pplon_p, raylength_s, raylength_p,
tps, self.cpara.depth_axis, self.mod3d
)
if stadatar.prime_phase == 'P':
piercelat, piercelon = pplat_s, pplon_s
else:
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.8"
VERSION = "1.3.9"
setup(name='python-seispy',
version=VERSION,
author='Mijian Xu',
Expand Down
Loading