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

make compatible with custom reference files

parent 52be14c7
...@@ -227,6 +227,10 @@ class CsstMsDataManager: ...@@ -227,6 +227,10 @@ class CsstMsDataManager:
if verbose: if verbose:
self.logger_mod.info("logger_mod initialized") self.logger_mod.info("logger_mod initialized")
self.custom_bias = None
self.custom_dark = None
self.custom_flat = None
# DFS APIs # DFS APIs
@property @property
def dfs_L0DataApi(self): def dfs_L0DataApi(self):
...@@ -406,30 +410,40 @@ class CsstMsDataManager: ...@@ -406,30 +410,40 @@ class CsstMsDataManager:
def get_bias(self, detector=6): def get_bias(self, detector=6):
""" get bias data """ """ get bias data """
if self.datatype == "mbi": if self.custom_bias is None:
return glob.glob(self.path_aux.format("CLB", detector))[0] if self.datatype == "mbi":
return glob.glob(self.path_aux.format("CLB", detector))[0]
else:
return self.path_aux.format(detector, "bias")
else: else:
return self.path_aux.format(detector, "bias") return self.custom_bias(detector)
def get_dark(self, detector=6): def get_dark(self, detector=6):
""" get dark data """ """ get dark data """
if self.datatype == "mbi": if self.custom_dark is None:
return glob.glob(self.path_aux.format("CLD", detector))[0] if self.datatype == "mbi":
return glob.glob(self.path_aux.format("CLD", detector))[0]
else:
return self.path_aux.format(detector, "dark")
else: else:
return self.path_aux.format(detector, "dark") return self.custom_dark(detector)
def get_flat(self, detector=6): def get_flat(self, detector=6):
""" get flat data """ """ get flat data """
if self.datatype == "mbi": if self.custom_flat is None:
return glob.glob(self.path_aux.format("CLF", detector))[0] if self.datatype == "mbi":
return glob.glob(self.path_aux.format("CLF", detector))[0]
else:
return self.path_aux.format(detector, "flat")
else: else:
return self.path_aux.format(detector, "flat") return self.custom_flat(detector)
def get_axeconf(self): def get_axeconf(self):
if os.uname()[1] == "dandelion": if os.uname()[1] == "dandelion":
return "/home/csstpipeline/L1Pipeline/aux/axeconf" return "/home/csstpipeline/L1Pipeline/aux/axeconf"
else: else:
return "" # in docker
return "/L1Pipeline/aux/axeconf"
def l1_file(self, name="", comment=""): def l1_file(self, name="", comment=""):
""" L1 file path """ L1 file path
......
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