Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-23044: PTC task should persist usable linearity models #364

Merged
merged 2 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions python/lsst/pipe/tasks/ingestCalibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def getCalibType(self, filename):
obstype = "defects"
elif "qe_curve" in obstype:
obstype = "qe_curve"
elif "linearizer" in obstype:
obstype = "linearizer"
return obstype

def getDestination(self, butler, info, filename):
Expand All @@ -70,14 +72,14 @@ def getDestination(self, butler, info, filename):

class CalibsRegisterConfig(RegisterConfig):
"""Configuration for the CalibsRegisterTask"""
tables = ListField(dtype=str, default=["bias", "dark", "flat", "fringe", "sky", "defects", "qe_curve"],
doc="Names of tables")
tables = ListField(dtype=str, default=["bias", "dark", "flat", "fringe", "sky", "defects", "qe_curve",
"linearizer"], doc="Names of tables")
calibDate = Field(dtype=str, default="calibDate", doc="Name of column for calibration date")
validStart = Field(dtype=str, default="validStart", doc="Name of column for validity start")
validEnd = Field(dtype=str, default="validEnd", doc="Name of column for validity stop")
detector = ListField(dtype=str, default=["filter", "ccd"],
doc="Columns that identify individual detectors")
validityUntilSuperseded = ListField(dtype=str, default=["defects", "qe_curve"],
validityUntilSuperseded = ListField(dtype=str, default=["defects", "qe_curve", "linearizer"],
doc="Tables for which to set validity for a calib from when it is "
"taken until it is superseded by the next; validity in other tables "
"is calculated by applying the validity range.")
Expand Down
8 changes: 6 additions & 2 deletions python/lsst/pipe/tasks/read_curated_calibs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from lsst.meas.algorithms import Defects
from lsst.meas.algorithms.simple_curve import Curve
from lsst.ip.isr import Linearizer

import os
import glob
Expand All @@ -25,8 +26,11 @@ def read_one_chip(root, chip_name, chip_id):
A dictionary of objects constructed from the appropriate factory class.
The key is the validity start time as a `datetime` object.
"""
factory_map = {'qe_curve': Curve, 'defects': Defects}
files = glob.glob(os.path.join(root, chip_name, '*.ecsv'))
factory_map = {'qe_curve': Curve, 'defects': Defects, 'linearizer': Linearizer}
files = []
extensions = (".ecsv", ".yaml")
for ext in extensions:
files.extend(glob.glob(os.path.join(root, chip_name, f"*{ext}")))
parts = os.path.split(root)
instrument = os.path.split(parts[0])[1] # convention is that these reside at <instrument>/<data_name>
data_name = parts[1]
Expand Down