def __init__(self): # 1. picker params pick_win = [10., 1.] # pick win for STA/LTA trig_thres = 15. # threshold to trig picker (by energy) pick_thres = 0.96 # threshold for picking p_win = [1., 1.] # win len for P picking s_win = [0, 15.] # win len for S picking pca_win = 1. # win len for PCA filter pca_rng = [0, 2.5] # time range to apply PCA filter fd_thres = 2.5 # min value of dominant frequency amp_win = 5. # time win to get S amplitude det_gap = 5. # time gap between detections freq_band = ['highpass', 1] # frequency band for ppk # 2. assoc params ot_dev = 3. # time deviation for ot assoc ttp_dev = 2. # time deviation for ttp assoc assoc_num = 4 # num of stations to assoc # 3. loc params side_width = 0.2 # ratio of sides relative to sta range xy_grid = 0.02 # lateral grid width, in degree # sta info sta_file = '/data2/ZSY_SAC/header/station_ZSY.dat' resp_dict = { 'ZSY': 3.02e8, 'YN': 1.67785e9, 'XLS': 1 / 1.6e-9, } # instrumental gain (cnt/m/s) # 4. define func dp = dps.Data(resp_dict) self.get_data_dict = dp.get_data_dict self.get_picks = dp.get_picks self.read_data = dp.read_data sta_dict = dp.get_sta_dict(sta_file) self.picker = pickers.Trad_PS(\ trig_thres = trig_thres, s_win = s_win) self.associator = associators.TS_Assoc(\ sta_dict, assoc_num = assoc_num, ot_dev = ot_dev, ttp_dev = ttp_dev)
def __init__(self): # 1. picker params self.pick_win = [10., 1.] # pick win for STA/LTA self.trig_thres = 15. # threshold to trig picker (by energy) self.pick_thres = 0.96 # threshold for picking self.p_win = [1., 1.] # win len for P picking self.s_win = [0, 15.] # win len for S picking self.pca_win = 1. # # win len for PCA filter self.pca_rng = [0, 2.5] # time range to apply PCA filter self.fd_thres = 2.5 # min value of dominant frequency self.amp_win = 5. # time win to get S amplitude self.det_gap = 5. # time gap between detections self.freq_band = ['highpass', 1] # frequency band for ppk # 2. assoc params self.ot_dev = 3. # time deviation for ot assoc self.ttp_dev = 2. # time deviation for ttp assoc self.assoc_num = 4 # num of stations to assoc # 3. loc params self.side_width = 0.2 # ratio of sides relative to sta range self.xy_grid = 0.02 # lateral grid width, in degree self.resp_dict = { 'ZSY': 3.02e8, 'YN': 1.67785e9, 'XLS': 1 / 1.6e-9, 'G70': 1 / 1.6e-9, 'G4Z': 1 / 1.6e-9, 'G4V': 1 / 1.6e-9, 'REF': 1 / 1.6e-9 } # instrumental response (cnt/m/s) # 4. define func self.get_data = dp.get_data sta_dict = dp.get_sta('/data3/XLS_SAC/header/station_XLS.dat') self.picker = pickers.Trad_PS(\ trig_thres = self.trig_thres, s_win = self.s_win) self.associator = associators.TS_Assoc(\ sta_dict, self.resp_dict, assoc_num = self.assoc_num, ot_dev = self.ot_dev, ttp_dev = self.ttp_dev)
def __init__(self): # 1. mk_sta self.fsta_in = '/data2/Ridgecrest/station.csv' self.fsta_out = 'input/station.dat' # 2. mk_dt self.temp_pha = '../../run_pad/hypodd/output/rc_pad_reloc.pha' self.det_pha = '../output/rc/rc_msms.pha' self.date_rng = '20190704-20190711' self.num_proc = 7 # for parallel self.dep_corr = 5 # avoid air quake self.ot_dev = 2 # ot diff for det assoc self.cc_thres = 0.3 # select high cc event pairs self.dt_thres = [1., 2.] self.nbr_thres = [2, 30] self.fcsv = 'output/msms_reloc_main.csv' sta_dict = dps.Data(None).get_rc_sta(self.fsta_in) self.associator = associators.TS_Assoc(sta_dict) if not os.path.exists('input'): os.makedirs('input') if not os.path.exists('output'): os.makedirs('output')
parser.add_argument('--out_pick_dir', type=str, default='./output/picks') args = parser.parse_args() # PAD config cfg = config.Config() get_data_dict = cfg.get_data_dict read_data = cfg.read_data sta_dict = cfg.get_sta_dict(args.sta_file) picker = pickers.STA_LTA_PCA(\ pick_win = cfg.pick_win, trig_thres = cfg.trig_thres, p_win = cfg.p_win, s_win = cfg.s_win) associator = associators.TS_Assoc(\ sta_dict, assoc_num = cfg.assoc_num, ot_dev = cfg.ot_dev, max_res = cfg.max_res) # i/o paths out_root = os.path.split(args.out_ctlg)[0] if not os.path.exists(out_root): os.makedirs(out_root) if not os.path.exists(args.out_pick_dir): os.makedirs(args.out_pick_dir) out_ctlg = open(args.out_ctlg, 'w') out_pha = open(args.out_pha, 'w') # get time range start_date, end_date = [ UTCDateTime(date) for date in args.time_range.split('-') ] print('run pick & assoc: raw_waveform --> picks --> events') print('time range: {} to {}'.format(start_date.date, end_date.date))