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
2f47a008
Commit
2f47a008
authored
Oct 27, 2022
by
BO ZHANG
🏀
Browse files
tweaks
parent
e1cdd067
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
2f47a008
...
...
@@ -16,6 +16,7 @@ import re
from
astropy.io
import
fits
from
astropy.table
import
Table
from
typing
import
Union
,
Tuple
from
.params
import
CSST_PARAMS
as
CP
...
...
@@ -107,22 +108,23 @@ class CsstMsDataManager:
"""
def
__init__
(
self
,
ver_sim
=
"C5.2"
,
datatype
=
"mbi"
,
available_detectors
=
None
,
target_detectors
=
None
,
dir_l0
=
"."
,
dir_l1
=
"."
,
path_aux
=
""
,
# bias dark flat
dir_pcref
=
""
,
# deprecated
_exp_id
=
100000100
,
_exp_start
=
20270810081950
,
_exp_stop
=
20270810082220
,
_telescope
=
"CSST"
,
_instrument
=
"MSC"
,
_survey
=
"MS"
,
_imagetype
=
"SCI"
,
_l0_post
=
"L0_1"
,
ver_sim
:
str
=
"C5.2"
,
datatype
:
str
=
"mbi"
,
available_detectors
:
Union
[
None
,
list
]
=
None
,
target_detectors
:
Union
[
None
,
list
]
=
None
,
dir_l0
:
str
=
"."
,
dir_l1
:
str
=
"."
,
path_aux
:
str
=
""
,
# bias dark flat
dir_pcref
:
str
=
""
,
# deprecated
_exp_id
:
int
=
100000100
,
_exp_start
:
int
=
20270810081950
,
_exp_stop
:
int
=
20270810082220
,
_telescope
:
str
=
"CSST"
,
_instrument
:
str
=
"MSC"
,
_survey
:
str
=
"MS"
,
_imagetype
:
str
=
"SCI"
,
_l0_post
:
str
=
"L0_1"
,
_dfs_mode
:
bool
=
False
,
):
# version
...
...
@@ -162,6 +164,7 @@ class CsstMsDataManager:
self
.
_survey
=
_survey
self
.
_imagetype
=
_imagetype
self
.
_l0_post
=
_l0_post
self
.
_dfs_mode
=
_dfs_mode
# data directory
self
.
dir_l0
=
dir_l0
...
...
@@ -362,16 +365,18 @@ class CsstMsDataManager:
self
.
hardcode_history
.
append
(
dict
(
hdcd
=
fp
,
comment
=
comment
))
return
fp
def
get_sls_info
(
self
,
use_dfs
=
False
):
if
use_dfs
:
def
get_sls_info
(
self
):
""" Get the target SLS image header info and return. """
if
self
.
_dfs_mode
:
raise
NotImplementedError
()
else
:
assert
len
(
self
.
target_detectors
)
==
1
header
=
fits
.
getheader
(
self
.
l0_detector
(
self
.
target_detectors
[
0
]),
ext
=
1
)
return
header
def
get_mbi_info
(
self
,
use_dfs
=
False
):
if
use_dfs
:
def
get_mbi_info
(
self
):
""" Get all MBI image header info and return as a table. """
if
self
.
_dfs_mode
:
raise
NotImplementedError
()
else
:
info
=
Table
.
read
(
"/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/t_mbi_l1.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