diff --git a/tests/test_epoch.py b/tests/test_epoch.py new file mode 100644 index 0000000000000000000000000000000000000000..2d7a4908269651a91c1ca8b35e84eae8388ba545 --- /dev/null +++ b/tests/test_epoch.py @@ -0,0 +1,48 @@ +""" +Identifier: csst-l1/msc/csst_msc_common/csst_msc_commn/tests/test_epoch.py +Name: test_epoch.py +Description: Coordinates system transformation due to motion according to the CSST orbit parameters. +Author: Zihuang Cao (zhcao@nao.cas.cn), Jundan Nie (jdnie@nao.cas.cn) +Created: 2023-12-12 +Modified-History: + 2023-12-12, Zihuang Cao, created + 2023-12-19, Zihuang Cao, added fault tolerance mechanism. +""" + +import unittest +from astropy.io import fits +from epoch import get_refcat_onOrbit +import sys +import os + +filename = "gaia_dfs.fits" +common_path = "/nfsdata/share/pipeline-unittest/csst_msc_common/catalog" + + +class PositionTest(unittest.TestCase): + def test_epoch_onorbit(self): + """ + Aim + --- + Test on epoch converstion on orbit, process on a catalog. + + Criteria + -------- + Get the corrected sky coordinates list. + + Details + -------- + This test is used to test the calculation for c6.2 version data. + """ + input_catalog_abspath = os.path.join(common_path, filename) + if not os.path.exists(input_catalog_abspath): + input_catalog_abspath = os.path.join("./", filename) + hdulist = fits.open(input_catalog_abspath) + catalog_table = hdulist[1].data + cur_obs_skyCoord_list = get_refcat_onOrbit(catalog_table) + hdulist.close() + print("test_epoch_onorbit passed !!") + + +if __name__ == "__main__": + unittest.main()