Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_common
Commits
03f43f98
Commit
03f43f98
authored
May 24, 2023
by
BO ZHANG
🏀
Browse files
add CsstMsFile
parent
a9519212
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
03f43f98
...
@@ -1017,7 +1017,6 @@ class CsstMsFile(dict):
...
@@ -1017,7 +1017,6 @@ class CsstMsFile(dict):
self
.
filename
=
os
.
path
.
basename
(
filepath
)
self
.
filename
=
os
.
path
.
basename
(
filepath
)
self
.
dir_l0
=
os
.
path
.
dirname
(
filepath
)
self
.
dir_l0
=
os
.
path
.
dirname
(
filepath
)
print
(
"parsing"
,
filepath
)
# parse filename
# parse filename
pattern
=
re
.
compile
(
pattern
=
re
.
compile
(
r
"(?P<telescope>[A-Z]+)_"
r
"(?P<telescope>[A-Z]+)_"
...
@@ -1033,7 +1032,11 @@ class CsstMsFile(dict):
...
@@ -1033,7 +1032,11 @@ class CsstMsFile(dict):
r
"(?P<ext>[a-zA-Z._]+)"
r
"(?P<ext>[a-zA-Z._]+)"
)
)
mo
=
re
.
fullmatch
(
pattern
,
self
.
filename
)
mo
=
re
.
fullmatch
(
pattern
,
self
.
filename
)
assert
mo
is
not
None
try
:
assert
mo
is
not
None
except
AssertionError
as
ae
:
print
(
self
.
filename
)
raise
ae
mogd
=
mo
.
groupdict
()
mogd
=
mo
.
groupdict
()
# mogd.pop("detector")
# mogd.pop("detector")
...
@@ -1079,6 +1082,8 @@ class CsstMsFile(dict):
...
@@ -1079,6 +1082,8 @@ class CsstMsFile(dict):
return
CsstMsFile
(
return
CsstMsFile
(
filepath
=
rec
[
"data"
].
file_path
,
ver_sim
=
ver_sim
,
dir_l0
=
dir_l0
,
dir_l1
=
dir_l1
,
dfs_root
=
dfs_root
,
**
header
)
filepath
=
rec
[
"data"
].
file_path
,
ver_sim
=
ver_sim
,
dir_l0
=
dir_l0
,
dir_l1
=
dir_l1
,
dfs_root
=
dfs_root
,
**
header
)
def
__repr__
(
self
):
return
f
"CsstMsFile(
{
self
.
filename
}
)"
# file = CsstMsFile(
# file = CsstMsFile(
# "L1/MSC/SCI/62173/10160000108/CSST_MSC_MS_SCI_20290206174352_20290206174622_10160000108_21_L1_V01.fits")
# "L1/MSC/SCI/62173/10160000108/CSST_MSC_MS_SCI_20290206174352_20290206174622_10160000108_21_L1_V01.fits")
#
#
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment