MakeWarpTask

Warp and optionally PSF-Match calexps onto a common projection by performing the following operations:

  • Group calexps by visit/run

  • For each visit, generate a Warp by calling method @ref run.

run loops over the visit’s calexps calling. WarpAndPsfMatchTask on each visit.

WarpType identifies the types of convolutions applied to Warps (previously CoaddTempExps). Only two types are available: direct (for regular Warps/Coadds) and psfMatched (for Warps/Coadds with homogenized PSFs). We expect to add a third type, likelihood, for generating likelihood Coadds with Warps that have been correlated with their own PSF.

To make psfMatchedWarps, select config.makePsfMatched=True. The subtask ModelPsfMatchTask is responsible for the PSF-Matching, and its config is accessed via config.warpAndPsfMatch.psfMatch.

The optimal configuration depends on aspects of dataset: the pixel scale, average PSF FWHM and dimensions of the PSF kernel. These configs include the requested model PSF, the matching kernel size, padding of the science PSF thumbnail and spatial sampling frequency of the PSF.

Processing summary

ToDo

Python API summary

from lsst.pipe.tasks.makeWarp import MakeWarpTask
classMakeWarpTask(**kwargs)

Warp and optionally PSF-Match calexps onto an a common projection...

attributeconfig

Access configuration fields and retargetable subtasks.

methodrun(calExpList, ccdIdList, skyInfo, visitId=0, dataIdList=None, **kwargs)

Create a Warp from inputs...

See also

See the MakeWarpTask API reference for complete details.

Retargetable subtasks

inputRecorder

Default

lsst.pipe.tasks.coaddInputRecorder.CoaddInputRecorderTask

Field type

ConfigurableField

Subtask that helps fill CoaddInputs catalogs added to the final Exposure

modelPsf

Default

lsst.meas.algorithms.gaussianPsfFactory.applyWrapper

Field type

ConfigurableField

Model Psf factory

select

Default

lsst.pipe.tasks.selectImages.PsfWcsSelectImagesTask

Field type

ConfigurableField

Image selection subtask.

warpAndPsfMatch

Default

lsst.pipe.tasks.warpAndPsfMatch.WarpAndPsfMatchTask

Field type

ConfigurableField

Task to warp and PSF-match calexp

Configuration fields

badMaskPlanes

Default
('NO_DATA',)
Field type

str ListField

Mask planes that, if set, the associated pixel should not be included in the coaddTempExp.

bgSubtracted

Default
True
Field type

bool Field

Work with a background subtracted calexp?

coaddName

Default
'deep'
Field type

str Field

Coadd name: typically one of deep or goodSeeing.

coaddPsf

Data type

lsst.meas.algorithms.CoaddPsfConfig

Field type

ConfigField

Configuration for CoaddPsf

connections

Data type

lsst.pipe.base.config.MakeWarpConfigConnections

Field type

ConfigField

Configurations describing the connections of the PipelineTask to datatypes

doApplyExternalPhotoCalib

Default
False
Field type

bool Field

Whether to apply external photometric calibration via an lsst.afw.image.PhotoCalib object. Uses the externalPhotoCalibName field to determine which calibration to load. Deprecated: Deprecated in favor of the ‘visitSummary’ connection. Will be removed after v26.

doApplyExternalSkyWcs

Default
False
Field type

bool Field

Whether to apply external astrometric calibration via an lsst.afw.geom.SkyWcs object. Uses externalSkyWcsName field to determine which calibration to load. Deprecated: Deprecated in favor of the ‘visitSummary’ connection. Will be removed after v26.

doApplyFinalizedPsf

Default
True
Field type

bool Field

Whether to apply finalized psf models and aperture correction map. Deprecated: Deprecated in favor of useVisitSummaryPsf. Will be removed after v26.

doApplySkyCorr

Default
False
Field type

bool Field

Apply sky correction?

doPsfMatch

Default
False
Field type

bool Field

Match to modelPsf? Sets makePsfMatched=True, makeDirect=False Deprecated: This field is no longer used. Will be removed after v26.

doWrite

Default
True
Field type

bool Field

persist <coaddName>Coadd_<warpType>Warp

doWriteEmptyWarps

Default
False
Field type

bool Field

Write out warps even if they are empty

hasFakes

Default
False
Field type

bool Field

Should be set to True if fake sources have been inserted into the input data.

idGenerator

Data type

lsst.meas.base._id_generator.DetectorVisitIdGeneratorConfig

Field type

ConfigField

Configuration for how to generate catalog IDs from data IDs.

includeCalibVar

Default
False
Field type

bool Field

Add photometric calibration variance to warp variance plane.

makeDirect

Default
True
Field type

bool Field

Make direct Warp/Coadds

makePsfMatched

Default
False
Field type

bool Field

Make Psf-Matched Warp/Coadd?

matchingKernelSize

Default
21
Field type

int Field

Size in pixels of matching kernel. Must be odd.

saveLogOutput

Default
True
Field type

bool Field

Flag to enable/disable saving of log output for a task, enabled by default.

saveMetadata

Default
True
Field type

bool Field

Flag to enable/disable metadata saving for a task, enabled by default. Deprecated: This field is deprecated and will be removed after v26.

useGlobalExternalPhotoCalib

Default
False
Field type

bool Field

When using doApplyExternalPhotoCalib, use ‘global’ calibrations that are not run per-tract. When False, use per-tract photometric calibration files. Deprecated: Deprecated in favor of the ‘visitSummary’ connection. Will be removed after v26.

useGlobalExternalSkyWcs

Default
False
Field type

bool Field

When using doApplyExternalSkyWcs, use ‘global’ calibrations that are not run per-tract. When False, use per-tract wcs files. Deprecated: Deprecated in favor of the ‘visitSummary’ connection. Will be removed after v26.

useVisitSummaryPsf

Default
True
Field type

bool Field

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. The finalizedPsfApCorrCatalog connection (if enabled) takes precedence over either.

In Depth

Config Guidelines

The user must specify the size of the model PSF to which to match by setting config.modelPsf.defaultFwhm in units of pixels. The appropriate values depends on science case. In general, for a set of input images, this config should equal the FWHM of the visit with the worst seeing. The smallest it should be set to is the median FWHM. The defaults of the other config options offer a reasonable starting point.

The following list presents the most common problems that arise from a misconfigured ModelPsfMatchTask and corresponding solutions. All assume the default Alard-Lupton kernel, with configs accessed via config.warpAndPsfMatch.psfMatch.kernel['AL']. Each item in the list is formatted as: Problem: Explanation. Solution

Troublshooting PSF-Matching Configuration

Matched PSFs look boxy

The matching kernel is too small.

Solution

Increase the matching kernel size. For example:

config.warpAndPsfMatch.psfMatch.kernel['AL'].kernelSize=27
# default 21

Note that increasing the kernel size also increases runtime.

Matched PSFs look ugly (dipoles, quadropoles, donuts)

Unable to find good solution for matching kernel.

Solution

Provide the matcher with more data by either increasing the spatial sampling by decreasing the spatial cell size.

config.warpAndPsfMatch.psfMatch.kernel['AL'].sizeCellX = 64
# default 128
config.warpAndPsfMatch.psfMatch.kernel['AL'].sizeCellY = 64
# default 128
  • or increasing the padding around the Science PSF, for example:

config.warpAndPsfMatch.psfMatch.autoPadPsfTo=1.6  # default 1.4

Increasing autoPadPsfTo increases the minimum ratio of input PSF dimensions to the matching kernel dimensions, thus increasing the number of pixels available to fit after convolving the PSF with the matching kernel. Optionally, for debugging the effects of padding, the level of padding may be manually controlled by setting turning off the automatic padding and setting the number of pixels by which to pad the PSF:

config.warpAndPsfMatch.psfMatch.doAutoPadPsf = False
# default True
config.warpAndPsfMatch.psfMatch.padPsfBy = 6
# pixels. default 0

Ripple Noise Pattern

Matching a large PSF to a smaller PSF produces a telltale noise pattern which looks like ripples or a brain.

Solution

Increase the size of the requested model PSF. For example:

config.modelPsf.defaultFwhm = 11  # Gaussian sigma in units of pixels.

High frequency (sometimes checkered) noise

The matching basis functions are too small.

Solution

Increase the width of the Gaussian basis functions. For example:

config.warpAndPsfMatch.psfMatch.kernel['AL'].alardSigGauss=
[1.5, 3.0, 6.0]  # from default [0.7, 1.5, 3.0]