returnResult.error(message="level0 data [%s]not found"%(level0_id))
sql_data=f"select * from cpic_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 cpic_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
parameter kwargs:
detector_no: [str]
ref_type: [str]
obs_time: (start,end)
qc1_status : [int]
prc_status : [int]
file_name: [str]
limit: limits returns the number of records,default 0:no-limit
returnResult.error(message="level0 data [%s]not found"%(level0_id))
sql_data=f"select * from ifs_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"
returnResult.error(message="level0 data [%s]not found"%(level0_id))
sql_data=f"select * from mci_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"
returnResult.error(message="level0 data [%s]not found"%(level0_id))
sql_data=f"select * from msc_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"
returnResult.error(message="level0 data [%s]not found"%(level0_id))
sql_data=f"select * from sls_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"