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
Commits
3b7780c1
Commit
3b7780c1
authored
Jun 25, 2021
by
Wei Shoulin
Browse files
demo
parent
fdb6e5b1
Changes
4
Hide whitespace changes
Inline
Side-by-side
examples/demo_facility_level0.py
0 → 100644
View file @
3b7780c1
from
csst_dfs_api.facility.level0
import
Level0DataApi
api
=
Level0DataApi
()
# find
recs
=
api
.
find
(
obs_id
=
17
,
obs_type
=
'sci'
,
limit
=
0
)
print
(
'find:'
,
recs
)
# get
rec
=
api
.
get
(
fits_id
=
100
)
print
(
'get:'
,
rec
)
# update_proc_status
rec
=
api
.
update_proc_status
(
fits_id
=
100
,
status
=
6
)
print
(
'update_proc_status:'
,
rec
)
# update_qc0_status
rec
=
api
.
update_qc0_status
(
fits_id
=
100
,
status
=
7
)
print
(
'update_qc0_status:'
,
rec
)
examples/demo_facility_level0_prc.py
0 → 100644
View file @
3b7780c1
from
csst_dfs_api.facility.level0prc
import
Level0PrcApi
api
=
Level0PrcApi
()
#find
recs
=
api
.
find
(
level0_id
=
134
)
print
(
'find:'
,
recs
)
#update_proc_status
rec
=
api
.
update_proc_status
(
id
=
8
,
status
=
4
)
print
(
'update_proc_status:'
,
rec
)
#write
rec
=
api
.
write
(
level0_id
=
134
,
pipeline_id
=
"P1"
,
prc_module
=
"QC0"
,
params_id
=
"/opt/dddasd.params"
,
prc_status
=
3
,
prc_time
=
'2021-06-04 11:12:13'
,
file_path
=
"/opt/dddasd.header"
)
print
(
'write:'
,
rec
)
\ No newline at end of file
examples/demo_facility_observation.py
0 → 100644
View file @
3b7780c1
from
csst_dfs_api.facility.observation
import
ObservationApi
api
=
ObservationApi
()
#find
recs
=
api
.
find
(
module_id
=
"MSC"
,
limit
=
0
)
print
(
'find:'
,
recs
)
# get
rec
=
api
.
get
(
obs_id
=
17
)
print
(
'get:'
,
rec
)
# update_proc_status
rec
=
api
.
update_proc_status
(
obs_id
=
17
,
status
=
3
,)
print
(
'update_proc_status:'
,
rec
)
# update_qc0_status
rec
=
api
.
update_qc0_status
(
obs_id
=
17
,
status
=
3
,)
print
(
'update_qc0_status:'
,
rec
)
\ No newline at end of file
tests/test_facility_observation.py
View file @
3b7780c1
...
...
@@ -14,23 +14,23 @@ class FacilityObservationTestCase(unittest.TestCase):
print
(
'find:'
,
recs
)
def
test_get
(
self
):
rec
=
self
.
api
.
get
(
obs_id
=
9
)
rec
=
self
.
api
.
get
(
obs_id
=
17
)
print
(
'get:'
,
rec
)
def
test_update_proc_status
(
self
):
rec
=
self
.
api
.
update_proc_status
(
obs_id
=
9
,
status
=
3
,
)
rec
=
self
.
api
.
update_proc_status
(
obs_id
=
17
,
status
=
3
,
)
print
(
'update_proc_status:'
,
rec
)
def
test_update_qc0_status
(
self
):
rec
=
self
.
api
.
update_qc0_status
(
obs_id
=
9
,
status
=
3
,
)
rec
=
self
.
api
.
update_qc0_status
(
obs_id
=
17
,
status
=
3
,
)
print
(
'update_qc0_status:'
,
rec
)
def
test_write
(
self
):
rec
=
self
.
api
.
write
(
obs_time
=
"2021-06-06 11:12:13"
,
exp_time
=
150
,
module_id
=
"MSC"
,
obs_type
=
"sci"
,
facility_status_id
=
3
,
module_status_id
=
3
)
print
(
'write:'
,
rec
)
\ No newline at end of file
# def test_write(self):
# rec = self.api.write(
# obs_time = "2021-06-06 11:12:13",
# exp_time = 150,
# module_id = "MSC",
# obs_type = "sci",
# facility_status_id = 3,
# module_status_id = 3)
# print('write:', rec)
\ No newline at end of file
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