Commit ff5b057c authored by Wei Shoulin's avatar Wei Shoulin
Browse files

split level0data

parent e6920eeb
Pipeline #3 canceled with stages
......@@ -2,9 +2,9 @@ import os
import unittest
from astropy.io import fits
from csst_dfs_api.facility.level0prc import Level0PrcApi
from csst_dfs_api.ifs.level0prc import Level0PrcApi
class Level0PrcTestCase(unittest.TestCase):
class IFSLevel0PrcTestCase(unittest.TestCase):
def setUp(self):
self.api = Level0PrcApi()
......
......@@ -2,9 +2,9 @@ import os
import unittest
from astropy.io import fits
from csst_dfs_api.facility.level1prc import Level1PrcApi
from csst_dfs_api.ifs.level1prc import Level1PrcApi
class Level1PrcTestCase(unittest.TestCase):
class IFSLevel1PrcTestCase(unittest.TestCase):
def setUp(self):
self.api = Level1PrcApi()
......
import os
import unittest
from astropy.io import fits
from csst_dfs_api.msc.calmerge import CalMergeApi
class MSCCalMergeApiTestCase(unittest.TestCase):
def setUp(self):
self.api = CalMergeApi()
# def test_find(self):
# recs = self.api.find(detector_no='CCD01',
# ref_type = "bias",
# obs_time = ("2021-06-01 11:12:13","2021-06-08 11:12:13"))
# print('find:', recs)
# def test_get_latest_by_l0(self):
# rec = self.api.get_latest_by_l0(level0_id='000001102', ref_type = "bias")
# print('get_latest_by_l0:', rec)
def test_get(self):
rec = self.api.get(id = 2)
print('get by id:', rec)
rec = self.api.get(cal_id = '2')
print('get by cal_id:', rec)
# def test_update_proc_status(self):
# rec = self.api.update_proc_status(id = 3, status = 1)
# print('update_proc_status:', rec)
# def test_update_qc1_status(self):
# rec = self.api.update_qc1_status(id = 3, status = 2)
# print('update_qc1_status:', rec)
# def test_write(self):
# rec = self.api.write(
# cal_id = '00002',
# detector_no = '01',
# ref_type = "bias",
# obs_time = "2021-06-04 11:12:13",
# exp_time = 150,
# filename = "/opt/dddasd1.params",
# file_path = "/opt/dddasd1.fits",
# prc_status = 3,
# prc_time = '2021-06-04 11:12:13',
# level0_ids = ['1','2','3','4'])
# print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.msc.level0 import Level0DataApi
class MSCLevel0DataTestCase(unittest.TestCase):
def setUp(self):
self.api = Level0DataApi()
def test_find(self):
recs = self.api.find(obs_id = '000009', obs_type = 'sci', limit = 0)
print('find:', recs)
def test_get(self):
rec = self.api.get(id = 100)
print('get:', rec)
rec = self.api.get(level0_id = '1000000102')
print('get:', rec)
def test_update_proc_status(self):
rec = self.api.update_proc_status(level0_id = '000001102', status = 6)
print('update_proc_status:', rec)
def test_update_qc0_status(self):
rec = self.api.update_qc0_status(level0_id = '000001102', status = 7)
print('update_qc0_status:', rec)
def test_write(self):
rec = self.api.write(
level0_id = '000001101',
obs_id = '0000011',
detector_no = "01",
obs_type = "sci",
obs_time = "2021-06-06 11:12:13",
exp_time = 150,
detector_status_id = 3,
filename = "MSC_00001234",
file_path = "/opt/MSC_00001234.fits")
print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.msc.level0prc import Level0PrcApi
class MSCLevel0PrcTestCase(unittest.TestCase):
def setUp(self):
self.api = Level0PrcApi()
def test_find(self):
recs = self.api.find(level0_id='134')
print('find:', recs)
def test_update_proc_status(self):
rec = self.api.update_proc_status(id = 8, status = 4)
print('update_proc_status:', rec)
def test_write(self):
rec = self.api.write(
level0_id='134',
pipeline_id = "P1",
prc_module = "QC0",
params_file_path = "/opt/dddasd.params",
prc_status = 3,
prc_time = '2021-06-04 11:12:13',
result_file_path = "/opt/dddasd.header")
print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.msc.level1prc import Level1PrcApi
class MSCLevel1PrcTestCase(unittest.TestCase):
def setUp(self):
self.api = Level1PrcApi()
def test_find(self):
recs = self.api.find(level1_id=1)
print('find:', recs)
def test_update_proc_status(self):
rec = self.api.update_proc_status(id = 1, status = 4)
print('update_proc_status:', rec)
def test_write(self):
rec = self.api.write(level1_id=1,
pipeline_id = "P1",
prc_module = "QC0",
params_file_path = "/opt/dddasd.params",
prc_status = 3,
prc_time = '2021-06-04 11:12:13',
result_file_path = "/opt/dddasd.header")
print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.sls.calmerge import CalMergeApi
class SLSCalMergeApiTestCase(unittest.TestCase):
def setUp(self):
self.api = CalMergeApi()
# def test_find(self):
# recs = self.api.find(detector_no='CCD01',
# ref_type = "bias",
# obs_time = ("2021-06-01 11:12:13","2021-06-08 11:12:13"))
# print('find:', recs)
# def test_get_latest_by_l0(self):
# rec = self.api.get_latest_by_l0(level0_id='000001102', ref_type = "bias")
# print('get_latest_by_l0:', rec)
def test_get(self):
rec = self.api.get(id = 2)
print('get by id:', rec)
rec = self.api.get(cal_id = '2')
print('get by cal_id:', rec)
# def test_update_proc_status(self):
# rec = self.api.update_proc_status(id = 3, status = 1)
# print('update_proc_status:', rec)
# def test_update_qc1_status(self):
# rec = self.api.update_qc1_status(id = 3, status = 2)
# print('update_qc1_status:', rec)
# def test_write(self):
# rec = self.api.write(
# cal_id = '00002',
# detector_no = '01',
# ref_type = "bias",
# obs_time = "2021-06-04 11:12:13",
# exp_time = 150,
# filename = "/opt/dddasd1.params",
# file_path = "/opt/dddasd1.fits",
# prc_status = 3,
# prc_time = '2021-06-04 11:12:13',
# level0_ids = ['1','2','3','4'])
# print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.sls.level0 import Level0DataApi
class SLSLevel0DataTestCase(unittest.TestCase):
def setUp(self):
self.api = Level0DataApi()
def test_find(self):
recs = self.api.find(obs_id = '000009', obs_type = 'sci', limit = 0)
print('find:', recs)
def test_get(self):
rec = self.api.get(id = 100)
print('get:', rec)
rec = self.api.get(level0_id = '1000000102')
print('get:', rec)
def test_update_proc_status(self):
rec = self.api.update_proc_status(level0_id = '000001102', status = 6)
print('update_proc_status:', rec)
def test_update_qc0_status(self):
rec = self.api.update_qc0_status(level0_id = '000001102', status = 7)
print('update_qc0_status:', rec)
def test_write(self):
rec = self.api.write(
level0_id = '000001101',
obs_id = '0000011',
detector_no = "01",
obs_type = "sci",
obs_time = "2021-06-06 11:12:13",
exp_time = 150,
detector_status_id = 3,
filename = "MSC_00001234",
file_path = "/opt/MSC_00001234.fits")
print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.sls.level0prc import Level0PrcApi
class SLSLevel0PrcTestCase(unittest.TestCase):
def setUp(self):
self.api = Level0PrcApi()
def test_find(self):
recs = self.api.find(level0_id='134')
print('find:', recs)
def test_update_proc_status(self):
rec = self.api.update_proc_status(id = 8, status = 4)
print('update_proc_status:', rec)
def test_write(self):
rec = self.api.write(
level0_id='134',
pipeline_id = "P1",
prc_module = "QC0",
params_file_path = "/opt/dddasd.params",
prc_status = 3,
prc_time = '2021-06-04 11:12:13',
result_file_path = "/opt/dddasd.header")
print('write:', rec)
\ No newline at end of file
import os
import unittest
from astropy.io import fits
from csst_dfs_api.sls.level1prc import Level1PrcApi
class SLSLevel1PrcTestCase(unittest.TestCase):
def setUp(self):
self.api = Level1PrcApi()
def test_find(self):
recs = self.api.find(level1_id=1)
print('find:', recs)
def test_update_proc_status(self):
rec = self.api.update_proc_status(id = 1, status = 4)
print('update_proc_status:', rec)
def test_write(self):
rec = self.api.write(level1_id=1,
pipeline_id = "P1",
prc_module = "QC0",
params_file_path = "/opt/dddasd.params",
prc_status = 3,
prc_time = '2021-06-04 11:12:13',
result_file_path = "/opt/dddasd.header")
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