returnResult.error(message="level0 data [%s]not found"%(level0_id))
sql_data=f"select * from t_cal_merge where detector_no='{level0_data.data.detector_no}' and ref_type='{ref_type}' and obs_time >= '{level0_data.data.obs_time}' order by obs_time ASC limit 1"
r=self.db.select_one(sql_data)
ifr:
rec=CalMergeRecord().from_dict(r)
returnResult.ok_data(data=rec)
sql_data=f"select * from t_cal_merge where detector_no='{level0_data.data.detector_no}' and ref_type='{ref_type}' and obs_time <= '{level0_data.data.obs_time}' order by obs_time DESC limit 1"
r=self.db.select_one(sql_data)
ifr:
rec=CalMergeRecord().from_dict(r)
returnResult.ok_data(data=rec)
returnResult.error(message="not found")
exceptExceptionase:
returnResult.error(message=str(e))
deffind(self,**kwargs):
''' retrieve calibration merge records from database