From 588ff63ad90ff4d2420f8af7b8dc8ac482504e5d Mon Sep 17 00:00:00 2001 From: Lee Kelvin Date: Wed, 3 Nov 2021 13:12:18 -0400 Subject: [PATCH] Create DECam DRP Processing Pipeline --- config/apertures.py | 6 + config/calibrate.py | 53 +++ config/characterizeImage.py | 76 ++++ config/cmodel.py | 11 + config/colorAnalysis.py | 5 + config/colorterms.py | 52 +++ config/convolvedFluxes.py | 11 + config/extinctionCoeffs.py | 15 + config/filterMap.py | 9 + config/forcedPhotCoadd.py | 46 ++ config/gaap.py | 12 + config/jointcal.py | 10 + config/kron.py | 10 + config/measureCoaddSources.py | 22 +- config/mergeDetections.py | 2 +- config/mergeMeasurements.py | 2 +- config/transformObjectCatalog.py | 8 + config/transformSourceTable.py | 6 + pipelines/DRP.yaml | 235 +++++++++- pipelines/README.md | 9 +- policy/Object.yaml | 712 +++++++++++++++++++++++++++++++ policy/Source.yaml | 411 ++++++++++++++++++ 22 files changed, 1696 insertions(+), 27 deletions(-) create mode 100644 config/apertures.py create mode 100644 config/cmodel.py create mode 100644 config/colorAnalysis.py create mode 100644 config/colorterms.py create mode 100644 config/convolvedFluxes.py create mode 100644 config/extinctionCoeffs.py create mode 100644 config/filterMap.py create mode 100644 config/forcedPhotCoadd.py create mode 100644 config/gaap.py create mode 100644 config/jointcal.py create mode 100644 config/kron.py create mode 100644 config/transformObjectCatalog.py create mode 100644 config/transformSourceTable.py create mode 100644 policy/Object.yaml create mode 100644 policy/Source.yaml diff --git a/config/apertures.py b/config/apertures.py new file mode 100644 index 00000000..c7b4bccb --- /dev/null +++ b/config/apertures.py @@ -0,0 +1,6 @@ +# Set up aperture photometry +# 'config' should be a SourceMeasurementConfig + +# Use a large aperture to be independent of seeing in calibration +# This config matches obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.plugins["base_CircularApertureFlux"].maxSincRadius = 12.0 diff --git a/config/calibrate.py b/config/calibrate.py index c1833486..d662f955 100644 --- a/config/calibrate.py +++ b/config/calibrate.py @@ -3,8 +3,12 @@ """ import os.path +from lsst.meas.algorithms import ColorLimit +from lsst.meas.astrom import MatchOptimisticBConfig + obsConfigDir = os.path.join(os.path.dirname(__file__)) +# Astrometry/Photometry # This sets the reference catalog name for Gen2. for refObjLoader in (config.astromRefObjLoader, config.photoRefObjLoader, @@ -21,7 +25,22 @@ # This sets up the reference catalog for Gen3. config.connections.astromRefCat = "ps1_pv3_3pi_20170110" config.connections.photoRefCat = "ps1_pv3_3pi_20170110" + +# Photometric calibration: use color terms +config.photoCal.applyColorTerms = True config.photoCal.photoCatName = "ps1_pv3_3pi_20170110" +colors = config.photoCal.match.referenceSelection.colorLimits +# The following two color limits are adopted from obs_subaru for the HSC SSP survey +colors["g-r"] = ColorLimit(primary="g_flux", secondary="r_flux", minimum=0.0) +colors["r-i"] = ColorLimit(primary="r_flux", secondary="i_flux", maximum=0.5) +config.photoCal.match.referenceSelection.doMagLimit = True +config.photoCal.match.referenceSelection.magLimit.fluxField = "i_flux" +config.photoCal.match.referenceSelection.magLimit.maximum = 22.0 +config.photoCal.colorterms.load(os.path.join(obsConfigDir, 'colorterms.py')) + +# Number of bright stars to use. Sets the max number of patterns that can be tested. +# This config matches obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.astrometry.matcher.numBrightStars = 150 # The Task default was reduced from 4 to 2 on RFC-577. We believe that 4 is # more appropriate for use with DECam data until a Jointcal-derived distortion @@ -30,4 +49,38 @@ # See Slack: https://lsstc.slack.com/archives/C2B6X08LS/p1586468459084600 config.astrometry.wcsFitter.order = 4 +for matchConfig in (config.astrometry, + ): + matchConfig.sourceFluxType = 'Psf' + matchConfig.sourceSelector.active.sourceFluxType = 'Psf' + matchConfig.matcher.maxOffsetPix = 250 + if isinstance(matchConfig.matcher, MatchOptimisticBConfig): + matchConfig.matcher.allowedNonperpDeg = 0.2 + matchConfig.matcher.maxMatchDistArcSec = 2.0 + matchConfig.sourceSelector.active.excludePixelFlags = False + +# Set to match defaults currently used in HSC production runs (e.g. S15B+) +config.catalogCalculation.plugins['base_ClassificationExtendedness'].fluxRatio = 0.95 + +# Demand astrometry and photoCal succeed +config.requireAstrometry = True +config.requirePhotoCal = True + +config.doWriteMatchesDenormalized = True + +# Detection +# This config matches obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.detection.isotropicGrow = True + +config.measurement.load(os.path.join(obsConfigDir, "apertures.py")) +config.measurement.load(os.path.join(obsConfigDir, "kron.py")) config.measurement.load(os.path.join(obsConfigDir, "hsm.py")) + +# Deblender +# These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.deblend.maxFootprintSize = 0 +config.deblend.maskLimits["NO_DATA"] = 0.25 # Ignore sources that are in the vignetted region +config.deblend.maxFootprintArea = 10000 + +config.measurement.plugins.names |= ["base_Jacobian", "base_FPPosition"] +config.measurement.plugins["base_Jacobian"].pixelScale = 0.263 diff --git a/config/characterizeImage.py b/config/characterizeImage.py index c14a44a8..82a3a555 100644 --- a/config/characterizeImage.py +++ b/config/characterizeImage.py @@ -1,8 +1,25 @@ """ DECam-specific overrides for CharacterizeImageTask """ +import os.path + +from lsst.meas.astrom import MatchOptimisticBConfig + +obsConfigDir = os.path.dirname(__file__) + +# Cosmic rays +# These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC config.repair.cosmicray.nCrPixelMax = 100000 +config.repair.cosmicray.cond3_fac2 = 0.4 + +# PSF determination +# These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.measurePsf.reserve.fraction = 0.2 +config.measurePsf.starSelector["objectSize"].sourceFluxField = "base_PsfFlux_instFlux" +config.measurePsf.starSelector["objectSize"].widthMin = 0.9 +config.measurePsf.starSelector["objectSize"].fluxMin = 4000 +# Astrometry/Photometry # This sets the reference catalog name for Gen2. # Note that in Gen3, we've stopped pretending (which is what Gen2 does, # for backwards compatibility) that charImage uses a reference catalog. @@ -14,3 +31,62 @@ config.refObjLoader.filterMap['N540'] = 'g' config.refObjLoader.filterMap['N708'] = 'i' config.refObjLoader.filterMap['N964'] = 'z' + +# Set to match defaults currently used in HSC production runs (e.g. S15B) +config.catalogCalculation.plugins['base_ClassificationExtendedness'].fluxRatio = 0.95 + +# Detection +# This config matches obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.detection.isotropicGrow = True + +# Activate calibration of measurements: required for aperture corrections +config.load(os.path.join(obsConfigDir, "cmodel.py")) +config.measurement.load(os.path.join(obsConfigDir, "apertures.py")) +config.measurement.load(os.path.join(obsConfigDir, "kron.py")) +config.measurement.load(os.path.join(obsConfigDir, "convolvedFluxes.py")) +config.measurement.load(os.path.join(obsConfigDir, "gaap.py")) +config.measurement.load(os.path.join(obsConfigDir, "hsm.py")) +if "ext_shapeHSM_HsmShapeRegauss" in config.measurement.plugins: + # no deblending has been done + config.measurement.plugins["ext_shapeHSM_HsmShapeRegauss"].deblendNChild = "" + +# Deblender +config.deblend.maskLimits["NO_DATA"] = 0.25 # Ignore sources that are in the vignetted region +config.deblend.maxFootprintArea = 10000 + +config.measurement.plugins.names |= ["base_Jacobian", "base_FPPosition"] +config.measurement.plugins["base_Jacobian"].pixelScale = 0.263 + +# Convolved fluxes can fail for small target seeing if the observation seeing is larger +if "ext_convolved_ConvolvedFlux" in config.measurement.plugins: + names = config.measurement.plugins["ext_convolved_ConvolvedFlux"].getAllResultNames() + config.measureApCorr.allowFailure += names + +if "ext_gaap_GaapFlux" in config.measurement.plugins: + names = config.measurement.plugins["ext_gaap_GaapFlux"].getAllGaapResultNames() + config.measureApCorr.allowFailure += names + +# For aperture correction modeling, only use objects that were used in the +# PSF model and have psf flux signal-to-noise > 200. +# These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.measureApCorr.sourceSelector['science'].doFlags = True +config.measureApCorr.sourceSelector['science'].doUnresolved = False +config.measureApCorr.sourceSelector['science'].doSignalToNoise = True +config.measureApCorr.sourceSelector['science'].flags.good = ["calib_psf_used"] +config.measureApCorr.sourceSelector['science'].flags.bad = [] +config.measureApCorr.sourceSelector['science'].signalToNoise.minimum = 200.0 +config.measureApCorr.sourceSelector['science'].signalToNoise.maximum = None +config.measureApCorr.sourceSelector['science'].signalToNoise.fluxField = "base_PsfFlux_instFlux" +config.measureApCorr.sourceSelector['science'].signalToNoise.errField = "base_PsfFlux_instFluxErr" +config.measureApCorr.sourceSelector.name = "science" + +config.ref_match.sourceSelector.name = 'matcher' +for matchConfig in (config.ref_match, + ): + matchConfig.sourceFluxType = 'Psf' + matchConfig.sourceSelector.active.sourceFluxType = 'Psf' + matchConfig.matcher.maxOffsetPix = 250 + if isinstance(matchConfig.matcher, MatchOptimisticBConfig): + matchConfig.matcher.allowedNonperpDeg = 0.2 + matchConfig.matcher.maxMatchDistArcSec = 2.0 + matchConfig.sourceSelector.active.excludePixelFlags = False diff --git a/config/cmodel.py b/config/cmodel.py new file mode 100644 index 00000000..875c5a5d --- /dev/null +++ b/config/cmodel.py @@ -0,0 +1,11 @@ +# Enable CModel mags (unsetup meas_modelfit to disable) +# 'config' is a SourceMeasurementConfig. +try: + import lsst.meas.modelfit + config.measurement.plugins.names |= ["modelfit_DoubleShapeletPsfApprox", "modelfit_CModel"] + config.measurement.slots.modelFlux = 'modelfit_CModel' + config.catalogCalculation.plugins['base_ClassificationExtendedness'].fluxRatio = 0.985 +except (KeyError, ImportError): + import logging + logging.getLogger("lsst.obs.decam.config").warning("Cannot import lsst.meas.modelfit:" + " disabling CModel measurements") diff --git a/config/colorAnalysis.py b/config/colorAnalysis.py new file mode 100644 index 00000000..31d3f5ac --- /dev/null +++ b/config/colorAnalysis.py @@ -0,0 +1,5 @@ +import os.path + +config.load(os.path.join(os.path.dirname(__file__), "extinctionCoeffs.py")) +from lsst.obs.decam.decamFilters import DECAM_FILTER_DEFINITIONS +config.physicalToBandFilterMap = DECAM_FILTER_DEFINITIONS.physical_to_band diff --git a/config/colorterms.py b/config/colorterms.py new file mode 100644 index 00000000..11acef9f --- /dev/null +++ b/config/colorterms.py @@ -0,0 +1,52 @@ +from lsst.pipe.tasks.colorterms import Colorterm, ColortermDict + +# Average color terms for the DECam filters are calculated using the Pickles stellar spectra atlas. +# The following values are provided by Song Huang (Tsinghua University; dr.guangtou@gmail.com) +# Color terms for u, Y, N419 and N964 bands are not currently available. + +# The values for DECam g, r & z-bands are calculated independently and are different to the values at: +# https://www.legacysurvey.org/dr9/description/ + +# A Jupyter notebook to reproduce these values is available at: +# https://github.com/MerianSurvey/caterpillar/blob/main/notebook/photocal/merian_filter_color_terms.ipynb + +# In obs_subaru, colorterms.py is also used in: +# - config/skyAnalysis.py +# - config/compareCoaddAnalysis.py +# - config/coaddAnalysis.py +# - config/visitAnalysis.py +# - config/fgcmBuildStarsTable.py and config/fgcmBuildStars.py +# These files are not currently available for obs_decam. + +config.data = { + "decam*": ColortermDict(data={ + 'g DECam SDSS c0001 4720.0 1520.0': Colorterm(primary="g", secondary="g"), + 'r DECam SDSS c0002 6415.0 1480.0': Colorterm(primary="r", secondary="r"), + 'i DECam SDSS c0003 7835.0 1470.0': Colorterm(primary="i", secondary="i"), + 'z DECam SDSS c0004 9260.0 1520.0': Colorterm(primary="z", secondary="z"), + }), + "sdss*": ColortermDict(data={ + 'g DECam SDSS c0001 4720.0 1520.0': Colorterm(primary="g", secondary="r", c0=-0.008015, c1=-0.089869, c2=-0.018398), # For -1.0 < g-r < 1.8 + 'r DECam SDSS c0002 6415.0 1480.0': Colorterm(primary="r", secondary="i", c0=-0.0077434, c1=-0.202615, c2=0.016042), # For -1.0 < r-i < 2.2 + 'i DECam SDSS c0003 7835.0 1470.0': Colorterm(primary="i", secondary="z", c0=0.00018887, c1=-0.2748281, c2=-0.029417), # For -1.0 < i-z < 1.2 + 'z DECam SDSS c0004 9260.0 1520.0': Colorterm(primary="z", secondary="i", c0=-0.0059858, c1=0.1131192, c2=0.0156471), # For -1.0 < z-i < 0.5 + 'N540 DECam c0014 5403.2 210.0': Colorterm(primary="g", secondary="r", c0=-0.03359776, c1=-0.57665033, c2=-0.01510509), # For -1.0 < g-r < 1.5 + 'N708 DECam c0012 7080.0 400.0': Colorterm(primary="r", secondary="i", c0=-0.01428724, c1=-0.71755905, c2=0.08959316), # For -1.0 < r-i < 2.0 + }), + "hsc*": ColortermDict(data={ + 'g DECam SDSS c0001 4720.0 1520.0': Colorterm(primary="g", secondary="r", c0=0.0000509, c1=-0.0152487, c2=-0.0029937), # For -1.0 < g-r < 1.4 + 'r DECam SDSS c0002 6415.0 1480.0': Colorterm(primary="r", secondary="i", c0=-0.0078995, c1=-0.1695323, c2=0.0251978), # For -1.0 < r-i < 2.2 + 'i DECam SDSS c0003 7835.0 1470.0': Colorterm(primary="i", secondary="z", c0=0.0010196, c1=-0.1314031, c2=0.0054605), # For -1.0 < i-z < 1.0 + 'z DECam SDSS c0004 9260.0 1520.0': Colorterm(primary="z", secondary="y", c0=-0.0013244, c1=-0.2846684, c2=-0.1229817), # For -1.0 < z-y < 0.5 + 'N540 DECam c0014 5403.2 210.0': Colorterm(primary="g", secondary="r", c0=-0.03015158, c1=-0.53715834, c2=-0.00202415), # For -1.0 < g-r < 1.5 + 'N708 DECam c0012 7080.0 400.0': Colorterm(primary="r", secondary="i", c0=-0.01978413, c1=-0.64368838, c2=0.09132738), # For -1.0 < r-i < 2.0 + }), + "ps1*": ColortermDict(data={ + 'g DECam SDSS c0001 4720.0 1520.0': Colorterm(primary="g", secondary="r", c0=0.006388, c1=0.045875, c2=-0.004484), # For -1.0 < g-r < 1.2 + 'r DECam SDSS c0002 6415.0 1480.0': Colorterm(primary="r", secondary="i", c0=-0.006775, c1=-0.187304, c2=0.018928), # For -1.0 < r-i < 2.2 + 'i DECam SDSS c0003 7835.0 1470.0': Colorterm(primary="i", secondary="z", c0=0.0012204, c1=-0.282956, c2=-0.011321), # For -1.0 < i-z < 1.4 + 'z DECam SDSS c0004 9260.0 1520.0': Colorterm(primary="z", secondary="y", c0=-0.0087868, c1=-0.5204795, c2=-0.057955), # For -1.0 < z-y < 1.0 + 'N540 DECam c0014 5403.2 210.0': Colorterm(primary="g", secondary="r", c0=-0.02635164, c1=-0.50968428, c2=-0.00958104), # For -1.0 < g-r < 1.5 + 'N708 DECam c0012 7080.0 400.0': Colorterm(primary="r", secondary="i", c0=-0.01508987, c1=-0.69377675, c2=0.09079348), # For -1.0 < r-i < 2.0 + }), +} diff --git a/config/convolvedFluxes.py b/config/convolvedFluxes.py new file mode 100644 index 00000000..2ddea25e --- /dev/null +++ b/config/convolvedFluxes.py @@ -0,0 +1,11 @@ +# Enable measurement of convolved fluxes +# 'config' is a SourceMeasurementConfig +try: + import lsst.meas.extensions.convolved # noqa: Load flux.convolved algorithm +except ImportError as exc: + import logging + logging.getLogger("lsst.obs.decam.config").warning("Cannot import lsst.meas.extensions.convolved (%s):" + " disabling convolved flux measurements", exc) +else: + config.plugins.names.add("ext_convolved_ConvolvedFlux") + config.plugins["ext_convolved_ConvolvedFlux"].seeing.append(8.0) diff --git a/config/extinctionCoeffs.py b/config/extinctionCoeffs.py new file mode 100644 index 00000000..a873530a --- /dev/null +++ b/config/extinctionCoeffs.py @@ -0,0 +1,15 @@ +# Extinction coefficients for DECam filters for conversion from E(B-V) to extinction, A_filter. +# Numbers initially provided by Song Huang (NAOJ). +# +# Band, A_filter/E(B-V) +# Values for N419 and N964 filters are not currently available. +config.extinctionCoeffs = { + "u": 3.994, + "g": 3.212, + "r": 2.164, + "i": 1.591, + "z": 1.211, + "y": 1.063, + "N540": 2.753, + "N708": 1.847, +} diff --git a/config/filterMap.py b/config/filterMap.py new file mode 100644 index 00000000..23892dfb --- /dev/null +++ b/config/filterMap.py @@ -0,0 +1,9 @@ +# Mapping of camera filter name: reference catalog filter name; each reference filter must exist in the refcat. +# Note that this does not perform any bandpass corrections: it is just a lookup. +for source, target in [ + ('N419', 'g'), + ('N540', 'g'), + ('N708', 'i'), + ('N964', 'z'), + ]: + config.filterMap[source] = target diff --git a/config/forcedPhotCoadd.py b/config/forcedPhotCoadd.py new file mode 100644 index 00000000..8153b501 --- /dev/null +++ b/config/forcedPhotCoadd.py @@ -0,0 +1,46 @@ +import os.path + +from lsst.meas.base import CircularApertureFluxAlgorithm + +config.measurement.load(os.path.join(os.path.dirname(__file__), "apertures.py")) +config.measurement.load(os.path.join(os.path.dirname(__file__), "kron.py")) +config.measurement.load(os.path.join(os.path.dirname(__file__), "convolvedFluxes.py")) +config.measurement.load(os.path.join(os.path.dirname(__file__), "gaap.py")) +config.load(os.path.join(os.path.dirname(__file__), "cmodel.py")) + +# These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +config.catalogCalculation.plugins.names = ["base_ClassificationExtendedness"] +config.measurement.slots.psfFlux = "base_PsfFlux" + +def doUndeblended(config, algName, fluxList=None): + """Activate undeblended measurements of algorithm + + Parameters + ---------- + algName : `str` + Algorithm name. + fluxList : `list` of `str`, or `None` + List of flux columns to register for aperture correction. If `None`, + then this will be the `algName` appended with `_instFlux`. + """ + if algName not in config.measurement.plugins: + return + if fluxList is None: + fluxList = [algName + "_instFlux"] + config.measurement.undeblended.names.add(algName) + config.measurement.undeblended[algName] = config.measurement.plugins[algName] + for flux in fluxList: + config.applyApCorr.proxies["undeblended_" + flux] = flux + + +# These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC +doUndeblended(config, "base_PsfFlux") +doUndeblended(config, "ext_photometryKron_KronFlux") +doUndeblended(config, "base_CircularApertureFlux", []) # No aperture correction for circular apertures +doUndeblended(config, "ext_convolved_ConvolvedFlux", + config.measurement.plugins["ext_convolved_ConvolvedFlux"].getAllResultNames()) +doUndeblended(config, "ext_gaap_GaapFlux", + config.measurement.plugins["ext_gaap_GaapFlux"].getAllGaapResultNames()) +# Disable registration for apCorr of undeblended convolved; apCorr will be done through the deblended proxy +config.measurement.undeblended["ext_convolved_ConvolvedFlux"].registerForApCorr = False +config.measurement.undeblended["ext_gaap_GaapFlux"].registerForApCorr = False diff --git a/config/gaap.py b/config/gaap.py new file mode 100644 index 00000000..083edc92 --- /dev/null +++ b/config/gaap.py @@ -0,0 +1,12 @@ +# Enable GAaP (Gaussian Aperture and PSF) colors +# 'config' is typically a SourceMeasurementConfig +try: + import lsst.meas.extensions.gaap # noqa + config.plugins.names.add("ext_gaap_GaapFlux") + config.plugins["ext_gaap_GaapFlux"].sigmas = [0.5, 0.7, 1.0, 1.5, 2.5, 3.0] + # Enable PSF photometry after PSF-Gaussianization in the `ext_gaap_GaapFlux` plugin + config.plugins["ext_gaap_GaapFlux"].doPsfPhotometry = True +except ImportError as exc: + import logging + logging.getLogger("lsst.obs.decam.config").warning("Cannot import lsst.meas.extensions.gaap (%s):" + " disabling GAaP flux measurements", exc) diff --git a/config/jointcal.py b/config/jointcal.py new file mode 100644 index 00000000..8c926ac3 --- /dev/null +++ b/config/jointcal.py @@ -0,0 +1,10 @@ +import os.path + +# `load()` appends to the filterMaps: we need them to be empty, so that +# only the specified filter mappings are used. +config.photometryRefObjLoader.filterMap = {} +filterMapFile = os.path.join(os.path.dirname(__file__), "filterMap.py") +config.photometryRefObjLoader.load(filterMapFile) +# We have PS1 colorterms +config.applyColorTerms = True +config.colorterms.load(os.path.join(os.path.dirname(__file__), "colorterms.py")) diff --git a/config/kron.py b/config/kron.py new file mode 100644 index 00000000..80f1d560 --- /dev/null +++ b/config/kron.py @@ -0,0 +1,10 @@ +# Enable Kron mags +# 'config' is a SourceMeasurementConfig + +try: + import lsst.meas.extensions.photometryKron + config.plugins.names |= ["ext_photometryKron_KronFlux"] +except ImportError: + import logging + logging.getLogger("lsst.obs.decam.config").warning("Cannot import lsst.meas.extensions.photometryKron:" + " disabling Kron measurements") diff --git a/config/measureCoaddSources.py b/config/measureCoaddSources.py index c15f6583..ed413a3a 100644 --- a/config/measureCoaddSources.py +++ b/config/measureCoaddSources.py @@ -1,8 +1,18 @@ +import os.path + +config.measurement.load(os.path.join(os.path.dirname(__file__), "apertures.py")) +config.measurement.load(os.path.join(os.path.dirname(__file__), "kron.py")) +config.measurement.load(os.path.join(os.path.dirname(__file__), "convolvedFluxes.py")) +config.measurement.load(os.path.join(os.path.dirname(__file__), "hsm.py")) +config.load(os.path.join(os.path.dirname(__file__), "cmodel.py")) + +# Set reference catalog for Gen2. config.match.refObjLoader.ref_dataset_name = "ps1_pv3_3pi_20170110" -config.match.refObjLoader.filterMap['u'] = 'g' -config.match.refObjLoader.filterMap['Y'] = 'y' -config.match.refObjLoader.filterMap['N419'] = 'g' -config.match.refObjLoader.filterMap['N540'] = 'g' -config.match.refObjLoader.filterMap['N708'] = 'i' -config.match.refObjLoader.filterMap['N964'] = 'z' +# Set reference catalog for Gen3. config.connections.refCat = "ps1_pv3_3pi_20170110" + +config.match.refObjLoader.load(os.path.join(os.path.dirname(__file__), "filterMap.py")) + +config.doWriteMatchesDenormalized = True + +config.measurement.plugins.names |= ["base_InputCount"] diff --git a/config/mergeDetections.py b/config/mergeDetections.py index 462558de..27e15e08 100644 --- a/config/mergeDetections.py +++ b/config/mergeDetections.py @@ -1 +1 @@ -config.priorityList = ["r", "i", "z", "g", "y", "u"] +config.priorityList = ["r", "i", "z", "g", "y", "u", "N708", "N540", "N964", "N419"] diff --git a/config/mergeMeasurements.py b/config/mergeMeasurements.py index 462558de..27e15e08 100644 --- a/config/mergeMeasurements.py +++ b/config/mergeMeasurements.py @@ -1 +1 @@ -config.priorityList = ["r", "i", "z", "g", "y", "u"] +config.priorityList = ["r", "i", "z", "g", "y", "u", "N708", "N540", "N964", "N419"] diff --git a/config/transformObjectCatalog.py b/config/transformObjectCatalog.py new file mode 100644 index 00000000..8e9801b1 --- /dev/null +++ b/config/transformObjectCatalog.py @@ -0,0 +1,8 @@ +import os.path + +from lsst.utils import getPackageDir + +# Use the environment var. to prevent hardcoding of paths into quantum graphs. +# TODO: DM-28862: When that ticket is merged, policy files will be moved to a +# central location, likely into pipe_tasks. +config.functorFile = os.path.join('$OBS_DECAM_DIR', 'policy', 'Object.yaml') diff --git a/config/transformSourceTable.py b/config/transformSourceTable.py new file mode 100644 index 00000000..ea5f5f1a --- /dev/null +++ b/config/transformSourceTable.py @@ -0,0 +1,6 @@ +import os.path + +# Use the environment var. to prevent hardcoding of paths into quantum graphs. +# TODO: DM-28862: When that ticket is merged, policy files will be moved to a +# central location, likely into pipe_tasks. +config.functorFile = os.path.join('$OBS_DECAM_DIR', 'policy', 'Source.yaml') diff --git a/pipelines/DRP.yaml b/pipelines/DRP.yaml index 95ca36e3..cf12e2ce 100644 --- a/pipelines/DRP.yaml +++ b/pipelines/DRP.yaml @@ -1,16 +1,223 @@ -description: DRP specialized for DECam +# The DRP pipeline for DECam. +# This pipeline should only be run with reference to specific subsets or tasks +# referenced below. Attempting to run the whole pipeline will lead to a +# PrerequisiteInput error, owing to the requirement for crosstalk sources to be +# pre-generated for DECam data processing runs. +description: The DRP pipeline specialized for the DECam instrument instrument: lsst.obs.decam.DarkEnergyCamera imports: - - location: $PIPE_TASKS_DIR/pipelines/DRP.yaml - exclude: - - sourceTable - - objectTable - - isr - - location: $AP_PIPE/pipelines/RunIsrWithCrosstalk.yaml -# This DRP pipeline uses an obs_decam specific ISR configuration that -# requires crosstalk sources to be pre-generated via the -# RunIsrForCrosstalkSources.yaml pipeline. This applies overscan -# correction and writes a new dataset that is then used as needed for -# the inter-chip crosstalk solutions. Unless a specific overscan -# change is required, it may be best to generate these crosstalk -# sources soon after ingest to allow them to be readily available. + - $PIPE_TASKS_DIR/pipelines/DRP.yaml +tasks: + isrForCrosstalkSources: + class: lsst.ip.isr.IsrTask + config: + connections.outputExposure: overscanRaw + doOverscan: true + doAssembleCcd: false + doBias: false + doVariance: false + doLinearize: false + doDefect: false + doNanMasking: false + doDark: false + doFlat: false + doFringe: false + doInterpolate: false + isr: + class: lsst.ip.isr.IsrTask + config: + connections.crosstalkSources: overscanRaw + doCrosstalk: true + calibrate: + class: lsst.pipe.tasks.calibrate.CalibrateTask + config: + photoCal.match.referenceSelection.magLimit.fluxField: i_flux + photoCal.match.referenceSelection.magLimit.maximum: 22.0 + jointcal: + class: lsst.jointcal.JointcalTask + config: + python: | + # These overrides were copied from the tests/config/config-gen3.yaml file + # on 22 Sept 2021. This is necessary for processing in containers to succeed + # because the build system strips out the test directories for space concerns. + # + # TODO DM-29008: When that ticket is merged these overrides will no longer + # be needed at all since that will fix higher level issues with how config + # overrides are imported in general. + config.sourceSelector['science'].flags.bad = ['pixelFlags_edge', + 'pixelFlags_saturated', + 'pixelFlags_interpolatedCenter', + 'pixelFlags_interpolated', + 'pixelFlags_crCenter', + 'pixelFlags_bad', + 'hsmPsfMoments_flag', + 'apFlux_12_0_flag', + ] + config.sourceSelector['science'].doUnresolved = False + config.sourceSelector['science'].signalToNoise.fluxField = 'apFlux_12_0_instFlux' + config.sourceSelector['science'].signalToNoise.errField = 'apFlux_12_0_instFluxErr' + config.sourceSelector['science'].isolated.parentName = 'parentSourceId' + config.sourceSelector['science'].isolated.nChildName = 'deblend_nChild' + config.sourceFluxType = 'apFlux_12_0' + # TODO DM-27843: workaround for gen3 not supporting anyFilterMapsToThis + config.astrometryRefObjLoader.filterMap = {'u': 'phot_g_mean', + 'g': 'phot_g_mean', + 'r': 'phot_g_mean', + 'i': 'phot_g_mean', + 'z': 'phot_g_mean', + 'Y': 'phot_g_mean', + 'N419': 'phot_g_mean', + 'N540': 'phot_g_mean', + 'N708': 'phot_g_mean', + 'N964': 'phot_g_mean', + } + config.astrometryRefObjLoader.anyFilterMapsToThis = None + makeWarp: + class: lsst.pipe.tasks.makeCoaddTempExp.MakeWarpTask + config: + connections.photoCalibName: jointcal + # These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC + matchingKernelSize: 29 + doApplyExternalPhotoCalib: true + externalPhotoCalibName: 'jointcal' + doApplyExternalSkyWcs: true + modelPsf.defaultFwhm: 7.7 + warpAndPsfMatch.warp.warpingKernelName: 'lanczos5' + coaddPsf.warpingKernelName: 'lanczos5' + # When useGlobalExternalPhotoCalib is set to False, use per-tract photometric calibrations. + # Global calibrations must be disabled if using jointcal. + useGlobalExternalPhotoCalib: false + # Legacy DECam config to write out warps, even if they are empty + doWriteEmptyWarps: true + python: | + config.warpAndPsfMatch.psfMatch.kernel['AL'].alardSigGauss = [1.0, 2.0, 4.5] + from lsst.pipe.tasks.selectImages import PsfWcsSelectImagesTask + config.select.retarget(PsfWcsSelectImagesTask) + templateGen: + class: lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask + config: + # These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC + matchingKernelSize: 29 + doApplyExternalPhotoCalib: true + externalPhotoCalibName: 'jointcal' + doApplyExternalSkyWcs: true + # 200 rows (since patch width is typically < 10k pixels + subregionSize: (10000, 200) + doNImage: true + # Saturation trails are usually oriented east-west, so along rows + interpImage.transpose: true + coaddPsf.warpingKernelName: 'lanczos5' + assembleStaticSkyModel.subregionSize: (10000, 200) + assembleStaticSkyModel.doApplyExternalPhotoCalib: true + assembleStaticSkyModel.externalPhotoCalibName: 'jointcal' + assembleStaticSkyModel.doApplyExternalSkyWcs: true + doFilterMorphological: true + # When useGlobalExternalPhotoCalib is set to False, use per-tract photometric calibrations. + # Global calibrations must be disabled if using jointcal. + useGlobalExternalPhotoCalib: false + assembleStaticSkyModel.useGlobalExternalPhotoCalib: false + # transmission curves do not exist as-yet for DECam data + doAttachTransmissionCurve: false + python: | + config.removeMaskPlanes.append("CROSSTALK") + config.badMaskPlanes += ["SUSPECT"] + from lsst.pipe.tasks.selectImages import PsfWcsSelectImagesTask + config.select.retarget(PsfWcsSelectImagesTask) + assembleCoadd: + class: lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask + config: + # These configs match obs_subaru, to facilitate 1:1 comparisons between DECam and HSC + matchingKernelSize: 29 + doApplyExternalPhotoCalib: true + externalPhotoCalibName: 'jointcal' + doApplyExternalSkyWcs: true + # 200 rows (since patch width is typically < 10k pixels + subregionSize: (10000, 200) + doNImage: true + # Saturation trails are usually oriented east-west, so along rows + interpImage.transpose: true + coaddPsf.warpingKernelName: 'lanczos5' + assembleStaticSkyModel.subregionSize: (10000, 200) + assembleStaticSkyModel.doApplyExternalPhotoCalib: true + assembleStaticSkyModel.externalPhotoCalibName: 'jointcal' + assembleStaticSkyModel.doApplyExternalSkyWcs: true + doFilterMorphological: true + # When useGlobalExternalPhotoCalib is set to False, use per-tract photometric calibrations. + # Global calibrations must be disabled if using jointcal. + useGlobalExternalPhotoCalib: false + assembleStaticSkyModel.useGlobalExternalPhotoCalib: false + # transmission curves do not exist as-yet for DECam data + doAttachTransmissionCurve: false + python: | + config.removeMaskPlanes.append("CROSSTALK") + config.badMaskPlanes += ["SUSPECT"] + from lsst.pipe.tasks.selectImages import PsfWcsSelectImagesTask + config.select.retarget(PsfWcsSelectImagesTask) +subsets: + step0: + subset: + - isrForCrosstalkSources + description: > + Tasks which should be run once, prior to initial data processing. + + This step generates crosstalk sources for ISR/inter-chip crosstalk by applying + overscan correction on raw frames. A new dataset is written, which should be + used as an input for further data processing. + step1: + subset: + - isr + - characterizeImage + - calibrate + - transformSourceTable + - writeSourceTable + description: > + Per-detector tasks that can be run together to start the DRP pipeline. + + These should never be run with 'tract' or 'patch' as part of the data ID + expression if any later steps will also be run, because downstream steps require + full visits and 'tract' and 'patch' constraints will always select partial + visits that overlap that region. + step2: + subset: + - consolidateSourceTable + - consolidateVisitSummary + description: > + Per-visit tasks that can be run together, but only after 'step1'. + + These should never be run with 'tract' or 'patch' as part of the data ID + expression. + step3: + subset: + - selectGoodSeeingVisits + - jointcal + - makeWarp + - templateGen + - deblend + - detection + - writeObjectTable + - measure + - mergeMeasurements + - assembleCoadd + - forcedPhotCoadd + - transformObjectTable + - consolidateObjectTable + - mergeDetections + description: > + Tract-level tasks that can be run together, but only after the 'step1' + and 'step2' subsets. + + These should be run with explicit 'tract' constraints essentially all the + time, because otherwise quanta will be created for jobs with only partial visit + coverage. + # Steps 4-6 are not currently implemented in this DECam DRP processing pipeline. + step7: + subset: + - makeVisitTable + - makeCcdVisitTable + description: > + Tasks that should be run as the final step that require global inputs, + and can be run after the 'step3' subset. + + This step has global aggregation tasks to run over all visits, detectors, tracts, + etc. This step should be run only with the instrument constraint in the data + query. diff --git a/pipelines/README.md b/pipelines/README.md index a5abd93d..28d1d9d7 100644 --- a/pipelines/README.md +++ b/pipelines/README.md @@ -1,8 +1,7 @@ -# This is not a good place for pipelines +# Temporary DECam Pipelines -If you're looking for DECam-specific ISR-related pipelines, -they have moved to the `ap_pipe` package as of DM-29338. +DECam-specific pipelines are temporarily stored here. -As RFC-775 is implemented, it is anticipated this `pipelines` directory -will go away. Please put new pipelines in `*_pipe` or some other appropriate +As RFC-775 is implemented, it is anticipated this `pipelines` directory will +go away. Please put new pipelines in `*_pipe` or some other appropriate non-obs-package location. diff --git a/policy/Object.yaml b/policy/Object.yaml new file mode 100644 index 00000000..e54867f5 --- /dev/null +++ b/policy/Object.yaml @@ -0,0 +1,712 @@ +funcs: + objectId: # the index of deepCoadd_obj IS the objectId + functor: Index + parentObjectId: + functor: Column + args: parent + dataset: ref + coord_ra: + # reference position for merged "ref" cat. Required by db. Not in DPDD + functor: RAColumn + dataset: ref + coord_dec: + # reference position for merged "ref" cat. Required by db. Not in DPDD + # coord_dec because "dec" is reserved in most SQL DBs + functor: DecColumn + dataset: ref + ra: + functor: CoordColumn + args: coord_ra + dataset: meas + decl: + functor: CoordColumn + args: coord_dec + dataset: meas + # raErr: not available yet DM-15180 + # decErr: not available yet DM-15180 + # Reference band is same for all measurements + refBand: + functor: ReferenceBand + dataset: ref + # TODO DM-22241: Evaluate moving point source model + # - current plan requires matching to Source Table + # psRadecTai: No moving point source model yet + # psRadec: No moving point source model yet + # psPm: No moving point source model yet + # psParallax: No moving point source model yet + psfFlux: + functor: NanoJansky + dataset: forced_src + args: slot_PsfFlux_instFlux + psfFluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - slot_PsfFlux_instFlux + - slot_PsfFlux_instFluxErr + free_psfFlux: + functor: NanoJansky + dataset: meas + args: slot_PsfFlux_instFlux + free_psfFluxErr: + functor: NanoJanskyErr + dataset: meas + args: + - slot_PsfFlux_instFlux + - slot_PsfFlux_instFluxErr + free_psfFlux_flag: + functor: Column + dataset: meas + args: slot_PsfFlux_flag + # Assume the database will provide UDFs for Mags + # psCov: + # Flux should be somewhere in the name? + # How best to store cov matrix? + + # Replace multifit-predicted parameters with other goodness-of-fit parameters + # e.g. number of iterations, chi2/dof, derivative of objective function + # psLnL: No moving point source model yet + # psChi2: No moving point source model yet + # psNdata: No moving point source model yet + + # DRP is working the the Bulge-Disk model fluxes + # In the meantime, CModel is the best + # CModel fluxes have alias slot_ModelFlux + # bdRadec: # Same as SdssCentroid + # AB + theta + # E1+Re in DPDD is for a reason is no longer valid + # We once thought we were going to do shear from these. + bdE1: + functor: E1 + dataset: meas + args: + - modelfit_CModel_ellipse_xx + - modelfit_CModel_ellipse_xy + - modelfit_CModel_ellipse_yy + # rbdE1Err: Not computed + bdE2: + functor: E2 + dataset: meas + args: + - modelfit_CModel_ellipse_xx + - modelfit_CModel_ellipse_xy + - modelfit_CModel_ellipse_yy + # rbdE2Err: Not computed + bdReB: + functor: RadiusFromQuadrupole + dataset: meas + args: + - modelfit_CModel_dev_ellipse_xx + - modelfit_CModel_dev_ellipse_xy + - modelfit_CModel_dev_ellipse_yy + bdReD: + functor: RadiusFromQuadrupole + dataset: meas + args: + - modelfit_CModel_exp_ellipse_xx + - modelfit_CModel_exp_ellipse_xy + - modelfit_CModel_exp_ellipse_yy + # bdCov: Not computed + # DM-22251: We need a total galaxy model (BD) flux column: + # with either a total and fraction in Bulge or Disk + # We should change the name BD, it assumes algorithm choice + bdChi2: + functor: Column + dataset: meas + args: modelfit_CModel_objective + # bdSamples: DM-22242 Remove from the DPDD and + # replace with other shear estimation parameters. e.g. How e1 and e2 respond to shear. + bdFluxB: + functor: NanoJansky + dataset: meas + args: modelfit_CModel_dev_instFlux + bdFluxBErr: + functor: NanoJanskyErr + dataset: meas + args: + - modelfit_CModel_dev_instFlux + - modelfit_CModel_dev_instFluxErr + bdFluxD: + functor: NanoJansky + dataset: meas + args: modelfit_CModel_exp_instFlux + bdFluxDErr: + functor: NanoJanskyErr + dataset: meas + args: + - modelfit_CModel_exp_instFlux + - modelfit_CModel_exp_instFluxErr + # DM-22243: Replace these with g, r, i, z, y and the blessed fluxes to use for colors + # Need a new name like "gModelColorFlux", "gMatchedApertureGalaxyFlux", or + # "gMatchedApertureFlux", "gStdFlux" + # HSC users still debating between + # 1) PSF convolved undeblended aperture fluxes? + # 2) Scarlet outputs? + # In the meantime use forced CModel + # grStd: + # riStd: + # izStd: + # zyStd: + # PSF GAaP flux + gaapPsfFlux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_PsfFlux_instFlux + gaapPsfFluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_PsfFlux_instFlux + - ext_gaap_GaapFlux_1_15x_PsfFlux_instFluxErr + # 0.5 arcsec sigma GAaP flux + gaap0p5Flux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_0_5_instFlux + gaap0p5FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_0_5_instFlux + - ext_gaap_GaapFlux_1_15x_0_5_instFluxErr + # 0.7 arcsec sigma GAaP flux + gaap0p7Flux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_0_7_instFlux + gaap0p7FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_0_7_instFlux + - ext_gaap_GaapFlux_1_15x_0_7_instFluxErr + # 1.0 arcsec sigma GAaP flux + gaap1p0Flux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_1_0_instFlux + gaap1p0FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_1_0_instFlux + - ext_gaap_GaapFlux_1_15x_1_0_instFluxErr + # 1.5 arcsec sigma GAaP flux + gaap1p5Flux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_1_5_instFlux + gaap1p5FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_1_5_instFlux + - ext_gaap_GaapFlux_1_15x_1_5_instFluxErr + # 2.5 arcsec sigma GAaP flux + gaap2p5Flux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_2_5_instFlux + gaap2p5FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_2_5_instFlux + - ext_gaap_GaapFlux_1_15x_2_5_instFluxErr + # 3.0 arcsec sigma GAaP flux + gaap3p0Flux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_3_0_instFlux + gaap3p0FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_3_0_instFlux + - ext_gaap_GaapFlux_1_15x_3_0_instFluxErr + # Optimal GAaP flux + gaapOptimalFlux: + functor: NanoJansky + dataset: forced_src + args: ext_gaap_GaapFlux_1_15x_Optimal_instFlux + gaapOptimalFluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - ext_gaap_GaapFlux_1_15x_Optimal_instFlux + - ext_gaap_GaapFlux_1_15x_Optimal_instFluxErr + # Taking Shape from meas + ixx: + functor: Column + args: slot_Shape_xx + dataset: meas + iyy: + functor: Column + args: slot_Shape_yy + dataset: meas + ixy: + functor: Column + args: slot_Shape_xy + dataset: meas + i_flag: + functor: Column + args: slot_Shape_flag + dataset: meas + # Icov: # need to compute + # DM-22249 Evaluate whether we want to replace IxxPSF/IyyPSF/IxyPSF w/ FWHM + ixxPSF: + functor: Column + args: slot_PsfShape_xx + dataset: meas + iyyPSF: + functor: Column + args: slot_PsfShape_yy + dataset: meas + ixyPSF: + functor: Column + args: slot_PsfShape_xy + dataset: meas + iPSF_flag: + functor: Column + args: slot_PsfShape_flag + dataset: meas + ixxRound: + functor: Column + args: slot_ShapeRound_xx + dataset: meas + iyyRound: + functor: Column + args: slot_ShapeRound_yy + dataset: meas + ixyRound: + functor: Column + args: slot_ShapeRound_xy + dataset: meas + iRound_flag: + functor: Column + args: slot_ShapeRound_xy + dataset: meas + iPSF_flag: + functor: Column + args: slot_PsfShape_flag + dataset: meas + ixxDebiasedPSF: + functor: Column + args: ext_shapeHSM_HsmPsfMomentsDebiased_xx + dataset: meas + iyyDebiasedPSF: + functor: Column + args: ext_shapeHSM_HsmPsfMomentsDebiased_yy + dataset: meas + ixyDebiasedPSF: + functor: Column + args: ext_shapeHSM_HsmPsfMomentsDebiased_xy + dataset: meas + iDebiasedPSF_flag: + functor: Column + args: ext_shapeHSM_HsmPsfMomentsDebiased_flag + dataset: meas + # m4: Request removal from DPDD (DM-22250) + # Petrosian magnitudes not yet implemented. Planning pacakge DMBP-116 + # Redefine Kron (DM-22245) and Petrosian (DM-22244) columns to report in DPDD + # petroRad: + # petroRadErr: + # petroBand: + # petroFlux: + # petroFluxErr: + # petroRad50: + # petroRad50Err: + # petroRad90: + # petroRad90Err: + kronRad: + # Convert to sky coords + functor: Column + args: ext_photometryKron_KronFlux_radius + dataset: meas # or forced_src? + # kronRadErr: # Not computed + # kronBand: replaced with `refBand` + kronFlux: + functor: NanoJansky + dataset: meas # or forced_src? + args: ext_photometryKron_KronFlux_instFlux + kronFluxErr: + functor: NanoJanskyErr + dataset: meas # or forced_src? + args: + - ext_photometryKron_KronFlux_instFlux + - ext_photometryKron_KronFlux_instFluxErr + # kronRad50: Need to compute DM-16313 + # kronRad50Err: Need to compute DM-16313 + # kronRad90: Need to compute DM-16313 + # kronRad90Err: Need to compute DM-16313 + # apFlux renamed to calibFlux because it is not guaranteed to be an apFlux + calibFlux: + functor: NanoJansky + dataset: meas + args: slot_CalibFlux_instFlux + calibFluxErr: + functor: NanoJanskyErr + dataset: meas + args: + - slot_CalibFlux_instFlux + - slot_CalibFlux_instFluxErr + # Not in DPDD. Used for QA + ap03Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_3_0_instFlux + ap03FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_3_0_instFlux + - base_CircularApertureFlux_3_0_instFluxErr + ap03Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_3_0_flag + # if we need to add decimal apertures call them e.g. ap04p5Flux + ap06Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_6_0_instFlux + ap06FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_6_0_instFlux + - base_CircularApertureFlux_6_0_instFluxErr + ap06Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_6_0_flag + ap09Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_9_0_instFlux + ap09FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_9_0_instFlux + - base_CircularApertureFlux_9_0_instFluxErr + ap09Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_9_0_flag + ap12Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_12_0_instFlux + ap12FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_12_0_instFlux + - base_CircularApertureFlux_12_0_instFluxErr + ap12Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_12_0_flag + ap17Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_17_0_instFlux + ap17FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_17_0_instFlux + - base_CircularApertureFlux_17_0_instFluxErr + ap17Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_17_0_flag + ap25Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_25_0_instFlux + ap25FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_25_0_instFlux + - base_CircularApertureFlux_25_0_instFluxErr + ap25Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_25_0_flag + ap35Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_35_0_instFlux + ap35FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_35_0_instFlux + - base_CircularApertureFlux_35_0_instFluxErr + ap35Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_35_0_flag + ap50Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_50_0_instFlux + ap50FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_50_0_instFlux + - base_CircularApertureFlux_50_0_instFluxErr + ap50Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_50_0_flag + ap70Flux: + functor: NanoJansky + dataset: forced_src + args: base_CircularApertureFlux_70_0_instFlux + ap70FluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - base_CircularApertureFlux_70_0_instFlux + - base_CircularApertureFlux_70_0_instFluxErr + ap70Flux_flag: + functor: Column + dataset: forced_src + args: base_CircularApertureFlux_70_0_flag + + # DM-22246: Change Ap surface brightness to fluxes in DPDD + # i.e. remove apNann, apMeanSb, apMeanSbSigma + # DM-22247: Replace Extendedness with a view or paragraph in docs on how to compute + refExtendedness: + functor: Column + args: base_ClassificationExtendedness_value + dataset: ref + extendedness: + functor: Column + args: base_ClassificationExtendedness_value + dataset: meas + # lcPeriodic: # Not computed. Need multi-epoch forced phot S19 + # lcNonPeriodic: # Not computed. Need without multi-epoch forced phot S19 + # photoZ: # Not computed yet + + # COLUMNS ADDED (not in the DPDD) + x: + functor: Column + args: slot_Centroid_x + dataset: ref + y: + functor: Column + args: slot_Centroid_y + dataset: ref + xErr: + functor: Column + args: slot_Centroid_xErr + dataset: ref + yErr: + functor: Column + args: slot_Centroid_yErr + dataset: ref + xy_flag: + functor: Column + args: slot_Centroid_flag + dataset: ref + # Not in DPDD + blendedness: + functor: Column + args: base_Blendedness_abs + dataset: meas + # DM-22249: Make FWHM a view of IxxPsf IxyPsf IyyPsf + # Or remove ixxPsf, IxyPsf, IyyPsf. + fwhm: + functor: HsmFwhm + dataset: meas + refFwhm: + functor: HsmFwhm + cModelFlux: + functor: NanoJansky + dataset: forced_src + args: modelfit_CModel_instFlux + cModelFluxErr: + functor: NanoJanskyErr + dataset: forced_src + args: + - modelfit_CModel_instFlux + - modelfit_CModel_instFluxErr + cModelFlux_inner: + functor: NanoJansky + dataset: forced_src + args: modelfit_CModel_instFlux_inner + free_cModelFlux: #to dm-naming things + functor: NanoJansky + dataset: meas + args: modelfit_CModel_instFlux + free_cModelFluxErr: + functor: NanoJanskyErr + dataset: meas + args: + - modelfit_CModel_instFlux + - modelfit_CModel_instFluxErr + free_cModelFlux_inner: + functor: NanoJansky + dataset: meas + args: modelfit_CModel_instFlux_inner + free_cModelFlux_flag: + functor: Column + dataset: meas + args: modelfit_CModel_flag + # exp, dev, total, fracdev + # We need different ellipticities for shear measurement: + hsmShapeRegauss_e1: + functor: Column + args: ext_shapeHSM_HsmShapeRegauss_e1 + dataset: meas + hsmShapeRegauss_e2: + functor: Column + args: ext_shapeHSM_HsmShapeRegauss_e2 + dataset: meas + hsmShapeRegauss_sigma: + functor: Column + args: ext_shapeHSM_HsmShapeRegauss_sigma + dataset: meas + hsmShapeRegauss_flag: + functor: Column + args: ext_shapeHSM_HsmShapeRegauss_flag + dataset: meas + inputCount: + functor: Column + args: base_InputCount_value + dataset: forced_src + footprintArea: + functor: Column + args: base_FootprintArea_value + dataset: ref + sky_object: + functor: Column + args: merge_peak_sky + dataset: ref + # DM-22247: Add Star/Galaxy sep olumns + # - Morphological Star Galaxy Classifier (Names? float 0-1)] + # - Morphological + Color (SED-based) Star Galaxy Classifier (Names? float 0-1)] + # DM-22248: Need to add per object Galactic extinction to post-processing +refFlags: + # refFlags are columns taken without translation from the ref table + - detect_isPatchInner + - detect_isPrimary + - detect_isTractInner + - detect_isIsolated + - detect_fromBlend + - detect_isDeblendedSource + - detect_isDeblendedModelSource + - merge_peak_sky + - deblend_nChild + - deblend_skipped + - slot_Shape_flag + - slot_Shape_xx + - slot_Shape_xy + - slot_Shape_yy +flags: + # flags are columns taken and exploded per-band from the meas tables + - base_Blendedness_flag + - base_PixelFlags_flag_bad + - base_PixelFlags_flag_clipped + - base_PixelFlags_flag_clippedCenter + - base_PixelFlags_flag_cr + - base_PixelFlags_flag_crCenter + - base_PixelFlags_flag_edge + - base_PixelFlags_flag_inexact_psf + - base_PixelFlags_flag_inexact_psfCenter + - base_PixelFlags_flag_interpolated + - base_PixelFlags_flag_interpolatedCenter + - base_PixelFlags_flag_offimage + - base_PixelFlags_flag_saturated + - base_PixelFlags_flag_saturatedCenter + - base_PixelFlags_flag_sensor_edge + - base_PixelFlags_flag_sensor_edgeCenter + - base_PixelFlags_flag_suspect + - base_PixelFlags_flag_suspectCenter + - base_ClassificationExtendedness_flag + - calib_astrometry_used + - calib_photometry_reserved + - calib_photometry_used + - calib_psf_candidate + - calib_psf_reserved + - calib_psf_used + - slot_ApFlux_flag + - slot_ApFlux_flag_apertureTruncated + - slot_ApFlux_flag_sincCoeffsTruncated + - slot_CalibFlux_flag + - slot_CalibFlux_flag_apertureTruncated + - slot_CalibFlux_flag_sincCoeffsTruncated + - slot_Centroid_flag + - slot_Centroid_x + - slot_Centroid_xErr + - slot_Centroid_y + - slot_Centroid_yErr + - ext_photometryKron_KronFlux_flag + - ext_photometryKron_KronFlux_flag_bad_radius + - ext_photometryKron_KronFlux_flag_bad_shape + - ext_photometryKron_KronFlux_flag_bad_shape_no_psf + - ext_photometryKron_KronFlux_flag_edge + - ext_photometryKron_KronFlux_flag_no_fallback_radius + - ext_photometryKron_KronFlux_flag_no_minimum_radius + - ext_photometryKron_KronFlux_flag_small_radius + - ext_photometryKron_KronFlux_flag_used_minimum_radius + - ext_photometryKron_KronFlux_flag_used_psf_radius +forcedFlags: + # - forced source + - base_InputCount_flag + - base_InputCount_flag_noInputs + - slot_PsfFlux_area + - slot_PsfFlux_flag + - slot_PsfFlux_flag_apCorr + - slot_PsfFlux_flag_edge + - slot_PsfFlux_flag_noGoodPixels + - modelfit_CModel_flag + - modelfit_CModel_flag_apCorr + - ext_gaap_GaapFlux_flag + - ext_gaap_GaapFlux_flag_edge + - ext_gaap_GaapFlux_1_15x_flag_gaussianization + - ext_gaap_GaapFlux_1_15x_Optimal_flag_bigPsf + - ext_gaap_GaapFlux_1_15x_0_5_flag_bigPsf + - ext_gaap_GaapFlux_1_15x_0_7_flag_bigPsf + - ext_gaap_GaapFlux_1_15x_1_0_flag_bigPsf + - ext_gaap_GaapFlux_1_15x_1_5_flag_bigPsf + - ext_gaap_GaapFlux_1_15x_2_5_flag_bigPsf + - ext_gaap_GaapFlux_1_15x_3_0_flag_bigPsf +flag_rename_rules: + # Taken from db-meas-forced + - ['modelfit_C', 'c'] + - ['base_PixelFlags_flag', 'pixelFlags'] + - ['base_CircularApertureFlux', 'apFlux'] + - ['ext_convolved_', ''] + - ['ext_gaap_GaapFlux_1_15x_0_5', 'gaap0p5Flux'] + - ['ext_gaap_GaapFlux_1_15x_0_7', 'gaap0p7Flux'] + - ['ext_gaap_GaapFlux_1_15x_1_0', 'gaap1p0Flux'] + - ['ext_gaap_GaapFlux_1_15x_1_5', 'gaap1p5Flux'] + - ['ext_gaap_GaapFlux_1_15x_2_5', 'gaap2p5Flux'] + - ['ext_gaap_GaapFlux_1_15x_3_0', 'gaap3p0Flux'] + - ['ext_gaap_GaapFlux_1_15x_Optimal', 'gaapOptimalFlux'] + - ['ext_gaap_GaapFlux_1_15x', 'gaapFlux'] + - ['ext_gaap_GaapFlux', 'gaapFlux'] + - ['undeblended_base', 'undeblended'] + - ['undeblended_ext_photometryKron', 'undeblended'] + - ['ext_photometryKron_KronFlux', 'kronFlux'] + - ['slot_Centroid', 'centroid'] + - ['slot_Calib', 'calib'] + - ['slot_Psf', 'psf'] + - ['slot_Shape', 'shape'] + - ['slot_ApFlux', 'apFlux'] + - ['base_Blendedness', 'blendedness'] + - ['base_PixelFlags_flag', 'pixelFlags'] + - ['base_ClassificationE', 'e'] + - ['base_Psf', 'psf'] + - ['base_CircularApertureFlux', 'apFlux'] + - ['base_FootprintArea', 'footprintArea'] + - ['base_Jacobian', 'jacobian'] + - ['base_Input', 'input'] + - ['ext_convolved_', ''] diff --git a/policy/Source.yaml b/policy/Source.yaml new file mode 100644 index 00000000..cd0351c9 --- /dev/null +++ b/policy/Source.yaml @@ -0,0 +1,411 @@ +funcs: + sourceId: + functor: Index + coord_ra: + # reference position required by db. Not in DPDD + functor: CoordColumn + args: coord_ra + coord_dec: + # Reference position required by db. Not in DPDD + functor: CoordColumn + args: coord_dec + ccdVisitId: + functor: Column + args: ccdVisitId + # objectId: not avaliable + # ssObjectId: not avaliable + parentSourceId: + functor: Column + args: parent + #htmId20: not avaliable + x: + functor: Column + args: slot_Centroid_x + y: + functor: Column + args: slot_Centroid_y + xErr: + functor: Column + args: slot_Centroid_xErr + yErr: + functor: Column + args: slot_Centroid_yErr + # x_y_Cov: not available + ra: + functor: RAColumn + # raErr: not available yet DM-15180 + decl: + functor: DecColumn + # declErr: not available yet DM-15180 + # ra_decl_Cov: not available yet + # One calibrated Calib flux is important: + calibFlux: + functor: LocalNanojansky + args: + - slot_CalibFlux_instFlux + - slot_CalibFlux_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + calibFluxErr: + functor: LocalNanojanskyErr + args: + - slot_CalibFlux_instFlux + - slot_CalibFlux_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + # Not in DPDD. Used for QA + ap03Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_3_0_instFlux + - base_CircularApertureFlux_3_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap03FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_3_0_instFlux + - base_CircularApertureFlux_3_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap03Flux_flag: + functor: Column + args: base_CircularApertureFlux_3_0_flag + # if we need to add decimal apertures call them e.g. ap04p5Flux + ap06Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_6_0_instFlux + - base_CircularApertureFlux_6_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap06FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_6_0_instFlux + - base_CircularApertureFlux_6_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap06Flux_flag: + functor: Column + args: base_CircularApertureFlux_6_0_flag + ap09Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_9_0_instFlux + - base_CircularApertureFlux_9_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap09FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_9_0_instFlux + - base_CircularApertureFlux_9_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap09Flux_flag: + functor: Column + args: base_CircularApertureFlux_9_0_flag + ap12Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_12_0_instFlux + - base_CircularApertureFlux_12_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap12FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_12_0_instFlux + - base_CircularApertureFlux_12_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap12Flux_flag: + functor: Column + args: base_CircularApertureFlux_12_0_flag + ap17Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_17_0_instFlux + - base_CircularApertureFlux_17_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap17FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_17_0_instFlux + - base_CircularApertureFlux_17_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap17Flux_flag: + functor: Column + args: base_CircularApertureFlux_17_0_flag + ap25Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_25_0_instFlux + - base_CircularApertureFlux_25_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap25FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_25_0_instFlux + - base_CircularApertureFlux_25_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap25Flux_flag: + functor: Column + args: base_CircularApertureFlux_25_0_flag + ap35Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_35_0_instFlux + - base_CircularApertureFlux_35_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap35FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_35_0_instFlux + - base_CircularApertureFlux_35_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap35Flux_flag: + functor: Column + args: base_CircularApertureFlux_35_0_flag + ap50Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_50_0_instFlux + - base_CircularApertureFlux_50_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap50FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_50_0_instFlux + - base_CircularApertureFlux_50_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap50Flux_flag: + functor: Column + args: base_CircularApertureFlux_50_0_flag + ap70Flux: + functor: LocalNanojansky + args: + - base_CircularApertureFlux_70_0_instFlux + - base_CircularApertureFlux_70_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap70FluxErr: + functor: LocalNanojanskyErr + args: + - base_CircularApertureFlux_70_0_instFlux + - base_CircularApertureFlux_70_0_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + ap70Flux_flag: + functor: Column + args: base_CircularApertureFlux_70_0_flag + # TODO: When DM-25019 is complete, these should be + # changed to use the local value of the background + # model, rather than the residual of the background + sky: + functor: LocalNanojansky + args: + - base_LocalBackground_instFlux + - base_LocalBackground_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + skyErr: + functor: LocalNanojanskyErr + args: + - base_LocalBackground_instFlux + - base_LocalBackground_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + psfFlux: + functor: LocalNanojansky + args: + - slot_PsfFlux_instFlux + - slot_PsfFlux_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + psfFluxErr: + functor: LocalNanojanskyErr + args: + - slot_PsfFlux_instFlux + - slot_PsfFlux_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + + # These PS columns do not make sense anymore as named + # psX + # psXSigma + # psY + # psYSigma + # psFlux_psX_Cov + # psFlux_psY_Cov + # psX_Y_Cov + # psLnL + # psChi2 + # psN + # psRa + # psRaSigma + # psDecl + # psDeclSigma + # psFlux_psRa_Cov + # psFlux_psDecl_Cov + + + ixx: + functor: Column + args: slot_Shape_xx + iyy: + functor: Column + args: slot_Shape_yy + ixy: + functor: Column + args: slot_Shape_xy + # DPDD should include Psf Shape + ixxPSF: + functor: Column + args: slot_PsfShape_xx + iyyPSF: + functor: Column + args: slot_PsfShape_yy + ixyPSF: + functor: Column + args: slot_PsfShape_xy + # apNann: Replaced by raw Aperture instFluxes in flags section below + # apMeanSb: Replaced by raw Aperture instFluxes in flags section below + # apMeanSbErr: Replaced by raw Aperture instFluxes in flags section below + + # DPDD does not include gaussianFluxes, however they are used for + # the single frame extendedness column which is used for QA. + gaussianFlux: + functor: LocalNanojansky + args: + - base_GaussianFlux_instFlux + - base_GaussianFlux_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + gaussianFluxErr: + functor: LocalNanojanskyErr + args: + - base_GaussianFlux_instFlux + - base_GaussianFlux_instFluxErr + - base_LocalPhotoCalib + - base_LocalPhotoCalibErr + extendedness: + functor: Column + args: base_ClassificationExtendedness_value +flags: + - base_LocalPhotoCalib + - base_LocalPhotoCalib_flag + - base_LocalPhotoCalibErr + - base_LocalWcs_flag + - base_LocalWcs_CDMatrix_2_1 + - base_LocalWcs_CDMatrix_1_1 + - base_LocalWcs_CDMatrix_1_2 + - base_LocalWcs_CDMatrix_2_2 + - base_Blendedness_abs + - base_Blendedness_flag + - base_Blendedness_flag_noCentroid + - base_Blendedness_flag_noShape + - base_CircularApertureFlux_12_0_flag + - base_CircularApertureFlux_12_0_flag_apertureTruncated + - base_CircularApertureFlux_12_0_flag_sincCoeffsTruncated + - base_CircularApertureFlux_12_0_instFlux + - base_CircularApertureFlux_12_0_instFluxErr + - base_CircularApertureFlux_17_0_flag + - base_CircularApertureFlux_17_0_instFlux + - base_CircularApertureFlux_17_0_instFluxErr + - base_ClassificationExtendedness_flag + - base_FootprintArea_value + - base_Jacobian_flag + - base_Jacobian_value + - base_LocalBackground_instFlux + - base_LocalBackground_instFluxErr + - base_LocalBackground_flag + - base_LocalBackground_flag_noGoodPixels + - base_LocalBackground_flag_noPsf + - base_PixelFlags_flag_bad + - base_PixelFlags_flag_cr + - base_PixelFlags_flag_crCenter + - base_PixelFlags_flag_edge + - base_PixelFlags_flag_interpolated + - base_PixelFlags_flag_interpolatedCenter + - base_PixelFlags_flag_offimage + - base_PixelFlags_flag_saturated + - base_PixelFlags_flag_saturatedCenter + - base_PixelFlags_flag_suspect + - base_PixelFlags_flag_suspectCenter + - base_PsfFlux_apCorr + - base_PsfFlux_apCorrErr + - base_PsfFlux_area + - base_PsfFlux_flag + - base_PsfFlux_flag_apCorr + - base_PsfFlux_flag_edge + - base_PsfFlux_flag_noGoodPixels + - base_GaussianFlux_flag + - base_SdssCentroid_flag + - base_SdssCentroid_flag_almostNoSecondDerivative + - base_SdssCentroid_flag_badError + - base_SdssCentroid_flag_edge + - base_SdssCentroid_flag_noSecondDerivative + - base_SdssCentroid_flag_notAtMaximum + - base_SdssCentroid_flag_resetToPeak + - base_Variance_flag + - base_Variance_flag_emptyFootprint + - base_Variance_value + - calib_astrometry_used + - calib_detected + - calib_photometry_reserved + - calib_photometry_used + - calib_psf_candidate + - calib_psf_reserved + - calib_psf_used + - deblend_deblendedAsPsf + - deblend_hasStrayFlux + - deblend_masked + - deblend_nChild + - deblend_parentTooBig + - deblend_patchedTemplate + - deblend_rampedTemplate + - deblend_skipped + - deblend_tooManyPeaks + - ext_shapeHSM_HsmPsfMoments_flag + - ext_shapeHSM_HsmPsfMoments_flag_no_pixels + - ext_shapeHSM_HsmPsfMoments_flag_not_contained + - ext_shapeHSM_HsmPsfMoments_flag_parent_source + - ext_shapeHSM_HsmShapeRegauss_flag + - ext_shapeHSM_HsmShapeRegauss_flag_galsim + - ext_shapeHSM_HsmShapeRegauss_flag_no_pixels + - ext_shapeHSM_HsmShapeRegauss_flag_not_contained + - ext_shapeHSM_HsmShapeRegauss_flag_parent_source + - sky_source + - detect_isPrimary + +flag_rename_rules: + # Taken from db-meas-forced + - ['ext_photometryKron_', ''] + - ['base_Blendedness', 'base_blendedness'] + - ['base_Local', 'local'] + - ['base_PixelFlags_flag', 'pixelFlags'] + - ['base_ClassificationE', 'e'] + - ['base_SdssCentroid', 'centroid'] + - ['base_Variance', 'variance'] + - ['base_Psf', 'psf'] + - ['base_GaussianFlux', 'gaussianFlux'] + - ['base_CircularApertureFlux', 'apFlux'] + - ['base_FootprintArea', 'footprintArea'] + - ['base_Jacobian', 'jacobian'] + - ['ext_shapeHSM_Hsm', 'hsm'] + - ['ext_convolved_', ''] + - ['undeblended_base', 'undeblended'] + - ['undeblended_ext_photometryKron', 'undeblended'] + - ['ext_photometryKron_', ''] + - ['base_', ''] + - ['slot_', '']