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
51c6e403
Commit
51c6e403
authored
Nov 22, 2022
by
BO ZHANG
🏀
Browse files
rename dfs_mode to use_dfs
parent
79d9ec9a
Changes
2
Show whitespace changes
Inline
Side-by-side
csst_common/data_manager.py
View file @
51c6e403
...
...
@@ -275,7 +275,7 @@ class CsstMsDataManager:
raise
DeprecationWarning
(
"This method is deprecated, please directly use dm.target_detectors = detectors!"
)
@
staticmethod
def
from_dir
(
ver_sim
=
"C5.2"
,
datatype
=
"mbi"
,
dir_l0
=
"."
,
dir_l1
=
"."
,
path_aux
=
""
,
dfs_mode
=
False
,
dfs_node
=
"kmust"
):
def
from_dir
(
ver_sim
=
"C5.2"
,
datatype
=
"mbi"
,
dir_l0
=
"."
,
dir_l1
=
"."
,
path_aux
=
""
,
use_dfs
=
False
,
dfs_node
=
"kmust"
):
""" initialize the multi-band imaging data manager """
assert
ver_sim
in
[
"C5.2"
,
]
...
...
@@ -305,7 +305,7 @@ class CsstMsDataManager:
dir_l0
=
dir_l0
,
dir_l1
=
dir_l1
,
path_aux
=
path_aux
,
# bias dark flat
use_dfs
=
dfs_mode
,
use_dfs
=
use_dfs
,
dfs_node
=
dfs_node
,
obs_id
=
obs_id
,
exp_start
=
exp_start
,
...
...
@@ -467,7 +467,7 @@ class CsstMsDataManager:
@
staticmethod
def
quickstart
(
ver_sim
=
"C5.2"
,
datatype
=
"mbi"
,
dir_l1
=
"."
,
exposure_id
=
100
,
dfs_mode
=
False
,
dfs_node
=
"kmust"
,
clear_dir
=
False
):
use_dfs
=
False
,
dfs_node
=
"kmust"
,
clear_dir
=
False
):
"""
Quick dataset generator for tests on dandelion or PML
...
...
@@ -481,7 +481,7 @@ class CsstMsDataManager:
output directory
exposure_id : int
The serial number of the exposure. 20-154 for C5.2.
dfs_mode
: bool
use_dfs
: bool
If True, use DFS.
dfs_node : str
The DFS node. Defaults to "kmust", could be "pml".
...
...
@@ -522,7 +522,7 @@ class CsstMsDataManager:
return
CsstMsDataManager
.
from_dir
(
ver_sim
=
ver_sim
,
datatype
=
datatype
,
dir_l0
=
dir_l0
,
dir_l1
=
dir_l1
,
path_aux
=
path_aux
,
dfs_mode
=
dfs_mode
,
dfs_node
=
dfs_node
)
use_dfs
=
use_dfs
,
dfs_node
=
dfs_node
)
def
__repr__
(
self
):
lines
=
""
...
...
@@ -599,7 +599,7 @@ class CsstMsDataManager:
datatype
=
"mbi"
,
dir_l0
=
"/L1Pipeline/L0"
,
dir_l1
=
"/L1Pipeline/L1"
,
dfs_mode
=
True
,
use_dfs
=
True
,
dfs_node
=
"pml"
):
""" Initialize CsstMsDataManager from DFS. """
...
...
@@ -646,7 +646,7 @@ class CsstMsDataManager:
# initialize dm
dm
=
CsstMsDataManager
.
from_dir
(
ver_sim
=
"C5.2"
,
datatype
=
datatype
,
dir_l0
=
dir_l0
,
dir_l1
=
dir_l1
,
path_aux
=
path_aux
,
dfs_mode
=
dfs_mode
,
dfs_node
=
dfs_node
path_aux
=
path_aux
,
use_dfs
=
use_dfs
,
dfs_node
=
dfs_node
)
assert
dm
.
obs_id
==
obs_id
...
...
tests/test_data_manager.py
View file @
51c6e403
...
...
@@ -19,9 +19,9 @@ dir_unittest = "/nfsdata/users/csstpipeline/L1Pipeline/unittests/csst_common"
class
TestCsstMsDataManager
(
unittest
.
TestCase
):
def
setUp
(
self
)
->
None
:
self
.
dm_mbi
=
CsstMsDataManager
.
quickstart
(
ver_sim
=
"C5.2"
,
datatype
=
"mbi"
,
dir_l1
=
dir_unittest
,
exposure_id
=
100
,
dfs_mode
=
False
,
dfs_node
=
"kmust"
)
ver_sim
=
"C5.2"
,
datatype
=
"mbi"
,
dir_l1
=
dir_unittest
,
exposure_id
=
100
,
use_dfs
=
False
,
dfs_node
=
"kmust"
)
self
.
dm_sls
=
CsstMsDataManager
.
quickstart
(
ver_sim
=
"C5.2"
,
datatype
=
"sls"
,
dir_l1
=
dir_unittest
,
exposure_id
=
100
,
dfs_mode
=
False
,
dfs_node
=
"kmust"
)
ver_sim
=
"C5.2"
,
datatype
=
"sls"
,
dir_l1
=
dir_unittest
,
exposure_id
=
100
,
use_dfs
=
False
,
dfs_node
=
"kmust"
)
self
.
dm_mbi
.
target_detectors
=
None
self
.
dm_sls
.
target_detectors
=
None
...
...
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