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

add CsstMsFile

parent 75c17930
......@@ -1017,6 +1017,7 @@ class CsstMsFile(dict):
self.filename = os.path.basename(filepath)
self.dir_l0 = os.path.dirname(filepath)
print("parsing", filepath)
# parse filename
pattern = re.compile(
r"(?P<telescope>[A-Z]+)_"
......@@ -1029,7 +1030,7 @@ class CsstMsFile(dict):
r"(?P<detector>[0-9]{2})_"
r"L(?P<level>[0-9]{1})_"
r"V(?P<version>[0-9]{2})"
r".(?P<ext>[a-z]{4})"
r"(?P<ext>[a-zA-Z._]+)"
)
mo = re.fullmatch(pattern, self.filename)
assert mo is not None
......@@ -1082,3 +1083,5 @@ class CsstMsFile(dict):
# "L1/MSC/SCI/62173/10160000108/CSST_MSC_MS_SCI_20290206174352_20290206174622_10160000108_21_L1_V01.fits")
#
# file = CsstMsFile.from_l1id(id=17796, dfs_root="/share/dfs")
# file = CsstMsFile.from_l1id(id=12853, dfs_root="/share/dfs")
# CsstMsFile("CSST_MSC_MS_SCI_20280716184136_20280716184406_10160000099_14_L1_V01_IMG.fits")
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