Commit 2f47a008 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

tweaks

parent e1cdd067
...@@ -16,6 +16,7 @@ import re ...@@ -16,6 +16,7 @@ import re
from astropy.io import fits from astropy.io import fits
from astropy.table import Table from astropy.table import Table
from typing import Union, Tuple
from .params import CSST_PARAMS as CP from .params import CSST_PARAMS as CP
...@@ -107,22 +108,23 @@ class CsstMsDataManager: ...@@ -107,22 +108,23 @@ class CsstMsDataManager:
""" """
def __init__(self, def __init__(self,
ver_sim="C5.2", ver_sim: str = "C5.2",
datatype="mbi", datatype: str = "mbi",
available_detectors=None, available_detectors: Union[None, list] = None,
target_detectors=None, target_detectors: Union[None, list] = None,
dir_l0=".", dir_l0: str = ".",
dir_l1=".", dir_l1: str = ".",
path_aux="", # bias dark flat path_aux: str = "", # bias dark flat
dir_pcref="", # deprecated dir_pcref: str = "", # deprecated
_exp_id=100000100, _exp_id: int = 100000100,
_exp_start=20270810081950, _exp_start: int = 20270810081950,
_exp_stop=20270810082220, _exp_stop: int = 20270810082220,
_telescope="CSST", _telescope: str = "CSST",
_instrument="MSC", _instrument: str = "MSC",
_survey="MS", _survey: str = "MS",
_imagetype="SCI", _imagetype: str = "SCI",
_l0_post="L0_1", _l0_post: str = "L0_1",
_dfs_mode: bool = False,
): ):
# version # version
...@@ -162,6 +164,7 @@ class CsstMsDataManager: ...@@ -162,6 +164,7 @@ 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
# data directory # data directory
self.dir_l0 = dir_l0 self.dir_l0 = dir_l0
...@@ -362,16 +365,18 @@ class CsstMsDataManager: ...@@ -362,16 +365,18 @@ class CsstMsDataManager:
self.hardcode_history.append(dict(hdcd=fp, comment=comment)) self.hardcode_history.append(dict(hdcd=fp, comment=comment))
return fp return fp
def get_sls_info(self, use_dfs=False): def get_sls_info(self):
if use_dfs: """ Get the target SLS image header info and return. """
if self._dfs_mode:
raise NotImplementedError() raise NotImplementedError()
else: else:
assert len(self.target_detectors) == 1 assert len(self.target_detectors) == 1
header = fits.getheader(self.l0_detector(self.target_detectors[0]), ext=1) header = fits.getheader(self.l0_detector(self.target_detectors[0]), ext=1)
return header return header
def get_mbi_info(self, use_dfs=False): def get_mbi_info(self):
if use_dfs: """ Get all MBI image header info and return as a table. """
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")
......
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