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-39227: rework (with deprecation) external-calibration connections. #812

Merged
merged 10 commits into from Jul 13, 2023

Conversation

TallJimbo
Copy link
Member

No description provided.

if config.select.target != lsst.pipe.tasks.selectImages.PsfWcsSelectImagesTask:
del self.visitSummary
# We always drop the deprecated wcsList and bboxList connections,
# since we can always equivalents from the visitSummary dataset.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"....since we can always use/get equivalents from..."

deprecated=(
"Deprecated in favor of the 'visitSummary' connection (and already ignored). "
"Will be removed after v27."
)
)
visitSummary = connectionTypes.Input(
doc="Consolidated exposure metadata",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update doc to match those in meas_base (or vice-versa)?

doc="Input visit-summary catalog with updated calibration objects.",

row = visitSummary.find(dataId["detector"])
if row is None:
raise RuntimeError(
f"Unexpectedly incomplete visitSummary provided to makeWarp: {dataId} missing."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...{dataId} is missing"?

"If True, use the PSF model and aperture corrections from the 'visitSummary' connection. "
"If False, use the PSF model and aperture corrections from the 'exposure' connection. "
# TODO: remove this next sentence on DM-39854.
"The finalizedPsfApCorrCatalog connection (if enabled) takes precedence over either. "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank space after period.

row = visitSummary.find(detectorId)
if row is None:
raise RuntimeError(
f"Unexpectedly incomplete visitSummary: detector={detectorId} missing."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...{dataId} is missing"?

)
exposure = connectionTypes.Input(
doc="Input exposure to perform photometry on.",
name="calexp",
storageClass="ExposureF",
dimensions=["instrument", "visit", "detector"],
)
visitSummary = connectionTypes.Input(
doc="Consolidated exposure metadata",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update doc to match those in meas_base (or vice-versa)?

doc="Input visit-summary catalog with updated calibration objects.",

@@ -528,10 +585,15 @@ def prepareCalibratedExposure(self, exposure, externalSkyWcsCatalog=None, extern
Exposure catalog with external skyWcs to be applied
if config.doApplyExternalSkyWcs=True. Catalog uses the detector id
for the catalog id, sorted on id for fast lookup.
Deprecated in favor of 'visitSummary`; will be removed after v27.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the inconsistent ticks matter (here and below)?

)

def __init__(self, *, config=None):
super().__init__(config=config)
# Same connection boilerplate as all other applications of
# Global/Tract calibrations
keepSkyMap = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a TODO in here?

@@ -532,6 +550,9 @@ def prepareCalibratedExposure(self, exposure, externalSkyWcsCatalog=None, extern
Exposure catalog with external photoCalib to be applied
if config.doApplyExternalPhotoCalib=True. Catalog uses the detector
id for the catalog id, sorted on id for fast lookup.
visitSummary : `lsst.afw.table.ExposureCatalog`, optional
Exposure catalog with all calibration objects. WCS and PhotoCalib
are always applied if provided and present.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I know what you mean, but "provided and present" sounds redundant.

I think visitSummary should provide anything any else a 'select'
subtask implementation might need, and that's why the TODO code
comments can be removed here as well.
Since only finalVisitSummary has PSF and ApCorrMap, this adds a new
useVisitSummaryPsf config option that can be set to False to use the
calexp for those instead.  In all other cases we skip any detectors
for which the visit summary doesn't provide what we want, because we
expect that to represent our best calibrations and we don't want to
include detectors without those in the coadd.
@TallJimbo TallJimbo merged commit dec3bc7 into main Jul 13, 2023
2 checks passed
@TallJimbo TallJimbo deleted the tickets/DM-39227 branch July 13, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants