test_ifs_level0.py 1.09 KB
Newer Older
Wei Shoulin's avatar
c3  
Wei Shoulin committed
1
2
3
4
import os
import unittest
from astropy.io import fits

Wei Shoulin's avatar
Wei Shoulin committed
5
from csst_dfs_api.ifs.level0 import Level0DataApi
Wei Shoulin's avatar
c3  
Wei Shoulin committed
6

Wei Shoulin's avatar
Wei Shoulin committed
7
class IFSLevel0DataTestCase(unittest.TestCase):
Wei Shoulin's avatar
c3  
Wei Shoulin committed
8
9
10
11

    def setUp(self):
        self.api = Level0DataApi()

Wei Shoulin's avatar
Wei Shoulin committed
12
13
14
    # def test_find(self):
    #     result = self.api.find(ra = 248, dec = 87, radius = 2, limit = 0, obs_type = "sky")
    #     print('find:', result)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
15

Wei Shoulin's avatar
Wei Shoulin committed
16
17
18
    # def test_get(self):
    #     result = self.api.get(id = 1)
    #     print('get:', result.data)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
19

Wei Shoulin's avatar
Wei Shoulin committed
20
21
    #     rec = self.api.get(level0_id = '300000145CCD231-c4')
    #     print('get:', rec)        
Wei Shoulin's avatar
Wei Shoulin committed
22

Wei Shoulin's avatar
Wei Shoulin committed
23
24
25
    # def test_update_proc_status(self):
    #     rec = self.api.update_proc_status(level0_id = '000001102', status = 6)
    #     print('update_proc_status:', rec)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
26

Wei Shoulin's avatar
Wei Shoulin committed
27
28
29
    # def test_update_qc0_status(self):
    #     rec = self.api.update_qc0_status(level0_id = '000001102', status = 7)
    #     print('update_qc0_status:', rec)
Wei Shoulin's avatar
c3  
Wei Shoulin committed
30
31

    def test_write(self):
Wei Shoulin's avatar
Wei Shoulin committed
32
        rec = self.api.write(file_path = "/Users/wsl/temp/csst/ifs_data/sky_Data/CSST_IFS_B_sky_20211225001425_20211225001925_300000013_X_L0_VER_I4203.fits")
Wei Shoulin's avatar
c3  
Wei Shoulin committed
33
        print('write:', rec)