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

add dm.get_refs

parent 8544dc5a
......@@ -544,6 +544,28 @@ class CsstMsDataManager:
f"{self.obs_id}_{detector:02d}_L1_V{self.version}_{post}"
return os.path.join(self.dir_l1, fn)
def get_refs(self, detector=6):
if self.crds.is_available:
return self.crds.retry(
self.crds.get_refs, 3,
file_path=self.l0_detector(detector)
)
else:
refs = dict()
if self.datatype == "mbi":
ref_types = ["bias", "dark", "ledflat", "shutter"]
else:
ref_types = ["bias", "dark", "ledflat"]
for ref_type in ref_types:
fp = os.path.join(
self.path_aux,
"C6.2_ref_crds",
"csst_msc_ms_{}_{:02d}_{:06d}.fits".format(detector, detector, 1)
)
assert os.path.exists(fp), f"File not found: [{fp}]"
refs[ref_type] = fp
return refs
def get_bias(self, detector=6):
""" get bias data """
fp = os.path.join(
......
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