diff --git a/csst_dfs_api_local/common/ingest.py b/csst_dfs_api_local/common/ingest.py index e62d9f12462769e499409445bced24abfc7f440b..5ea9079b4d0de5102822fa81c95af43824adaf69 100644 --- a/csst_dfs_api_local/common/ingest.py +++ b/csst_dfs_api_local/common/ingest.py @@ -42,8 +42,8 @@ def ingesst_one(file_path, db, copyfiles): module_id = header["INSTRUME"] obs_type = header["FILETYPE"] - qc0_status = 0 - prc_status = 0 + qc0_status = -1 + prc_status = -1 time_now = datetime.datetime.now() create_time = time_now.strftime('%Y-%m-%d %H:%M:%S') diff --git a/csst_dfs_api_local/facility/calmerge.py b/csst_dfs_api_local/facility/calmerge.py index d681a4b692387a41b5d4496d4bd0963df7851524..a71603dfb1bca47e85c9963edaedd5077921a8ad 100644 --- a/csst_dfs_api_local/facility/calmerge.py +++ b/csst_dfs_api_local/facility/calmerge.py @@ -190,7 +190,7 @@ class CalMergeApi(object): exp_time = get_parameter(kwargs, "exp_time"), filename = get_parameter(kwargs, "filename"), file_path = get_parameter(kwargs, "file_path"), - prc_status = get_parameter(kwargs, "prc_status"), + prc_status = get_parameter(kwargs, "prc_status", -1), prc_time = get_parameter(kwargs, "prc_time"), level0_ids = get_parameter(kwargs, "level0_ids", []) ) diff --git a/csst_dfs_api_local/facility/level0.py b/csst_dfs_api_local/facility/level0.py index e32326e6f341eaa237cf0c14cbc5048b118ec01b..0fcb8366d46815fcdab58349bdb7ebf21fef456e 100644 --- a/csst_dfs_api_local/facility/level0.py +++ b/csst_dfs_api_local/facility/level0.py @@ -191,7 +191,7 @@ class Level0DataApi(object): self.db.execute( 'INSERT INTO t_level0_data (obs_id, detector_no, obs_type, obs_time, exp_time,detector_status_id, filename, file_path,qc0_status, prc_status,create_time) \ VALUES(?,?,?,?,?,?,?,?,?,?,?)', - (rec.obs_id, rec.detector_no, rec.obs_type, rec.obs_time, rec.exp_time, rec.detector_status_id, rec.filename, rec.file_path,0,0,format_time_ms(time.time())) + (rec.obs_id, rec.detector_no, rec.obs_type, rec.obs_time, rec.exp_time, rec.detector_status_id, rec.filename, rec.file_path,-1,-1,format_time_ms(time.time())) ) self.db.end() rec.id = self.db.last_row_id() diff --git a/csst_dfs_api_local/facility/level0prc.py b/csst_dfs_api_local/facility/level0prc.py index 526387ccc3b342e15716fc94cb9a017275ba6326..8f73206681a46e6043413b18bf055f461f58d3ce 100644 --- a/csst_dfs_api_local/facility/level0prc.py +++ b/csst_dfs_api_local/facility/level0prc.py @@ -102,7 +102,7 @@ class Level0PrcApi(object): pipeline_id = get_parameter(kwargs, "pipeline_id"), prc_module = get_parameter(kwargs, "prc_module"), params_id = get_parameter(kwargs, "params_id"), - prc_status = get_parameter(kwargs, "prc_status"), + prc_status = get_parameter(kwargs, "prc_status", -1), prc_time = get_parameter(kwargs, "prc_time"), file_path = get_parameter(kwargs, "file_path") ) diff --git a/csst_dfs_api_local/facility/observation.py b/csst_dfs_api_local/facility/observation.py index edf87e1d1cc4b518c76ccd3453af9ebe1608bab1..9e244d29666c2cde54309f7971d02bc094930f1f 100644 --- a/csst_dfs_api_local/facility/observation.py +++ b/csst_dfs_api_local/facility/observation.py @@ -178,7 +178,7 @@ class ObservationApi(object): self.db.execute( 'INSERT INTO t_observation (id,obs_time,exp_time,module_id,obs_type,facility_status_id, module_status_id, qc0_status,create_time) \ VALUES(?,?,?,?,?,?,?,?,?)', - (obs_id, obs_time, exp_time, module_id, obs_type, facility_status_id, module_status_id,0,format_time_ms(time.time())) + (obs_id, obs_time, exp_time, module_id, obs_type, facility_status_id, module_status_id,-1,format_time_ms(time.time())) ) self.db.end() diff --git a/csst_dfs_api_local/msc/level1.py b/csst_dfs_api_local/msc/level1.py index c44133040394a7b30ad256f26ab2b78c20ea3d2b..17117b3725d2ff80792f06bb51dd7f3a22f35430 100644 --- a/csst_dfs_api_local/msc/level1.py +++ b/csst_dfs_api_local/msc/level1.py @@ -187,8 +187,8 @@ class Level1DataApi(object): bias_id = get_parameter(kwargs, "bias_id"), filename = get_parameter(kwargs, "filename"), file_path = get_parameter(kwargs, "file_path"), - prc_status = get_parameter(kwargs, "prc_status"), - prc_time = get_parameter(kwargs, "prc_time"), + prc_status = get_parameter(kwargs, "prc_status", -1), + prc_time = get_parameter(kwargs, "prc_time", format_datetime(datetime.datetime.now())), pipeline_id = get_parameter(kwargs, "pipeline_id") ) existed = self.db.exists( @@ -202,7 +202,7 @@ class Level1DataApi(object): self.db.execute( 'INSERT INTO msc_level1_data (raw_id,data_type,cor_sci_id,prc_params,flat_id,dark_id,bias_id,filename,file_path,qc1_status,prc_status,create_time,pipeline_id) \ VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)', - (rec.raw_id, rec.data_type, rec.cor_sci_id, rec.prc_params, rec.flat_id, rec.dark_id, rec.bias_id, rec.filename, rec.file_path, 0, 0, format_time_ms(time.time()),rec.pipeline_id,) + (rec.raw_id, rec.data_type, rec.cor_sci_id, rec.prc_params, rec.flat_id, rec.dark_id, rec.bias_id, rec.filename, rec.file_path, -1, -1, format_time_ms(time.time()),rec.pipeline_id,) ) self.db.end() rec.id = self.db.last_row_id()