diff --git a/csst_common/data_manager.py b/csst_common/data_manager.py index 3972173a3c4cca4faa4da46d02853aeb74dcc457..763d7dbbcfa283436e55d9719788aa691ea4df21 100644 --- a/csst_common/data_manager.py +++ b/csst_common/data_manager.py @@ -20,7 +20,8 @@ from typing import Union from astropy.io import fits from astropy.table import Table -from .dfs import gaia_query_from_dfs, get_l1api +from .dfs import gaia_query_from_dfs +from .logger import get_logger from .params import CSST_PARAMS as CP from .params import DFS_CONF @@ -89,6 +90,10 @@ class CsstMsDataManager: The image type signature for science images. Defualts to ``SCI`` for C5.2 simulation. _l0_post : str The postfix. Defaults to ``L0_1`` for C5.2 simulation. + log_ppl : str + The pipeline log file name. + log_mod : str + The module log file name. Examples -------- @@ -129,6 +134,8 @@ class CsstMsDataManager: _survey: str = "MS", _imagetype: str = "SCI", _l0_post: str = "L0_1", + log_ppl="csst-l1ppl.log", + log_mod="csst-l1mod.log", ): # version @@ -194,6 +201,10 @@ class CsstMsDataManager: # change to working directory os.chdir(self.dir_l1) + # pipeline logger + self.logger_ppl = get_logger(name="CSST L1 Pipeline", filename=self.l1_file(log_ppl)) + self.logger_mod = get_logger(name="CSST L1 Pipeline Module", filename=self.l1_file(log_mod)) + def set_env(self): """ set environment variables """ if os.uname()[1] == "dandelion": @@ -242,8 +253,8 @@ class CsstMsDataManager: # parse info _telescope, _instrument, _survey, _imagetype, \ - _exp_start, _exp_stop, _exp_id, \ - _detector, *_l0_post, _ext = re.split(r"[_.]", fps_img[0]) + _exp_start, _exp_stop, _exp_id, \ + _detector, *_l0_post, _ext = re.split(r"[_.]", fps_img[0]) _exp_start = int(_exp_start) _exp_stop = int(_exp_stop)