Commit f2ae94cc authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

tweaks

parent 1424860c
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ Author: Bo Zhang
Created:        2022-09-13
Modified-History:
    2022-09-13, Bo Zhang, created
    2022-09-13, Bo Zhang, added CsstMbiDataManager
    2022-09-29, Bo Zhang, favor CsstMsDataManager instead of CsstMbiDataManager
"""
import os
@@ -40,7 +41,7 @@ class CsstMsDataManager:

    """

    def __init__(self, ver_sim="C5.2", 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="", assert_all_detectors=False,
                 datatype="mbi"):
        """ initialize the multi-band imaging data manager

@@ -54,9 +55,10 @@ class CsstMsDataManager:
            L1 directory
        dir_pcref: str
            position calibration data directory
            will be removed in the next version
        path_aux: str
            aux data directory (bias, flat, dark)
        force_all_detectors: bool
        assert_all_detectors: bool
            if True, assert data for all detectors are available
        datatype: str
            {"mbi", "sls"}
@@ -84,8 +86,11 @@ class CsstMsDataManager:
        >>> dm_mbi.l1_file("flipped_image.fits")
        """
        assert ver_sim in CP["sim"]["versions"]
        self.ver_sim = ver_sim

        assert datatype in ["mbi", "sls"]
        self.datatype = datatype

        if datatype == "mbi":
            # MBI
            self.valid_detectors = CP["mbi"]["detectors"]
@@ -107,7 +112,7 @@ class CsstMsDataManager:
        fps_img = self.glob_image(dir_l0, ver_sim=ver_sim)
        fps_cat = self.glob_cat(dir_l0, ver_sim=ver_sim)

        if force_all_detectors:
        if assert_all_detectors:
            assert len(fps_img) == len(self.valid_detectors)
        else:
            assert len(fps_img) > 0
@@ -636,11 +641,11 @@ class CsstMbiDataManager:

        Parameters
        ----------
        ver_sim:
        ver_sim: str
            {"C5.2"}
        dir_l1:
        dir_l1: str
            output directory
        exposure_id:
        exposure_id: int
            21-154 for C5.2

        Returns