Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-dfs
csst-dfs-api-local
Commits
cb6500aa
Commit
cb6500aa
authored
Jun 10, 2021
by
Wei Shoulin
Browse files
status-1
parent
54cda723
Changes
6
Hide whitespace changes
Inline
Side-by-side
csst_dfs_api_local/common/ingest.py
View file @
cb6500aa
...
...
@@ -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'
)
...
...
csst_dfs_api_local/facility/calmerge.py
View file @
cb6500aa
...
...
@@ -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"
,
[])
)
...
...
csst_dfs_api_local/facility/level0.py
View file @
cb6500aa
...
...
@@ -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
()
...
...
csst_dfs_api_local/facility/level0prc.py
View file @
cb6500aa
...
...
@@ -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"
)
)
...
...
csst_dfs_api_local/facility/observation.py
View file @
cb6500aa
...
...
@@ -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
()
...
...
csst_dfs_api_local/msc/level1.py
View file @
cb6500aa
...
...
@@ -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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment