Commit 51c6e403 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

rename dfs_mode to use_dfs

parent 79d9ec9a
...@@ -275,7 +275,7 @@ class CsstMsDataManager: ...@@ -275,7 +275,7 @@ class CsstMsDataManager:
raise DeprecationWarning("This method is deprecated, please directly use dm.target_detectors = detectors!") raise DeprecationWarning("This method is deprecated, please directly use dm.target_detectors = detectors!")
@staticmethod @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 """ """ initialize the multi-band imaging data manager """
assert ver_sim in ["C5.2", ] assert ver_sim in ["C5.2", ]
...@@ -305,7 +305,7 @@ class CsstMsDataManager: ...@@ -305,7 +305,7 @@ class CsstMsDataManager:
dir_l0=dir_l0, dir_l0=dir_l0,
dir_l1=dir_l1, dir_l1=dir_l1,
path_aux=path_aux, # bias dark flat path_aux=path_aux, # bias dark flat
use_dfs=dfs_mode, use_dfs=use_dfs,
dfs_node=dfs_node, dfs_node=dfs_node,
obs_id=obs_id, obs_id=obs_id,
exp_start=exp_start, exp_start=exp_start,
...@@ -467,7 +467,7 @@ class CsstMsDataManager: ...@@ -467,7 +467,7 @@ class CsstMsDataManager:
@staticmethod @staticmethod
def quickstart(ver_sim="C5.2", datatype="mbi", dir_l1=".", exposure_id=100, 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 Quick dataset generator for tests on dandelion or PML
...@@ -481,7 +481,7 @@ class CsstMsDataManager: ...@@ -481,7 +481,7 @@ class CsstMsDataManager:
output directory output directory
exposure_id : int exposure_id : int
The serial number of the exposure. 20-154 for C5.2. The serial number of the exposure. 20-154 for C5.2.
dfs_mode : bool use_dfs : bool
If True, use DFS. If True, use DFS.
dfs_node : str dfs_node : str
The DFS node. Defaults to "kmust", could be "pml". The DFS node. Defaults to "kmust", could be "pml".
...@@ -522,7 +522,7 @@ class CsstMsDataManager: ...@@ -522,7 +522,7 @@ class CsstMsDataManager:
return CsstMsDataManager.from_dir( return CsstMsDataManager.from_dir(
ver_sim=ver_sim, datatype=datatype, dir_l0=dir_l0, dir_l1=dir_l1, path_aux=path_aux, 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): def __repr__(self):
lines = "" lines = ""
...@@ -599,7 +599,7 @@ class CsstMsDataManager: ...@@ -599,7 +599,7 @@ class CsstMsDataManager:
datatype="mbi", datatype="mbi",
dir_l0="/L1Pipeline/L0", dir_l0="/L1Pipeline/L0",
dir_l1="/L1Pipeline/L1", dir_l1="/L1Pipeline/L1",
dfs_mode=True, use_dfs=True,
dfs_node="pml" dfs_node="pml"
): ):
""" Initialize CsstMsDataManager from DFS. """ """ Initialize CsstMsDataManager from DFS. """
...@@ -646,7 +646,7 @@ class CsstMsDataManager: ...@@ -646,7 +646,7 @@ class CsstMsDataManager:
# initialize dm # initialize dm
dm = CsstMsDataManager.from_dir( dm = CsstMsDataManager.from_dir(
ver_sim="C5.2", datatype=datatype, dir_l0=dir_l0, dir_l1=dir_l1, 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 assert dm.obs_id == obs_id
......
...@@ -19,9 +19,9 @@ dir_unittest = "/nfsdata/users/csstpipeline/L1Pipeline/unittests/csst_common" ...@@ -19,9 +19,9 @@ dir_unittest = "/nfsdata/users/csstpipeline/L1Pipeline/unittests/csst_common"
class TestCsstMsDataManager(unittest.TestCase): class TestCsstMsDataManager(unittest.TestCase):
def setUp(self) -> None: def setUp(self) -> None:
self.dm_mbi = CsstMsDataManager.quickstart( 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( 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_mbi.target_detectors = None
self.dm_sls.target_detectors = None self.dm_sls.target_detectors = None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment