Loading README.md +3 −1 Original line number Diff line number Diff line Loading @@ -70,9 +70,11 @@ dm.l1_file("flipped_image.fits") ``` a shortcut for test dataset ```python from csst_common.data_manager import CsstMbiDataManager CsstMbiDataManager.quick_dataset(hostname="dandelion", ver_sim="C5.2", dir_l1=".", exposure_id=100) CsstMbiDataManager.quickstart(hostname="dandelion", ver_sim="C5.2", dir_l1=".", exposure_id=100) ``` ## algorithm description Loading csst_common/data_manager.py +13 −14 Original line number Diff line number Diff line import os import glob import re Loading Loading @@ -29,13 +28,13 @@ class CsstMbiDataManager: """ def __init__(self, ver_sim="C5.1", dir_l0="", dir_l1="", dir_pcref="", path_aux="", force_all_detectors=False): def __init__(self, ver_sim="C5.2", dir_l0="", dir_l1="", dir_pcref="", path_aux="", force_all_detectors=False): """ initialize the multi-band imaging data manager Parameters ---------- ver_sim: str version of simulation data, see csst_common.params.cp.sim.VERSIONS version of simulation data, see csst_common.params.CP dir_l0: str L0 directory dir_l1: str Loading Loading @@ -156,20 +155,20 @@ class CsstMbiDataManager: self._instrument, self._cat_id, self._exp_id - 100000000, detector) elif self.ver_sim == "C5.1": fn = "{}_{}_chip_{:02d}_filt_{}.cat".format( self._instrument, self._exp_id - 90000000, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id - 90000000, detector, CP["mbi"]["detector2filter"]) elif self.ver_sim == "C5.2": fn = "{}_{}_chip_{:02d}_filt_{}.cat".format( self._instrument, self._exp_id, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id, detector, CP["mbi"]["detector2filter"]) return os.path.join(self.dir_l0, fn) def l0_log(self, detector=6): """ L0 log file path """ if self.ver_sim == "C5.1": fn = "{}_{}_chip_{:02d}_filt_{}.log".format( self._instrument, self._exp_id - 90000000, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id - 90000000, detector, CP["mbi"]["detector2filter"]) elif self.ver_sim == "C5.2": fn = "{}_{}_chip_{:02d}_filt_{}.log".format( self._instrument, self._exp_id, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id, detector, CP["mbi"]["detector2filter"]) return os.path.join(self.dir_l0, fn) def l0_detector(self, detector=6): Loading Loading @@ -345,9 +344,9 @@ class CsstMbiDataManager: DIR_SIM = { ("C5.2", "dandelion"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" \ ("C5.2", "dandelion"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" "NGP_AstrometryON_shearOFF/MSC_{:07d}/", ("C5.2", "ubuntu"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" \ ("C5.2", "ubuntu"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" "NGP_AstrometryON_shearOFF/MSC_{:07d}/", } Loading @@ -369,7 +368,7 @@ if __name__ == "__main__": print("----- available detectors -----") print(dm.available_detectors) print("----- L1 images -----") print(dm.l1_detector(25, "img", "fits")) print(dm.l1_detector(25, "img.fits")) # test C5.1 import os Loading Loading
README.md +3 −1 Original line number Diff line number Diff line Loading @@ -70,9 +70,11 @@ dm.l1_file("flipped_image.fits") ``` a shortcut for test dataset ```python from csst_common.data_manager import CsstMbiDataManager CsstMbiDataManager.quick_dataset(hostname="dandelion", ver_sim="C5.2", dir_l1=".", exposure_id=100) CsstMbiDataManager.quickstart(hostname="dandelion", ver_sim="C5.2", dir_l1=".", exposure_id=100) ``` ## algorithm description Loading
csst_common/data_manager.py +13 −14 Original line number Diff line number Diff line import os import glob import re Loading Loading @@ -29,13 +28,13 @@ class CsstMbiDataManager: """ def __init__(self, ver_sim="C5.1", dir_l0="", dir_l1="", dir_pcref="", path_aux="", force_all_detectors=False): def __init__(self, ver_sim="C5.2", dir_l0="", dir_l1="", dir_pcref="", path_aux="", force_all_detectors=False): """ initialize the multi-band imaging data manager Parameters ---------- ver_sim: str version of simulation data, see csst_common.params.cp.sim.VERSIONS version of simulation data, see csst_common.params.CP dir_l0: str L0 directory dir_l1: str Loading Loading @@ -156,20 +155,20 @@ class CsstMbiDataManager: self._instrument, self._cat_id, self._exp_id - 100000000, detector) elif self.ver_sim == "C5.1": fn = "{}_{}_chip_{:02d}_filt_{}.cat".format( self._instrument, self._exp_id - 90000000, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id - 90000000, detector, CP["mbi"]["detector2filter"]) elif self.ver_sim == "C5.2": fn = "{}_{}_chip_{:02d}_filt_{}.cat".format( self._instrument, self._exp_id, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id, detector, CP["mbi"]["detector2filter"]) return os.path.join(self.dir_l0, fn) def l0_log(self, detector=6): """ L0 log file path """ if self.ver_sim == "C5.1": fn = "{}_{}_chip_{:02d}_filt_{}.log".format( self._instrument, self._exp_id - 90000000, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id - 90000000, detector, CP["mbi"]["detector2filter"]) elif self.ver_sim == "C5.2": fn = "{}_{}_chip_{:02d}_filt_{}.log".format( self._instrument, self._exp_id, detector, cp.mbi.DETECTOR2FILTER[detector]) self._instrument, self._exp_id, detector, CP["mbi"]["detector2filter"]) return os.path.join(self.dir_l0, fn) def l0_detector(self, detector=6): Loading Loading @@ -345,9 +344,9 @@ class CsstMbiDataManager: DIR_SIM = { ("C5.2", "dandelion"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" \ ("C5.2", "dandelion"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" "NGP_AstrometryON_shearOFF/MSC_{:07d}/", ("C5.2", "ubuntu"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" \ ("C5.2", "ubuntu"): "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" "NGP_AstrometryON_shearOFF/MSC_{:07d}/", } Loading @@ -369,7 +368,7 @@ if __name__ == "__main__": print("----- available detectors -----") print(dm.available_detectors) print("----- L1 images -----") print(dm.l1_detector(25, "img", "fits")) print(dm.l1_detector(25, "img.fits")) # test C5.1 import os Loading