CutOutDonutsBaseTask#

class lsst.ts.wep.task.CutOutDonutsBaseTask(**kwargs)#

Bases: PipelineTask

Base class for CutOutDonuts tasks.

Subclasses must implement _DefaultName.

Parameters:

kwargs (Any)

Methods Summary

addVisitLevelMetadata(exposure, ...)

Get visit level metadata and save in the donutStamps object.

calculateFinalCentroids(exposure, template, ...)

Recentroid donuts from catalog values by convolving with template.

calculateSN(stamp)

Calculate signal-to-noise ratio.

cutOutStamps(exposure, donutCatalog, ...)

Cut out postage stamps for sources in catalog.

filterBadRecentering(xShifts, yShifts)

Filter out donuts that are recentered far away from the median shift of all donuts.

shiftCenters(centerArr, boundary, distance)

Shift the centers of sources if the distance to boundary is less than required.

Methods Documentation

addVisitLevelMetadata(exposure, inputDonutStamps, donutCatalog, defocalType)#

Get visit level metadata and save in the donutStamps object.

Parameters:
  • exposure (lsst.afw.image.Exposure) – Exposure to get metadata from.

  • inputDonutStamps (DonutStamps) – DonutStamps object to save metadata in.

  • donutCatalog (astropy.table.QTable) – Source catalog for the pointing.

  • defocalType (enum 'DefocalType') – Defocal type of the donut image.

Returns:

DonutStamps object with metadata added.

Return type:

DonutStamps

calculateFinalCentroids(exposure, template, xCenters, yCenters)#

Recentroid donuts from catalog values by convolving with template. Also return the appropriate corner values for the final donutStamps taking into account donuts possibly being near the edges of the exposure and compensating appropriately.

Parameters:
  • exposure (lsst.afw.image.Exposure) – Exposure with the donut image.

  • template (numpy.ndarray) – Donut template for the exposure.

  • xCenters (np.ndarray) – X pixel donut centers from donutCatalog.

  • yCenters (np.ndarray) – Y pixel donut centers from donutCatalog.

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray]

Returns:

  • np.ndarray – Final donut x centroid pixel positions on exposure.

  • np.ndarray – Final donut y centroid pixel positions on exposure.

  • np.ndarray – Final x corner positions on exposure for donutStamp BBox.

  • np.ndarray – Final y corner positions on exposure for donutStamp BBox.

  • np.ndarray – Original x corner positions.

  • np.ndarray – Original y corner positions.

  • float – The height of the max point in the convolved image.

calculateSN(stamp)#

Calculate signal-to-noise ratio.

Parameters:

stamp (lsst.ts.wep.task.donutStamp) – A stamp containing donut image.

Returns:

A dictionary of calculated quantities

Return type:

dict

cutOutStamps(exposure, donutCatalog, defocalType, cameraName)#

Cut out postage stamps for sources in catalog.

Parameters:
  • exposure (lsst.afw.image.Exposure) – Post-ISR image with defocal donuts sources.

  • donutCatalog (astropy.table.QTable) – Source catalog for the pointing.

  • defocalType (enum 'DefocalType') – Defocal type of the donut image.

  • cameraName (str) – Name of camera for the exposure. Can accept “LSSTCam”, “LSSTComCam”, “LATISS”.

Returns:

Collection of postage stamps as lsst.afw.image.MaskedImage with additional metadata.

Return type:

DonutStamps

filterBadRecentering(xShifts, yShifts)#

Filter out donuts that are recentered far away from the median shift of all donuts. The median is subtracted to account for a constant shift due to any constant offsets from the WCS used to calculate the pixel positions.

Parameters:
  • xShifts (np.ndarray) – Shifts of all donut sources in the x-direction in units of pixels.

  • yShifts (np.ndarray) – Shifts of all donut sources in the y-direction in units of pixels.

Returns:

Indices where total shift after median subtraction is more than the value allowed by self.maxRecenterDistance

Return type:

np.ndarray

shiftCenters(centerArr, boundary, distance)#

Shift the centers of sources if the distance to boundary is less than required.

Parameters:
  • centerArr (np.ndarray) – Center points.

  • boundary (float) – Boundary point.

  • distance (float) – Required distance.

Returns:

Shifted center points.

Return type:

np.ndarray