RF package#

seispy.eq module#

class seispy.eq.EQ(pathname, datestr, suffix='SAC')[source]#

Bases: object

Methods

arr_correct([write_to_sac])

offset = sac.b - real o

channel_correct([switchEN, reverseE, reverseN])

_summary_

deconvolute(shift, time_after[, f0, method, ...])

Deconvolution

trim(time_before, time_after[, isreturn])

offset = sac.b - real o

cleanstream

decon_p

decon_s

detrend

filter

fix_channel_name

from_stream

get_arrival

get_time_offset

judge_rf

phase_trigger

readstream

rotate

s_condition

saverf

search_baz

search_inc

set_comp

snr

write

arr_correct(write_to_sac=True)[source]#

offset = sac.b - real o

channel_correct(switchEN=False, reverseE=False, reverseN=False)[source]#

_summary_

Parameters:
  • switchEN (bool, optional) – _description_, defaults to False

  • reverseE (bool, optional) – _description_, defaults to False

  • reverseN (bool, optional) – _description_, defaults to False

cleanstream()[source]#
decon_p(tshift, tcomp=False, **kwargs)[source]#
decon_s(tshift, **kwargs)[source]#
deconvolute(shift, time_after, f0=2.0, method='iter', only_r=False, itmax=400, minderr=0.001, wlevel=0.05, target_dt=None)[source]#

Deconvolution

Parameters:
shiftfloat

Time shift before P arrival

time_afterfloat

Time length after P arrival

f0float or list, optional

Gaussian factors, by default 2.0

methodstr, optional

method for deconvolution in iter or water, by default iter

only_rbool, optional

Whether only calculate RF in prime component, by default False

itmaxint, optional

Maximum iterative number, valid for method of iter, by default 400

minderrfloat, optional

Minium residual error, valid for method of iter, by default 0.001

wlevelfloat, optional

Water level, valid for method of water, by default 0.05

target_dtNone or float, optional

Time delta for resampling, by default None

detrend()[source]#
filter(freqmin=0.05, freqmax=1, order=4)[source]#
fix_channel_name()[source]#
classmethod from_stream(stream)[source]#
get_arrival(model, evdp, dis, phase='P')[source]#
get_time_offset(event_time=None)[source]#
judge_rf(gauss, shift, npts, criterion='crust', rmsgate=None)[source]#
phase_trigger(time_before, time_after, stl=5, ltl=10)[source]#
readstream()[source]#
rotate(baz, inc=None, method='NE->RT', search_inc=False, baz_shift=0)[source]#
s_condition(trrf, shift)[source]#
saverf(path, evtstr=None, shift=0, evla=-12345.0, evlo=-12345.0, evdp=-12345.0, mag=-12345.0, gauss=0, baz=-12345.0, gcarc=-12345.0, only_r=False, **kwargs)[source]#
search_baz(bazi, time_b=10, time_e=20, offset=90)[source]#
search_inc(bazi)[source]#
set_comp()[source]#
snr(length=50)[source]#
trim(time_before, time_after, isreturn=False)[source]#

offset = sac.b - real o

write(path, evt_datetime)[source]#
exception seispy.eq.NotEnoughComponent(matchkey)[source]#

Bases: Exception

exception seispy.eq.TooMoreComponents(matchkey)[source]#

Bases: Exception

seispy.eq.rotateZNE(st)[source]#

seispy.rf module#

seispy.rf.CfgModify(cfg_file, session, key, value)[source]#
class seispy.rf.RF(cfg_file=None, log=None)[source]#

Bases: object

Attributes:
date_begin
date_end

Methods

baz_correct

cal_phase

channel_correct

deconv

detrend

drop_eq_snr

filter

load_stainfo

loadpjt

match_eq

pick

rotate

save_raw_data

savepjt

saverf

search_eq

trim

baz_correct(time_b=10, time_e=20, offset=90, correct_angle=None)[source]#
cal_phase()[source]#
channel_correct()[source]#
property date_begin#
property date_end#
deconv()[source]#
detrend()[source]#
drop_eq_snr(length=None, z_only=False)[source]#
filter(freqmin=None, freqmax=None, order=4)[source]#
load_stainfo(use_date_range=True)[source]#
classmethod loadpjt(path)[source]#
match_eq()[source]#
pick(prepick=True, stl=5, ltl=10)[source]#
rotate(search_inc=False)[source]#
save_raw_data()[source]#
savepjt()[source]#
saverf(gauss=None)[source]#
search_eq(local=False, catalog=None)[source]#
trim()[source]#
exception seispy.rf.SACFileNotFoundError(matchkey)[source]#

Bases: Exception

seispy.rf.datestr2regex(datestr)[source]#
seispy.rf.fetch_waveform(eq_lst, para, model, logger)[source]#
seispy.rf.match_eq(eq_lst, pathname, stla, stlo, logger, ref_comp='Z', suffix='SAC', offset=None, tolerance=210, dateformat='%Y.%j.%H.%M.%S')[source]#
seispy.rf.pickphase(eqs, para, logger)[source]#
seispy.rf.read_catalog(logpath: str, b_time, e_time, stla: float, stlo: float, magmin=5.5, magmax=10.0, dismin=30.0, dismax=90.0, depthmin=0, depthmax=800)[source]#

Read local catalog with seispy or QUAKEML format

Parameters:
  • logpath (str) – Path to catalogs

  • b_time (obspy.UTCDateTime) – Start time

  • e_time (obspy.UTCDateTime) – End time

  • stla (float) – Station latitude

  • stlo (float) – Station longitude

  • magmin (float, optional) – Minimum magnitude, defaults to 5.5

  • magmax (float, optional) – Maximum magnitude, defaults to 10

  • dismin (float, optional) – Minimum distance, defaults to 30

  • dismax (float, optional) – Maximum distance, defaults to 90

Returns:

list of earthquakes

Return type:

pandas.DataFrame

seispy.rf.setpar()[source]#

seispy.para module#

class seispy.para.RFPara[source]#

Bases: object

Attributes:
catalogpath
criterion
datapath
decon_method
rfpath
server

Methods

get_para

read_para

property catalogpath#
property criterion#
property datapath#
property decon_method#
get_para()[source]#
classmethod read_para(cfg_file)[source]#
property rfpath#
property server#
class seispy.para.StaInfo[source]#

Bases: object

Methods

get_station_from_ws([server])

Get station information from web-service with given network and station or other optional condition.

get_stainfo

load_stainfo

get_stainfo()[source]#
get_station_from_ws(server='IRIS', **kwargs)[source]#

Get station information from web-service with given network and station or other optional condition.

Parameters:
serverstr, optional

Sever name of FDSN web-service, by default ‘IRIS’

load_stainfo(pathname, ref_comp, suffix)[source]#