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
d07f6fa2
Commit
d07f6fa2
authored
Dec 08, 2022
by
BO ZHANG
🏀
Browse files
make compatible with custom reference files
parent
52be14c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
d07f6fa2
...
...
@@ -227,6 +227,10 @@ class CsstMsDataManager:
if
verbose
:
self
.
logger_mod
.
info
(
"logger_mod initialized"
)
self
.
custom_bias
=
None
self
.
custom_dark
=
None
self
.
custom_flat
=
None
# DFS APIs
@
property
def
dfs_L0DataApi
(
self
):
...
...
@@ -406,30 +410,40 @@ class CsstMsDataManager:
def
get_bias
(
self
,
detector
=
6
):
""" get bias data """
if
self
.
datatype
==
"mbi"
:
return
glob
.
glob
(
self
.
path_aux
.
format
(
"CLB"
,
detector
))[
0
]
if
self
.
custom_bias
is
None
:
if
self
.
datatype
==
"mbi"
:
return
glob
.
glob
(
self
.
path_aux
.
format
(
"CLB"
,
detector
))[
0
]
else
:
return
self
.
path_aux
.
format
(
detector
,
"bias"
)
else
:
return
self
.
path_aux
.
format
(
detector
,
"bias"
)
return
self
.
custom_bias
(
detector
)
def
get_dark
(
self
,
detector
=
6
):
""" get dark data """
if
self
.
datatype
==
"mbi"
:
return
glob
.
glob
(
self
.
path_aux
.
format
(
"CLD"
,
detector
))[
0
]
if
self
.
custom_dark
is
None
:
if
self
.
datatype
==
"mbi"
:
return
glob
.
glob
(
self
.
path_aux
.
format
(
"CLD"
,
detector
))[
0
]
else
:
return
self
.
path_aux
.
format
(
detector
,
"dark"
)
else
:
return
self
.
path_aux
.
format
(
detector
,
"dark"
)
return
self
.
custom_dark
(
detector
)
def
get_flat
(
self
,
detector
=
6
):
""" get flat data """
if
self
.
datatype
==
"mbi"
:
return
glob
.
glob
(
self
.
path_aux
.
format
(
"CLF"
,
detector
))[
0
]
if
self
.
custom_flat
is
None
:
if
self
.
datatype
==
"mbi"
:
return
glob
.
glob
(
self
.
path_aux
.
format
(
"CLF"
,
detector
))[
0
]
else
:
return
self
.
path_aux
.
format
(
detector
,
"flat"
)
else
:
return
self
.
path_aux
.
form
at
(
detector
,
"flat"
)
return
self
.
custom_fl
at
(
detector
)
def
get_axeconf
(
self
):
if
os
.
uname
()[
1
]
==
"dandelion"
:
return
"/home/csstpipeline/L1Pipeline/aux/axeconf"
else
:
return
""
# in docker
return
"/L1Pipeline/aux/axeconf"
def
l1_file
(
self
,
name
=
""
,
comment
=
""
):
""" L1 file path
...
...
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