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
c57b2056
Commit
c57b2056
authored
Mar 21, 2023
by
BO ZHANG
🏀
Browse files
compatible with C6.1
parent
a197ecc8
Changes
1
Show whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
c57b2056
...
...
@@ -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
==
"C
6
.2"
:
el
if
ver_sim
in
[
"C
5
.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"
)
el
if
ver_sim
==
"C5.2"
:
el
se
:
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
:
02
d
}
_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
:
02
d
}
_
{
post
}
"
else
:
...
...
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