Commit 7b6c76b5 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

add Pipeline.summary()

parent de080ed4
Pipeline #2691 failed with stage
in 0 seconds
...@@ -18,11 +18,13 @@ import traceback ...@@ -18,11 +18,13 @@ import traceback
import warnings import warnings
from typing import Callable, NamedTuple, Optional, Any from typing import Callable, NamedTuple, Optional, Any
from astropy.time import Time, TimeDelta from astropy.time import Time, TimeDelta
from astropy.io import fits
from .utils import retry from .utils import retry
from .ccds import CCDS from .ccds import CCDS
from .dfs import DFS from .dfs import DFS
from .file import File from .file import File
from .io import reformat_header
from .logger import get_logger from .logger import get_logger
from .status import CsstStatus, CsstResult from .status import CsstStatus, CsstResult
...@@ -130,6 +132,15 @@ class Pipeline: ...@@ -130,6 +132,15 @@ class Pipeline:
print(f"PIPELINE_ID={self.pipeline_id}") print(f"PIPELINE_ID={self.pipeline_id}")
print(f"BUILD={self.build}") print(f"BUILD={self.build}")
print(f"CREATED={self.created}") print(f"CREATED={self.created}")
print(f"VERBOSE={self.verbose}")
def summary(self) -> fits.Header:
"""Summarize pipeline info into a `astropy.io.fits.Header`."""
h = fits.Header()
h.set("PIPELINE_ID", self.pipeline_id, comment="pipeline ID")
h.set("BUILD", self.build, comment="pipeline build number")
h.set("CREATED", self.pipeline_id, comment="pipeline build time")
return reformat_header(h, strip=False, comment="Pipeline summary")
def clean_output(self): def clean_output(self):
"""Clean output directory.""" """Clean output directory."""
......
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