Skip to content

Commit

Permalink
recalculate RF by download seismic data
Browse files Browse the repository at this point in the history
  • Loading branch information
xumi1993 committed Nov 29, 2024
1 parent 51164b8 commit ac6a7ad
Showing 1 changed file with 14 additions and 6 deletions.
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

0 comments on commit ac6a7ad

Please sign in to comment.