Loading examples/how_this_code_will_be_used.py +16 −7 Original line number Diff line number Diff line Loading @@ -3,19 +3,28 @@ from astropy.io import fits from csst.core.processor import CsstProcessor from csst.msc.data_manager import CsstMscDataManager from csst_proto import flip_image from csst_proto.top_level_interface import flip_image class CsstProcFlipImage(CsstProcessor): """ This processor absorbs photons """ """ This processor flips images """ def __init__(self, dm: CsstMscDataManager, n_jobs: int = 1): """ Parameters ---------- dm: csst data manager, used to manage the input/output file paths n_jobs: number of jobs launched """ super(CsstProcFlipImage, self).__init__() self.dm = dm self.n_jobs = n_jobs def run(self, debug: bool = False): """ run this processor """ flip images for all detectors Parameters ---------- Loading @@ -24,10 +33,10 @@ class CsstProcFlipImage(CsstProcessor): Returns ------- a list of flipped images """ img_flipped_list = joblib.Parallel(n_jobs=self.n_jobs)( joblib.delayed(CsstProcFlipImage.run_one_chip)(this_ccd_id) joblib.delayed(CsstProcFlipImage.run_one_detector)(this_ccd_id) for this_ccd_id in self.dm.target_ccd_ids) return img_flipped_list Loading @@ -40,8 +49,8 @@ class CsstProcFlipImage(CsstProcessor): return @staticmethod def run_one_chip(dm, ccd_id): """ run for one chip def run_one_detector(dm, ccd_id): """ run for one detector this function """ Loading Loading
examples/how_this_code_will_be_used.py +16 −7 Original line number Diff line number Diff line Loading @@ -3,19 +3,28 @@ from astropy.io import fits from csst.core.processor import CsstProcessor from csst.msc.data_manager import CsstMscDataManager from csst_proto import flip_image from csst_proto.top_level_interface import flip_image class CsstProcFlipImage(CsstProcessor): """ This processor absorbs photons """ """ This processor flips images """ def __init__(self, dm: CsstMscDataManager, n_jobs: int = 1): """ Parameters ---------- dm: csst data manager, used to manage the input/output file paths n_jobs: number of jobs launched """ super(CsstProcFlipImage, self).__init__() self.dm = dm self.n_jobs = n_jobs def run(self, debug: bool = False): """ run this processor """ flip images for all detectors Parameters ---------- Loading @@ -24,10 +33,10 @@ class CsstProcFlipImage(CsstProcessor): Returns ------- a list of flipped images """ img_flipped_list = joblib.Parallel(n_jobs=self.n_jobs)( joblib.delayed(CsstProcFlipImage.run_one_chip)(this_ccd_id) joblib.delayed(CsstProcFlipImage.run_one_detector)(this_ccd_id) for this_ccd_id in self.dm.target_ccd_ids) return img_flipped_list Loading @@ -40,8 +49,8 @@ class CsstProcFlipImage(CsstProcessor): return @staticmethod def run_one_chip(dm, ccd_id): """ run for one chip def run_one_detector(dm, ccd_id): """ run for one detector this function """ Loading