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
b4da1069
Commit
b4da1069
authored
Sep 29, 2022
by
BO ZHANG
🏀
Browse files
tweaks
parent
4aab9f44
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
b4da1069
...
...
@@ -12,6 +12,7 @@ import os
import
glob
import
re
import
numpy
as
np
from
astropy.io
import
fits
from
.params
import
CSST_PARAMS
as
CP
...
...
@@ -266,15 +267,18 @@ class CsstMsDataManager:
print
(
"final target detector IDs are "
,
self
.
target_detectors
)
return
def
get_bias
(
self
,
detector
=
6
):
def
get_bias
(
self
,
detector
=
6
)
->
np
.
ndarray
:
""" get bias data """
fp
=
glob
.
glob
(
self
.
path_aux
.
format
(
"CLB"
,
detector
))[
0
]
return
fits
.
getdata
(
fp
)
def
get_dark
(
self
,
detector
=
6
):
def
get_dark
(
self
,
detector
=
6
)
->
np
.
ndarray
:
""" get dark data """
fp
=
glob
.
glob
(
self
.
path_aux
.
format
(
"CLD"
,
detector
))[
0
]
return
fits
.
getdata
(
fp
)
def
get_flat
(
self
,
detector
=
6
):
def
get_flat
(
self
,
detector
=
6
)
->
np
.
ndarray
:
""" get flat data """
fp
=
glob
.
glob
(
self
.
path_aux
.
format
(
"CLF"
,
detector
))[
0
]
return
fits
.
getdata
(
fp
)
...
...
@@ -349,7 +353,7 @@ class CsstMsDataManager:
dir_pcref
=
""
else
:
raise
ValueError
(
"@DM: invalid hostname {}!"
.
format
(
hostname
))
raise
ValueError
(
"@DM: invalid hostname
{} or datatype
{}!"
.
format
(
hostname
,
datatype
))
return
CsstMsDataManager
(
ver_sim
=
ver_sim
,
datatype
=
datatype
,
dir_l0
=
dir_l0
,
dir_l1
=
dir_l1
,
dir_pcref
=
dir_pcref
,
path_aux
=
path_aux
)
...
...
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