diff --git a/csst_common/data_manager.py b/csst_common/data_manager.py index f1c95de32b4940c88dda682a42761734e83866be..7494a6912e7e6e130d87ab492134237fe8c0ed8e 100644 --- a/csst_common/data_manager.py +++ b/csst_common/data_manager.py @@ -227,6 +227,10 @@ class CsstMsDataManager: if verbose: self.logger_mod.info("logger_mod initialized") + self.custom_bias = None + self.custom_dark = None + self.custom_flat = None + # DFS APIs @property def dfs_L0DataApi(self): @@ -406,30 +410,40 @@ class CsstMsDataManager: def get_bias(self, detector=6): """ get bias data """ - if self.datatype == "mbi": - return glob.glob(self.path_aux.format("CLB", detector))[0] + if self.custom_bias is None: + if self.datatype == "mbi": + return glob.glob(self.path_aux.format("CLB", detector))[0] + else: + return self.path_aux.format(detector, "bias") else: - return self.path_aux.format(detector, "bias") + return self.custom_bias(detector) def get_dark(self, detector=6): """ get dark data """ - if self.datatype == "mbi": - return glob.glob(self.path_aux.format("CLD", detector))[0] + if self.custom_dark is None: + if self.datatype == "mbi": + return glob.glob(self.path_aux.format("CLD", detector))[0] + else: + return self.path_aux.format(detector, "dark") else: - return self.path_aux.format(detector, "dark") + return self.custom_dark(detector) def get_flat(self, detector=6): """ get flat data """ - if self.datatype == "mbi": - return glob.glob(self.path_aux.format("CLF", detector))[0] + if self.custom_flat is None: + if self.datatype == "mbi": + return glob.glob(self.path_aux.format("CLF", detector))[0] + else: + return self.path_aux.format(detector, "flat") else: - return self.path_aux.format(detector, "flat") + return self.custom_flat(detector) def get_axeconf(self): if os.uname()[1] == "dandelion": return "/home/csstpipeline/L1Pipeline/aux/axeconf" else: - return "" + # in docker + return "/L1Pipeline/aux/axeconf" def l1_file(self, name="", comment=""): """ L1 file path