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

added logger into dm

parent f0c79538
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -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":