Skip to content

Commit

Permalink
Merge pull request #9 from lsst/tickets/DM-37786
Browse files Browse the repository at this point in the history
DM-37786: utilize fine-grained control over QG generation behavior to work around limitations there
  • Loading branch information
TallJimbo committed Feb 15, 2023
2 parents 03b55d6 + e9eed1d commit 2daa10f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions python/lsst/drp/tasks/update_visit_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from lsst.pipe.base import (
ButlerQuantumContext,
InputQuantizedConnection,
InvalidQuantumError,
OutputQuantizedConnection,
PipelineTask,
PipelineTaskConfig,
Expand Down Expand Up @@ -262,50 +263,58 @@ class UpdateVisitSummaryConnections(
storageClass="ExposureF",
multiple=True,
deferLoad=True,
deferGraphConstraint=True,
)
psf_overrides = cT.Input(
doc="Visit-level catalog of updated PSFs to use.",
name="finalized_psf_ap_corr_catalog",
dimensions=("instrument", "visit"),
storageClass="ExposureCatalog",
deferGraphConstraint=True,
)
psf_star_catalog = cT.Input(
doc="Per-visit table of PSF reserved- and used-star measurements.",
name="finalized_src_table",
dimensions=("instrument", "visit"),
storageClass="DataFrame",
deferGraphConstraint=True,
)
ap_corr_overrides = cT.Input(
doc="Visit-level catalog of updated aperture correction maps to use.",
name="finalized_psf_ap_corr_catalog",
dimensions=("instrument", "visit"),
storageClass="ExposureCatalog",
deferGraphConstraint=True,
)
photo_calib_overrides_tract = cT.Input(
doc="Per-Tract visit-level catalog of updated photometric calibration objects to use.",
name="{photoCalibName}PhotoCalibCatalog",
dimensions=("instrument", "visit", "tract"),
storageClass="ExposureCatalog",
multiple=True,
deferGraphConstraint=True,
)
photo_calib_overrides_global = cT.Input(
doc="Global visit-level catalog of updated photometric calibration objects to use.",
name="{photoCalibName}PhotoCalibCatalog",
dimensions=("instrument", "visit"),
storageClass="ExposureCatalog",
deferGraphConstraint=True,
)
wcs_overrides_tract = cT.Input(
doc="Per-tract visit-level catalog of updated astrometric calibration objects to use.",
name="{skyWcsName}SkyWcsCatalog",
dimensions=("instrument", "visit", "tract"),
storageClass="ExposureCatalog",
multiple=True,
deferGraphConstraint=True,
)
wcs_overrides_global = cT.Input(
doc="Global visit-level catalog of updated astrometric calibration objects to use.",
name="{skyWcsName}SkyWcsCatalog",
dimensions=("instrument", "visit"),
storageClass="ExposureCatalog",
deferGraphConstraint=True,
)
background_originals = cT.Input(
doc="Per-detector original background that has already been subtracted from 'input_exposures'.",
Expand All @@ -314,6 +323,7 @@ class UpdateVisitSummaryConnections(
storageClass="Background",
multiple=True,
deferLoad=True,
deferGraphConstraint=True,
)
background_overrides = cT.Input(
doc="Per-detector background that can be subtracted directly from 'input_exposures'.",
Expand All @@ -322,6 +332,7 @@ class UpdateVisitSummaryConnections(
storageClass="Background",
multiple=True,
deferLoad=True,
deferGraphConstraint=True,
)
output_summary_schema = cT.InitOutput(
doc="Schema of the output visit summary catalog.",
Expand Down Expand Up @@ -574,6 +585,17 @@ def runQuantum(
inputs[name] = {
handle.dataId["detector"]: handle for handle in handles_list
}
for record in inputs["input_summary_catalog"]:
detector_id = record.getId()
if detector_id not in inputs[name]:
raise InvalidQuantumError(
f"No {name!r} with detector {detector_id} for visit "
f"{butlerQC.quantum.dataId['visit']} even though this detector is present "
"in the input visit summary catalog. "
"This is most likely to occur when the QuantumGraph that includes this task "
"was incorrectly generated with an explicit or implicit (from datasets) tract "
"constraint."
)
# Convert the psf_star_catalog datasets from DataFrame to Astropy so
# they can be handled by ComputeExposureSummaryStatsTask (which was
# actually written to work with afw.table, but Astropy is similar
Expand Down

0 comments on commit 2daa10f

Please sign in to comment.