Loading csst_common/data_manager.py +36 −17 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ class CsstMsDataManager: raise FileNotFoundError(f"No file found with pattern {pattern} in {dir_l0}") # parse filename if ver_sim == "C6.2": pattern = re.compile( r"(?P<telescope>[A-Z]+)_" r"(?P<instrument>[A-Z]+)_" Loading @@ -397,6 +398,24 @@ class CsstMsDataManager: assert mo is not None mogd = mo.groupdict() mogd.pop("detector") elif ver_sim == "C5.2": pattern = re.compile( r"(?P<telescope>[A-Z]+)_" r"(?P<instrument>[A-Z]+)_" r"(?P<project>[A-Z]+)_" r"(?P<obs_type>[A-Z]+)_" r"(?P<exp_start>[0-9]{14})_" r"(?P<exp_stop>[0-9]{14})_" r"(?P<obs_id>[0-9]{11})_" r"(?P<detector>[0-9]{2})_" r"L(?P<level>[0-9]{1})_" r"(?P<version>[0-9]{1})" r".(?P<ext>[a-z]{4})" ) mo = re.fullmatch(pattern, fps_img[0]) assert mo is not None mogd = mo.groupdict() mogd.pop("detector") # available detectors available_detectors = [int(re.fullmatch(pattern, fp)["detector"]) for fp in fps_img] Loading Loading
csst_common/data_manager.py +36 −17 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ class CsstMsDataManager: raise FileNotFoundError(f"No file found with pattern {pattern} in {dir_l0}") # parse filename if ver_sim == "C6.2": pattern = re.compile( r"(?P<telescope>[A-Z]+)_" r"(?P<instrument>[A-Z]+)_" Loading @@ -397,6 +398,24 @@ class CsstMsDataManager: assert mo is not None mogd = mo.groupdict() mogd.pop("detector") elif ver_sim == "C5.2": pattern = re.compile( r"(?P<telescope>[A-Z]+)_" r"(?P<instrument>[A-Z]+)_" r"(?P<project>[A-Z]+)_" r"(?P<obs_type>[A-Z]+)_" r"(?P<exp_start>[0-9]{14})_" r"(?P<exp_stop>[0-9]{14})_" r"(?P<obs_id>[0-9]{11})_" r"(?P<detector>[0-9]{2})_" r"L(?P<level>[0-9]{1})_" r"(?P<version>[0-9]{1})" r".(?P<ext>[a-z]{4})" ) mo = re.fullmatch(pattern, fps_img[0]) assert mo is not None mogd = mo.groupdict() mogd.pop("detector") # available detectors available_detectors = [int(re.fullmatch(pattern, fp)["detector"]) for fp in fps_img] Loading