Skip to content

Commit

Permalink
Switch to calibrateImage outputs by default
Browse files Browse the repository at this point in the history
The "calexp" name is being phased out everywhere: replace it with a
more appropriate term in packageAlerts and docs.
  • Loading branch information
parejkoj committed Sep 17, 2024
1 parent 110d1c6 commit aa43a7c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions python/lsst/ap/association/diaForcedSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ def _calibrate_and_merge(self,
diff_sources : `lsst.afw.table.SourceTable`
Catalog with PsFluxes measured on the difference image.
direct_sources : `lsst.afw.table.SourceTable`
Catalog with PsfFluxes measured on the direct (calexp) image.
Catalog with PsfFluxes measured on the direct (science) image.
diff_exp : `lsst.afw.image.Exposure`
Difference exposure ``diff_sources`` were measured on.
direct_exp : `lsst.afw.image.Exposure`
Direct (calexp) exposure ``direct_sources`` were measured on.
Direct (science) exposure ``direct_sources`` were measured on.
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ap/association/diaPipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class DiaPipelineConnections(
exposure = connTypes.Input(
doc="Calibrated exposure differenced with a template image during "
"image differencing.",
name="{fakesType}calexp",
name="{fakesType}initial_pvi",
storageClass="ExposureF",
dimensions=("instrument", "visit", "detector"),
)
Expand Down
26 changes: 13 additions & 13 deletions python/lsst/ap/association/packageAlerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def run(self,
diaSrcHistory,
diaForcedSources,
diffIm,
calexp,
science,
template,
doRunForcedMeasurement=True,
):
Expand Down Expand Up @@ -237,7 +237,7 @@ def run(self,
``["diaObjectId"]``
diffIm : `lsst.afw.image.ExposureF`
Difference image the sources in ``diaSourceCat`` were detected in.
calexp : `lsst.afw.image.ExposureF`
science : `lsst.afw.image.ExposureF`
Calexp used to create the ``diffIm``.
template : `lsst.afw.image.ExposureF` or `None`
Template image used to create the ``diffIm``.
Expand All @@ -253,10 +253,10 @@ def run(self,
detector = diffIm.detector.getId()
visit = diffIm.visitInfo.id
diffImPhotoCalib = diffIm.getPhotoCalib()
calexpPhotoCalib = calexp.getPhotoCalib()
sciencePhotoCalib = science.getPhotoCalib()
templatePhotoCalib = template.getPhotoCalib()
diffImPsf = self._computePsf(diffIm, diffIm.psf.getAveragePosition())
sciencePsf = self._computePsf(calexp, calexp.psf.getAveragePosition())
sciencePsf = self._computePsf(science, science.psf.getAveragePosition())
templatePsf = self._computePsf(template, template.psf.getAveragePosition())

n_sources = len(diaSourceCat)
Expand Down Expand Up @@ -296,12 +296,12 @@ def run(self,
diffImPhotoCalib,
diaSource["diaSourceId"],
averagePsf=diffImPsf)
calexpCutout = self.createCcdDataCutout(
calexp,
scienceCutout = self.createCcdDataCutout(
science,
sphPoint,
pixelPoint,
cutoutExtent,
calexpPhotoCalib,
sciencePhotoCalib,
diaSource["diaSourceId"],
averagePsf=sciencePsf)
templateCutout = self.createCcdDataCutout(
Expand All @@ -322,7 +322,7 @@ def run(self,
objSourceHistory,
objDiaForcedSources,
diffImCutout,
calexpCutout,
scienceCutout,
templateCutout))

if self.config.doProduceAlerts:
Expand Down Expand Up @@ -524,7 +524,7 @@ def makeAlertDict(self,
objDiaSrcHistory,
objDiaForcedSources,
diffImCutout,
calexpCutout,
scienceCutout,
templateCutout):
"""Convert data and package into a dictionary alert.
Expand All @@ -541,8 +541,8 @@ def makeAlertDict(self,
diffImCutout : `astropy.nddata.CCDData` or `None`
Cutout of the difference image around the location of ``diaSource``
with a min size set by the ``cutoutSize`` configurable.
calexpCutout : `astropy.nddata.CCDData` or `None`
Cutout of the calexp around the location of ``diaSource``
scienceCutout : `astropy.nddata.CCDData` or `None`
Cutout of the science image around the location of ``diaSource``
with a min size set by the ``cutoutSize`` configurable.
templateCutout : `astropy.nddata.CCDData` or `None`
Cutout of the template image around the location of ``diaSource``
Expand Down Expand Up @@ -572,10 +572,10 @@ def makeAlertDict(self,
else:
alert['cutoutDifference'] = self.streamCcdDataToBytes(diffImCutout)

if calexpCutout is None:
if scienceCutout is None:
alert['cutoutScience'] = None
else:
alert['cutoutScience'] = self.streamCcdDataToBytes(calexpCutout)
alert['cutoutScience'] = self.streamCcdDataToBytes(scienceCutout)

if templateCutout is None:
alert["cutoutTemplate"] = None
Expand Down
2 changes: 1 addition & 1 deletion tests/test_diaForcedSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def setUp(self):

self.testDiaObjects = create_test_dia_objects(5, self.wcs)
# Add additional diaObjects that are outside of the above difference
# and calexp visit images.
# and science visit images.
objects = [
(10000000, self.wcs.pixelToSky(-100000, -100000)), # xy outside
(10000001, self.wcs.pixelToSky(100, -100000)), # y outside
Expand Down

0 comments on commit aa43a7c

Please sign in to comment.