Commit 69b719fe authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

updated example

parent 866429fd
......@@ -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
----------
......@@ -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
......@@ -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
"""
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment