Commit 20ba1d41 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

removed dir_pcref

parent 2f47a008
...@@ -64,9 +64,6 @@ class CsstMsDataManager: ...@@ -64,9 +64,6 @@ class CsstMsDataManager:
The L1 directory. The L1 directory.
path_aux : str path_aux : str
The aux data directory (bias, flat, dark). The aux data directory (bias, flat, dark).
dir_pcref : str
The position calibration reference data directory.
Will be removed in the next version.
_exp_id : int _exp_id : int
The exposure ID. The exposure ID.
_exp_start : int _exp_start : int
...@@ -83,6 +80,8 @@ class CsstMsDataManager: ...@@ -83,6 +80,8 @@ class CsstMsDataManager:
The image type signature for science images. Defualts to ``SCI`` for C5.2 simulation. The image type signature for science images. Defualts to ``SCI`` for C5.2 simulation.
_l0_post : str _l0_post : str
The postfix. Defaults to ``L0_1`` for C5.2 simulation. The postfix. Defaults to ``L0_1`` for C5.2 simulation.
dfs_mode : bool
DFS mode. If True, ``CsstMsDataManager`` will use DFS.
Examples Examples
-------- --------
...@@ -115,7 +114,7 @@ class CsstMsDataManager: ...@@ -115,7 +114,7 @@ class CsstMsDataManager:
dir_l0: str = ".", dir_l0: str = ".",
dir_l1: str = ".", dir_l1: str = ".",
path_aux: str = "", # bias dark flat path_aux: str = "", # bias dark flat
dir_pcref: str = "", # deprecated dfs_mode: bool = False,
_exp_id: int = 100000100, _exp_id: int = 100000100,
_exp_start: int = 20270810081950, _exp_start: int = 20270810081950,
_exp_stop: int = 20270810082220, _exp_stop: int = 20270810082220,
...@@ -124,7 +123,6 @@ class CsstMsDataManager: ...@@ -124,7 +123,6 @@ class CsstMsDataManager:
_survey: str = "MS", _survey: str = "MS",
_imagetype: str = "SCI", _imagetype: str = "SCI",
_l0_post: str = "L0_1", _l0_post: str = "L0_1",
_dfs_mode: bool = False,
): ):
# version # version
...@@ -164,12 +162,11 @@ class CsstMsDataManager: ...@@ -164,12 +162,11 @@ class CsstMsDataManager:
self._survey = _survey self._survey = _survey
self._imagetype = _imagetype self._imagetype = _imagetype
self._l0_post = _l0_post self._l0_post = _l0_post
self._dfs_mode = _dfs_mode self.dfs_mode = dfs_mode
# data directory # data directory
self.dir_l0 = dir_l0 self.dir_l0 = dir_l0
self.dir_l1 = dir_l1 self.dir_l1 = dir_l1
self.dir_pcref = dir_pcref
self.path_aux = path_aux self.path_aux = path_aux
# record hard code names in history # record hard code names in history
...@@ -180,7 +177,7 @@ class CsstMsDataManager: ...@@ -180,7 +177,7 @@ class CsstMsDataManager:
raise NotImplementedError("from_dfs is currently not available!") raise NotImplementedError("from_dfs is currently not available!")
@staticmethod @staticmethod
def from_dir(ver_sim="C5.2", datatype="mbi", dir_l0=".", dir_l1=".", dir_pcref="", path_aux=""): def from_dir(ver_sim="C5.2", datatype="mbi", dir_l0=".", dir_l1=".", dir_pcref="", path_aux="", dfs_mode=False):
""" 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", ]
...@@ -210,7 +207,7 @@ class CsstMsDataManager: ...@@ -210,7 +207,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
dir_pcref=dir_pcref, # deprecated dfs_mode=dfs_mode,
_exp_id=_exp_id, _exp_id=_exp_id,
_exp_start=_exp_start, _exp_start=_exp_start,
_exp_stop=_exp_stop, _exp_stop=_exp_stop,
...@@ -367,7 +364,7 @@ class CsstMsDataManager: ...@@ -367,7 +364,7 @@ class CsstMsDataManager:
def get_sls_info(self): def get_sls_info(self):
""" Get the target SLS image header info and return. """ """ Get the target SLS image header info and return. """
if self._dfs_mode: if self.dfs_mode:
raise NotImplementedError() raise NotImplementedError()
else: else:
assert len(self.target_detectors) == 1 assert len(self.target_detectors) == 1
...@@ -376,14 +373,14 @@ class CsstMsDataManager: ...@@ -376,14 +373,14 @@ class CsstMsDataManager:
def get_mbi_info(self): def get_mbi_info(self):
""" Get all MBI image header info and return as a table. """ """ Get all MBI image header info and return as a table. """
if self._dfs_mode: if self.dfs_mode:
raise NotImplementedError() raise NotImplementedError()
else: else:
info = Table.read("/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/t_mbi_l1.fits") info = Table.read("/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/t_mbi_l1.fits")
return info return info
@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):
"""Quick dataset generator for tests on dandelion or PMO """Quick dataset generator for tests on dandelion or PMO
Parameters Parameters
...@@ -396,6 +393,8 @@ class CsstMsDataManager: ...@@ -396,6 +393,8 @@ 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
If True, use DFS.
Returns Returns
------- -------
...@@ -412,30 +411,26 @@ class CsstMsDataManager: ...@@ -412,30 +411,26 @@ class CsstMsDataManager:
dir_l0 = "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" \ dir_l0 = "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/multipleBandsImaging/" \
"NGP_AstrometryON_shearOFF/MSC_{:07d}/".format(exposure_id) "NGP_AstrometryON_shearOFF/MSC_{:07d}/".format(exposure_id)
path_aux = "/nfsdata/users/cham/L1Test/ref_C5.2/MSC_{}_*_{:02d}_combine.fits" path_aux = "/nfsdata/users/cham/L1Test/ref_C5.2/MSC_{}_*_{:02d}_combine.fits"
dir_pcref = "/nfsdata/users/csstpipeline/L1Pipeline/msc/gaia_dr3/"
elif hostname == "dandelion" and datatype == "sls": elif hostname == "dandelion" and datatype == "sls":
dir_l0 = "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/" \ dir_l0 = "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/" \
"NGP_AstrometryON_shearOFF_Spec/MSC_{:07d}/".format(exposure_id) "NGP_AstrometryON_shearOFF_Spec/MSC_{:07d}/".format(exposure_id)
path_aux = "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/csst_{:02d}{}.fits" path_aux = "/nfsdata/share/csst_simulation_data/Cycle-5-SimuData/slitlessSpectroscopy/csst_{:02d}{}.fits"
dir_pcref = ""
# PMO # PMO
elif hostname == "ubuntu" and datatype == "mbi": elif hostname == "ubuntu" and datatype == "mbi":
dir_l0 = "/share/simudata/CSSOSDataProductsSims/data/CSSTSimImage_C5/" \ dir_l0 = "/share/simudata/CSSOSDataProductsSims/data/CSSTSimImage_C5/" \
"NGP_AstrometryON_shearOFF/MSC_{:07d}/".format(exposure_id) "NGP_AstrometryON_shearOFF/MSC_{:07d}/".format(exposure_id)
path_aux = "/data/sim_data/MSC_0000100/ref/MSC_{}_*_{:02d}_combine.fits" path_aux = "/data/sim_data/MSC_0000100/ref/MSC_{}_*_{:02d}_combine.fits"
dir_pcref = "/home/user/L1Pipeline/msc/gaia_dr3/"
elif hostname == "ubuntu" and datatype == "sls": elif hostname == "ubuntu" and datatype == "sls":
dir_l0 = "/share/simudata/CSSOSDataProductsSims/data/CSSTSimImage_C5/" \ dir_l0 = "/share/simudata/CSSOSDataProductsSims/data/CSSTSimImage_C5/" \
"NGP_AstrometryON_shearOFF_Spec/MSC_{:07d}/".format(exposure_id) "NGP_AstrometryON_shearOFF_Spec/MSC_{:07d}/".format(exposure_id)
path_aux = "" path_aux = ""
dir_pcref = ""
else: else:
raise ValueError("@DM: invalid hostname {} or datatype {}!".format(hostname, datatype)) raise ValueError("@DM: invalid hostname {} or datatype {}!".format(hostname, datatype))
return CsstMsDataManager.from_dir( return CsstMsDataManager.from_dir(
ver_sim=ver_sim, datatype=datatype, dir_l0=dir_l0, dir_l1=dir_l1, dir_pcref=dir_pcref, 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)
class CsstMbiDataManager: class CsstMbiDataManager:
......
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