From cb6500aa38b9288ba0eefccb0e32b8a467ba02af Mon Sep 17 00:00:00 2001 From: shoulinwei Date: Thu, 10 Jun 2021 12:55:05 +0800 Subject: [PATCH] status-1 --- csst_dfs_api_local/common/ingest.py | 4 ++-- csst_dfs_api_local/facility/calmerge.py | 2 +- csst_dfs_api_local/facility/level0.py | 2 +- csst_dfs_api_local/facility/level0prc.py | 2 +- csst_dfs_api_local/facility/observation.py | 2 +- csst_dfs_api_local/msc/level1.py | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/csst_dfs_api_local/common/ingest.py b/csst_dfs_api_local/common/ingest.py index e62d9f1..5ea9079 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 d681a4b..a71603d 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 e32326e..0fcb836 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 526387c..8f73206 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 edf87e1..9e244d2 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 c441330..17117b3 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() -- GitLab