Commit 3b7780c1 authored by Wei Shoulin's avatar Wei Shoulin
Browse files

demo

parent fdb6e5b1
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)
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
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
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment