Commit e156971a authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

added logger into dm

parent f0c79538
...@@ -20,7 +20,8 @@ from typing import Union ...@@ -20,7 +20,8 @@ from typing import Union
from astropy.io import fits from astropy.io import fits
from astropy.table import Table 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 CSST_PARAMS as CP
from .params import DFS_CONF from .params import DFS_CONF
...@@ -89,6 +90,10 @@ class CsstMsDataManager: ...@@ -89,6 +90,10 @@ 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.
log_ppl : str
The pipeline log file name.
log_mod : str
The module log file name.
Examples Examples
-------- --------
...@@ -129,6 +134,8 @@ class CsstMsDataManager: ...@@ -129,6 +134,8 @@ class CsstMsDataManager:
_survey: str = "MS", _survey: str = "MS",
_imagetype: str = "SCI", _imagetype: str = "SCI",
_l0_post: str = "L0_1", _l0_post: str = "L0_1",
log_ppl="csst-l1ppl.log",
log_mod="csst-l1mod.log",
): ):
# version # version
...@@ -194,6 +201,10 @@ class CsstMsDataManager: ...@@ -194,6 +201,10 @@ class CsstMsDataManager:
# change to working directory # change to working directory
os.chdir(self.dir_l1) 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): def set_env(self):
""" set environment variables """ """ set environment variables """
if os.uname()[1] == "dandelion": if os.uname()[1] == "dandelion":
......
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