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
eda1b0c3
Commit
eda1b0c3
authored
Nov 21, 2022
by
BO ZHANG
🏀
Browse files
renamed exp_id to obs_id
parent
57bb7847
Changes
1
Show whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
eda1b0c3
...
...
@@ -80,11 +80,11 @@ class CsstMsDataManager:
dfs_node : str
The environment in which the pipeline will run.
Use "pml" for Purple Mountain Lab cluster and "local" for others.
_exp
_id : int
obs
_id : int
The exposure ID.
_
exp_start : int
exp_start : int
The exposure start time in ``yyyymmddhhmmss`` format.
_
exp_stop : int
exp_stop : int
The exposure start time in ``yyyymmddhhmmss`` format.
_telescope : str
The telescope name. Defaults to ``CSST`` for C5.2 simulation.
...
...
@@ -92,9 +92,9 @@ class CsstMsDataManager:
The instrument name. Defaults to ``MSC`` for C5.2 simulation.
_survey : str
The survey name. Defaults to ``MS`` for C5.2 simulation.
_image
type : str
obs_
type : str
The image type signature for science images. Defualts to ``SCI`` for C5.2 simulation.
_
l0_post : str
l0_post : str
The postfix. Defaults to ``L0_1`` for C5.2 simulation.
log_ppl : str
The pipeline log file name.
...
...
@@ -134,14 +134,14 @@ class CsstMsDataManager:
path_aux
:
str
=
""
,
# bias dark flat
dfs_mode
:
bool
=
False
,
dfs_node
:
str
=
"kmust"
,
_exp
_id
:
int
=
100000100
,
_
exp_start
:
int
=
20270810081950
,
_
exp_stop
:
int
=
20270810082220
,
obs
_id
:
str
=
"
100000100
"
,
exp_start
:
int
=
"
20270810081950
"
,
exp_stop
:
int
=
"
20270810082220
"
,
_telescope
:
str
=
"CSST"
,
_instrument
:
str
=
"MSC"
,
_survey
:
str
=
"MS"
,
_image
type
:
str
=
"SCI"
,
_
l0_post
:
str
=
"L0_1"
,
obs_
type
:
str
=
"SCI"
,
l0_post
:
str
=
"L0_1"
,
log_ppl
=
"csst-l1ppl.log"
,
log_mod
=
"csst-l1mod.log"
,
clear_dir
=
False
,
...
...
@@ -176,16 +176,16 @@ class CsstMsDataManager:
self
.
target_detectors
=
target_detectors
# exposure info
self
.
_exp
_id
=
_exp
_id
self
.
_
exp_start
=
_
exp_start
self
.
_
exp_stop
=
_
exp_stop
self
.
obs
_id
=
obs
_id
self
.
exp_start
=
exp_start
self
.
exp_stop
=
exp_stop
# file name components
self
.
_telescope
=
_telescope
self
.
_instrument
=
_instrument
self
.
_survey
=
_survey
self
.
_image
type
=
_image
type
self
.
_
l0_post
=
_
l0_post
self
.
obs_
type
=
obs_
type
self
.
l0_post
=
l0_post
# for catalog query
self
.
dfs_mode
=
dfs_mode
...
...
@@ -266,13 +266,13 @@ class CsstMsDataManager:
available_detectors
.
sort
()
# parse info
_telescope
,
_instrument
,
_survey
,
_image
type
,
\
_
exp_start
,
_
exp_stop
,
_exp
_id
,
\
_detector
,
*
_
l0_post
,
_ext
=
re
.
split
(
r
"[_.]"
,
fps_img
[
0
])
(
_telescope
,
_instrument
,
_survey
,
obs_
type
,
exp_start
,
exp_stop
,
obs
_id
,
_detector
,
*
l0_post
,
_ext
)
=
re
.
split
(
r
"[_.]"
,
fps_img
[
0
])
_
exp_start
=
int
(
_
exp_start
)
_
exp_stop
=
int
(
_
exp_stop
)
_exp
_id
=
int
(
_exp
_id
)
#
exp_start = int(exp_start)
#
exp_stop = int(exp_stop)
# obs
_id = int(
obs
_id)
return
CsstMsDataManager
(
ver_sim
=
ver_sim
,
datatype
=
datatype
,
...
...
@@ -283,14 +283,14 @@ class CsstMsDataManager:
path_aux
=
path_aux
,
# bias dark flat
dfs_mode
=
dfs_mode
,
dfs_node
=
dfs_node
,
_exp_id
=
_exp
_id
,
_
exp_start
=
_
exp_start
,
_
exp_stop
=
_
exp_stop
,
obs_id
=
obs
_id
,
exp_start
=
exp_start
,
exp_stop
=
exp_stop
,
_telescope
=
_telescope
,
_instrument
=
_instrument
,
_survey
=
_survey
,
_imagetype
=
_image
type
,
_
l0_post
=
"_"
.
join
(
_
l0_post
),
obs_type
=
obs_
type
,
l0_post
=
"_"
.
join
(
l0_post
),
)
@
staticmethod
...
...
@@ -320,18 +320,22 @@ class CsstMsDataManager:
print
(
"@DM.glob_dir: {} files found with pattern: {}"
.
format
(
len
(
fps
),
pattern
))
return
fps
def
l0_id
(
self
,
detector
=
6
):
""" Level0 ID, consistent with DFS. """
return
f
"
{
self
.
obs_id
}{
detector
:
02
d
}
"
def
l0_cat
(
self
,
detector
=
6
):
""" the L0 cat file path"""
assert
self
.
ver_sim
==
"C5.2"
fn
=
"{}_{}_chip_{:02d}_filt_{}.cat"
.
format
(
self
.
_instrument
,
self
.
_exp
_id
,
detector
,
self
.
detector2filter
[
detector
])
self
.
_instrument
,
self
.
obs
_id
,
detector
,
self
.
detector2filter
[
detector
])
return
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
def
l0_log
(
self
,
detector
=
6
):
""" L0 log file path """
assert
self
.
ver_sim
==
"C5.2"
fn
=
"{}_{}_chip_{:02d}_filt_{}.log"
.
format
(
self
.
_instrument
,
self
.
_exp
_id
,
detector
,
self
.
detector2filter
[
detector
])
self
.
_instrument
,
self
.
obs
_id
,
detector
,
self
.
detector2filter
[
detector
])
return
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
def
l0_detector
(
self
,
detector
=
6
):
...
...
@@ -339,7 +343,7 @@ class CsstMsDataManager:
assert
self
.
ver_sim
in
[
"C5.1"
,
"C5.2"
]
fn
=
"{}_{}_{}_SCI_{}_{}_{}_{:02d}_L0_1.fits"
.
format
(
self
.
_telescope
,
self
.
_instrument
,
self
.
_survey
,
self
.
_
exp_start
,
self
.
_
exp_stop
,
self
.
_exp
_id
,
detector
)
self
.
exp_start
,
self
.
exp_stop
,
self
.
obs
_id
,
detector
)
return
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
def
l0_crs
(
self
,
detector
=
6
):
...
...
@@ -347,7 +351,7 @@ class CsstMsDataManager:
assert
self
.
ver_sim
in
[
"C5.1"
,
"C5.2"
]
fn
=
"{}_{}_{}_CRS_{}_{}_{}_{:02d}_L0_1.fits"
.
format
(
self
.
_telescope
,
self
.
_instrument
,
self
.
_survey
,
self
.
_
exp_start
,
self
.
_
exp_stop
,
self
.
_exp
_id
,
detector
)
self
.
exp_start
,
self
.
exp_stop
,
self
.
obs
_id
,
detector
)
return
os
.
path
.
join
(
self
.
dir_l0
,
fn
)
def
l1_detector
(
self
,
detector
=
6
,
post
=
"img.fits"
):
...
...
@@ -369,7 +373,7 @@ class CsstMsDataManager:
assert
self
.
ver_sim
in
[
"C5.1"
,
"C5.2"
]
fn
=
"{}_{}_{}_SCI_{}_{}_{}_{:02d}_{}"
.
format
(
self
.
_telescope
,
self
.
_instrument
,
self
.
_survey
,
self
.
_
exp_start
,
self
.
_
exp_stop
,
self
.
_exp
_id
,
detector
,
post
)
self
.
exp_start
,
self
.
exp_stop
,
self
.
obs
_id
,
detector
,
post
)
return
os
.
path
.
join
(
self
.
dir_l1
,
fn
)
def
get_bias
(
self
,
detector
=
6
):
...
...
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