test_main.py 1.52 KB
Newer Older
Chen Yili's avatar
Chen Yili committed
1
import unittest
2
from csst_cpic_sim import observation_simulation, quick_run
Chen Yili's avatar
Chen Yili committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62


class TestMain(unittest.TestCase):
    def test_main(self):
        target_example = {
            'name': 'test',
            'cstar': {
                'magnitude': 0,
                'ra': '120d',
                'dec': '40d',
                'distance': 10,
                'sptype': 'F0III',
            },
            # 'stars': [
            #     {
            #         'magnitude': 15,
            #         'ra': '120d0m5s',
            #         'dec': '40d00m3s',
            #         'sptype': 'G0III',
            #         'isblackbody': True
            #     },
            # ],
            # 'planets': [
            #     {
            #         'radius': 20,
            #         'pangle': 60,
            #         'separation': 0.7,
            #         'phase_angle': 90,
            #     }
            # ]
        }

        quick_run('', 10, 'f661', 1, 1, 30)
        quick_run('*2.4/10(3,5)/15(-4,2)', 21, 'f661', 1, 1, 30)

        # normal target
        observation_simulation(
            target=target_example,
            skybg=21,
            expt=1,
            nframe=1,
            band='f661',
            emgain=30,
            obsid=51012345678,
        )

        # bias-gain
        observation_simulation(
            target={},
            skybg=None,
            expt=1,
            nframe=1,
            band='f661',
            emgain=30,
            obsid=50112345678,
        )


if __name__ == '__main__':
    unittest.main()