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

compatible with C6.1

parent a197ecc8
......@@ -33,7 +33,7 @@ from csst_dfs_api.sls.level2spectra import Level2SpectraApi as SlsLevel2DataApi
from .logger import get_logger
from .params import CSST_PARAMS as CP
from .params import DFS_CONF
from .time import now, now_dfs
from .time import now
class CsstMsDataManager:
......@@ -385,7 +385,7 @@ class CsstMsDataManager:
raise FileNotFoundError(f"No file found with pattern {pattern} in {dir_l0}")
# parse filename
if ver_sim == "C6.2":
elif ver_sim in ["C5.2", "C6.1"]:
pattern = re.compile(
r"(?P<telescope>[A-Z]+)_"
r"(?P<instrument>[A-Z]+)_"
......@@ -393,17 +393,17 @@ class CsstMsDataManager:
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<obs_id>[0-9]{9})_"
r"(?P<detector>[0-9]{2})_"
r"L(?P<level>[0-9]{1})_"
r"V(?P<version>[0-9]{2})"
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")
elif ver_sim == "C5.2":
else:
pattern = re.compile(
r"(?P<telescope>[A-Z]+)_"
r"(?P<instrument>[A-Z]+)_"
......@@ -411,10 +411,10 @@ class CsstMsDataManager:
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]{9})_"
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"V(?P<version>[0-9]{2})"
r".(?P<ext>[a-z]{4})"
)
mo = re.fullmatch(pattern, fps_img[0])
......@@ -477,7 +477,7 @@ class CsstMsDataManager:
def l0_detector(self, detector=6):
""" L0 detector-specific image file path """
assert detector in self.available_detectors
if self.ver_sim == "C5.2":
if self.ver_sim in ["C5.2", "C6.1"]:
fn = f"{self.telescope}_{self.instrument}_{self.project}_{self.obs_type}_{self.exp_start}_" \
f"{self.exp_stop}_{self.obs_id}_{detector:02d}_L{self.level}_{self.version}.{self.ext}"
else:
......@@ -517,7 +517,7 @@ class CsstMsDataManager:
"""
assert detector in self.available_detectors
if self.ver_sim == "C5.2":
if self.ver_sim in ["C5.2", "C6.1"]:
fn = f"{self.telescope}_{self.instrument}_{self.project}_{self.obs_type}_{self.exp_start}_{self.exp_stop}_" \
f"{self.obs_id}_{detector:02d}_{post}"
else:
......
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