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
f2ae94cc
Commit
f2ae94cc
authored
Oct 04, 2022
by
BO ZHANG
🏀
Browse files
tweaks
parent
1424860c
Changes
1
Show whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
f2ae94cc
...
...
@@ -6,6 +6,7 @@ Author: Bo Zhang
Created: 2022-09-13
Modified-History:
2022-09-13, Bo Zhang, created
2022-09-13, Bo Zhang, added CsstMbiDataManager
2022-09-29, Bo Zhang, favor CsstMsDataManager instead of CsstMbiDataManager
"""
import
os
...
...
@@ -40,7 +41,7 @@ class CsstMsDataManager:
"""
def
__init__
(
self
,
ver_sim
=
"C5.2"
,
dir_l0
=
""
,
dir_l1
=
""
,
dir_pcref
=
""
,
path_aux
=
""
,
force
_all_detectors
=
False
,
def
__init__
(
self
,
ver_sim
=
"C5.2"
,
dir_l0
=
""
,
dir_l1
=
""
,
dir_pcref
=
""
,
path_aux
=
""
,
assert
_all_detectors
=
False
,
datatype
=
"mbi"
):
""" initialize the multi-band imaging data manager
...
...
@@ -54,9 +55,10 @@ class CsstMsDataManager:
L1 directory
dir_pcref: str
position calibration data directory
will be removed in the next version
path_aux: str
aux data directory (bias, flat, dark)
force
_all_detectors: bool
assert
_all_detectors: bool
if True, assert data for all detectors are available
datatype: str
{"mbi", "sls"}
...
...
@@ -84,8 +86,11 @@ class CsstMsDataManager:
>>> dm_mbi.l1_file("flipped_image.fits")
"""
assert
ver_sim
in
CP
[
"sim"
][
"versions"
]
self
.
ver_sim
=
ver_sim
assert
datatype
in
[
"mbi"
,
"sls"
]
self
.
datatype
=
datatype
if
datatype
==
"mbi"
:
# MBI
self
.
valid_detectors
=
CP
[
"mbi"
][
"detectors"
]
...
...
@@ -107,7 +112,7 @@ class CsstMsDataManager:
fps_img
=
self
.
glob_image
(
dir_l0
,
ver_sim
=
ver_sim
)
fps_cat
=
self
.
glob_cat
(
dir_l0
,
ver_sim
=
ver_sim
)
if
force
_all_detectors
:
if
assert
_all_detectors
:
assert
len
(
fps_img
)
==
len
(
self
.
valid_detectors
)
else
:
assert
len
(
fps_img
)
>
0
...
...
@@ -636,11 +641,11 @@ class CsstMbiDataManager:
Parameters
----------
ver_sim:
ver_sim:
str
{"C5.2"}
dir_l1:
dir_l1:
str
output directory
exposure_id:
exposure_id:
int
21-154 for C5.2
Returns
...
...
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