Skip to content

Commit

Permalink
Rename output to exposure
Browse files Browse the repository at this point in the history
The input is now a multiple `exposures`, so we can use that to simplify
the code.
  • Loading branch information
parejkoj committed Feb 8, 2024
1 parent acb9fdc commit b385dab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions python/lsst/pipe/tasks/calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class CalibrateImageConnections(pipeBase.PipelineTaskConnections,

# TODO DM-38732: We want some kind of flag on Exposures/Catalogs to make
# it obvious which components had failed to be computed/persisted.
output_exposure = connectionTypes.Output(
exposure = connectionTypes.Output(
doc="Photometrically calibrated exposure with fitted calibrations and summary statistics.",
name="initial_pvi",
storageClass="ExposureF",
Expand Down Expand Up @@ -455,7 +455,7 @@ def run(self, *, exposures, result=None):
result : `lsst.pipe.base.Struct`
Results as a struct with attributes:
``output_exposure``
``exposure``
Calibrated exposure, with pixels in nJy units.
(`lsst.afw.image.Exposure`)
``stars``
Expand All @@ -479,7 +479,7 @@ def run(self, *, exposures, result=None):
(`list` [`lsst.afw.table.ReferenceMatch`] or `lsst.afw.table.BaseCatalog`)
"""
if result is None:
result = pipeBase.Struct(output_exposure=None,
result = pipeBase.Struct(exposure=None,
stars=None,
background=None,
psf_stars=None,
Expand All @@ -488,26 +488,26 @@ def run(self, *, exposures, result=None):
photometry_matches=None,
)

result.output_exposure = self._handle_snaps(exposures)
result.exposure = self._handle_snaps(exposures)

result.psf_stars, result.background, candidates = self._compute_psf(result.output_exposure)
result.psf_stars, result.background, candidates = self._compute_psf(result.exposure)

self._measure_aperture_correction(result.output_exposure, result.psf_stars)
self._measure_aperture_correction(result.exposure, result.psf_stars)

stars = self._find_stars(result.output_exposure, result.background)
stars = self._find_stars(result.exposure, result.background)
result.stars = stars

astrometry_matches, astrometry_meta = self._fit_astrometry(result.output_exposure, stars)
astrometry_matches, astrometry_meta = self._fit_astrometry(result.exposure, stars)
if self.config.optional_outputs:
result.astrometry_matches = lsst.meas.astrom.denormalizeMatches(astrometry_matches,
astrometry_meta)
result.stars, photometry_matches, \
photometry_meta, result.applied_photo_calib = self._fit_photometry(result.output_exposure,
photometry_meta, result.applied_photo_calib = self._fit_photometry(result.exposure,
result.stars)
if self.config.optional_outputs:
photometry_matches = lsst.meas.astrom.denormalizeMatches(photometry_matches, photometry_meta)

self._summarize(result.output_exposure, stars, result.background)
self._summarize(result.exposure, stars, result.background)

return result

Expand Down
8 changes: 4 additions & 4 deletions tests/test_calibrateImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _check_run(self, calibrate, result, *, photo_calib):
self.assertEqual(len(result.background), 4)

# Check that the summary statistics are reasonable.
summary = result.output_exposure.info.getSummaryStats()
summary = result.exposure.info.getSummaryStats()
self.assertFloatsAlmostEqual(summary.psfSigma, 2.0, rtol=1e-2)
self.assertFloatsAlmostEqual(summary.ra, self.sky_center.getRa().asDegrees(), rtol=1e-7)
self.assertFloatsAlmostEqual(summary.dec, self.sky_center.getDec().asDegrees(), rtol=1e-7)
Expand Down Expand Up @@ -470,7 +470,7 @@ def test_runQuantum(self):
"astrometry_ref_cat": [self.htm_id],
"photometry_ref_cat": [self.htm_id],
# outputs
"output_exposure": self.visit_id,
"exposure": self.visit_id,
"stars": self.visit_id,
"background": self.visit_id,
"psf_stars": self.visit_id,
Expand All @@ -497,7 +497,7 @@ def test_runQuantum_2_snaps(self):
"astrometry_ref_cat": [self.htm_id],
"photometry_ref_cat": [self.htm_id],
# outputs
"output_exposure": self.visit_id,
"exposure": self.visit_id,
"stars": self.visit_id,
"background": self.visit_id,
"psf_stars": self.visit_id,
Expand Down Expand Up @@ -526,7 +526,7 @@ def test_runQuantum_no_optional_outputs(self):
"astrometry_ref_cat": [self.htm_id],
"photometry_ref_cat": [self.htm_id],
# outputs
"output_exposure": self.visit_id,
"exposure": self.visit_id,
"stars": self.visit_id,
"applied_photo_calib": self.visit_id,
"background": self.visit_id,
Expand Down

0 comments on commit b385dab

Please sign in to comment.