def add_detections(self,name,det_fn=None,txt_patt=None,**kw): """ Parse detections and include in the PingMatcher. det_fn: Parse downloaded data that has .DET (and .DBG) files txt_patt: glob pattern for parsing .txt files (as saved to the cloud). """ if det_fn is not None: fn=os.path.join(self.base_dir,det_fn) detects=pt.parse_tek(fn,name=name,**kw) elif txt_patt is not None: txt_fns=glob.glob(os.path.join(self.base_dir,txt_patt)) detects=pt.parse_txts(txt_fns,name=name,**kw) if isinstance(detects,list): for i,d in enumerate(detects): d['station']=d['name'] d['name']=(),d['name'].item()+'.%d'%i self.all_detects.append(d) else: detects['station']=detects['name'] self.all_detects.append(detects)
('AM2',AM2), ('AM3',AM3), ('AM4',AM4), ('AM6',AM6), ('AM7',AM7), ('AM8',AM8), ('AM9',AM9), ('SM1',SM1), ('SM2',SM2), ('SM3',SM3), ('SM4',SM4), ('SM7',SM7), ('SM8',SM8) ] all_detects=[pt.parse_tek(fn,name=name) for name,fn in utils.progress(all_receiver_fns)] ## all_detects_nomp=[pt.remove_multipath(d) for d in all_detects] ## # First cut: # Limit to 1 hour of detections. 3388 detections over this 1 hour. # one good tag - C56B (just 4 fixes) #t_clip=[np.datetime64("2019-03-25 02:00"), # np.datetime64("2019-03-25 03:00")] # one good tag - C535 (but just 4 fixes)
def parse_data(self): self.A_full = parse_tek(self.fnA) self.B_full = parse_tek(self.fnB)