lsst.ip.diffim
14.0-6-gf4bc96c+3
|
Image-based Psf-matching of two subsequent snaps from the same visit. More...
Public Member Functions | |
def | subtractExposures (self, templateExposure, scienceExposure, templateFwhmPix=None, scienceFwhmPix=None, candidateList=None) |
def | getFwhmPix (self, psf) |
Return the FWHM in pixels of a Psf. More... | |
def | matchExposures (self, templateExposure, scienceExposure, templateFwhmPix=None, scienceFwhmPix=None, candidateList=None, doWarping=True, convolveTemplate=True) |
Warp and PSF-match an exposure to the reference. More... | |
def | matchMaskedImages (self, templateMaskedImage, scienceMaskedImage, candidateList, templateFwhmPix=None, scienceFwhmPix=None) |
PSF-match a MaskedImage (templateMaskedImage) to a reference MaskedImage (scienceMaskedImage) More... | |
def | subtractExposures (self, templateExposure, scienceExposure, templateFwhmPix=None, scienceFwhmPix=None, candidateList=None, doWarping=True, convolveTemplate=True) |
Register, Psf-match and subtract two Exposures. More... | |
def | subtractMaskedImages (self, templateMaskedImage, scienceMaskedImage, candidateList, templateFwhmPix=None, scienceFwhmPix=None) |
Psf-match and subtract two MaskedImages. More... | |
def | getSelectSources (self, exposure, sigma=None, doSmooth=True, idFactory=None) |
Get sources to use for Psf-matching. More... | |
def | makeCandidateList (self, templateExposure, scienceExposure, kernelSize, candidateList=None) |
Make a list of acceptable KernelCandidates. More... | |
Public Attributes | |
kConfig | |
background | |
selectSchema | |
selectAlgMetadata | |
useRegularization | |
hMat | |
Static Public Attributes | |
ConfigClass = SnapPsfMatchConfig | |
Image-based Psf-matching of two subsequent snaps from the same visit.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This Task differs from ImagePsfMatchTask in that it matches two Exposures assuming that the images have been acquired very closely in time. Under this assumption, the astrometric misalignments and/or relative distortions should be within a pixel, and the Psf-shapes should be very similar. As a consequence, the default configurations for this class assume a very simple solution.
. The spatial variation in the kernel (SnapPsfMatchConfig.spatialKernelOrder) is assumed to be zero
. With no spatial variation, we turn of the spatial clipping loops (SnapPsfMatchConfig.spatialKernelClipping)
. The differential background is not fit for (SnapPsfMatchConfig.fitForBackground)
. The kernel is expected to be appx. a delta function, and has a small size (SnapPsfMatchConfig.kernelSize)
The sub-configurations for the Alard-Lupton (SnapPsfMatchConfigAL) and delta-function (SnapPsfMatchConfigDF) bases also are designed to generate a small, simple kernel.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Initialization is the same as base class ImagePsfMatch.__init__, with the difference being that the Task's ConfigClass is SnapPsfMatchConfig.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The Task is only configured to have a subtractExposures method, which in turn calls ImagePsfMatchTask.subtractExposures.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
See SnapPsfMatchConfig, which uses either SnapPsfMatchConfigDF and SnapPsfMatchConfigAL as its active configuration.
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
See PsfMatchTask
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The command line task interface supports a flag -d/–debug
to import debug.py from your PYTHONPATH
. The relevant contents of debug.py for this Task include:
Note that if you want addional logging info, you may add to your scripts:
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This code is snapPsfMatchTask.py in the examples directory, and can be run as e.g.
And allow the user the freedom to either run the script in default mode, or point to their own images on disk. Note that these images must be readable as an lsst.afw.image.Exposure:
We have enabled some minor display debugging in this script via the –debug option. However, if you have an lsstDebug debug.py in your PYTHONPATH you will get additional debugging displays. The following block checks for this script:
Make sure the images (if any) that were sent to the script exist on disk and are readable. If no images are sent, make some fake data up for the sake of this example script (have a look at the code if you want more details on generateFakeImages; as a detail of how the fake images were made, you do have to fit for a differential background):
Display the two images if –debug:
Create and run the Task:
And finally provide optional debugging display of the Psf-matched (via the Psf models) science image:
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Definition at line 95 of file snapPsfMatch.py.
|
inherited |
Return the FWHM in pixels of a Psf.
Definition at line 296 of file imagePsfMatch.py.
|
inherited |
Get sources to use for Psf-matching.
This method runs detection and measurement on an exposure. The returned set of sources will be used as candidates for Psf-matching.
exposure | Exposure on which to run detection/measurement |
sigma | Detection threshold |
doSmooth | Whether or not to smooth the Exposure with Psf before detection |
idFactory | Factory for the generation of Source ids |
Definition at line 620 of file imagePsfMatch.py.
|
inherited |
Make a list of acceptable KernelCandidates.
Accept or generate a list of candidate sources for Psf-matching, and examine the Mask planes in both of the images for indications of bad pixels
templateExposure | Exposure that will be convolved |
scienceExposure | Exposure that will be matched-to |
kernelSize | Dimensions of the Psf-matching Kernel, used to grow detection footprints |
candidateList | List of Sources to examine. Elements must be of type afw.table.Source or a type that wraps a Source and has a getSource() method, such as meas.algorithms.PsfCandidateF. |
Definition at line 668 of file imagePsfMatch.py.
|
inherited |
Warp and PSF-match an exposure to the reference.
Do the following, in order:
templateExposure | Exposure to warp and PSF-match to the reference masked image |
scienceExposure | Exposure whose WCS and PSF are to be matched to |
templateFwhmPix | FWHM (in pixels) of the Psf in the template image (image to convolve) |
scienceFwhmPix | FWHM (in pixels) of the Psf in the science image |
candidateList | a list of footprints/maskedImages for kernel candidates; if None then source detection is run.
|
doWarping | what to do if templateExposure's and scienceExposure's WCSs do not match:
|
convolveTemplate | convolve the template image or the science image
|
Raise a RuntimeError if doWarping is False and templateExposure's and scienceExposure's WCSs do not match
Definition at line 304 of file imagePsfMatch.py.
|
inherited |
PSF-match a MaskedImage (templateMaskedImage) to a reference MaskedImage (scienceMaskedImage)
Do the following, in order:
templateMaskedImage | masked image to PSF-match to the reference masked image; must be warped to match the reference masked image |
scienceMaskedImage | maskedImage whose PSF is to be matched to |
templateFwhmPix | FWHM (in pixels) of the Psf in the template image (image to convolve) |
scienceFwhmPix | FWHM (in pixels) of the Psf in the science image |
candidateList | a list of footprints/maskedImages for kernel candidates; if None then source detection is run.
|
Raise a RuntimeError if input images have different dimensions
Definition at line 388 of file imagePsfMatch.py.
def lsst.ip.diffim.snapPsfMatch.SnapPsfMatchTask.subtractExposures | ( | self, | |
templateExposure, | |||
scienceExposure, | |||
templateFwhmPix = None , |
|||
scienceFwhmPix = None , |
|||
candidateList = None |
|||
) |
Definition at line 265 of file snapPsfMatch.py.
|
inherited |
Register, Psf-match and subtract two Exposures.
Do the following, in order:
templateExposure | exposure to PSF-match to scienceExposure |
scienceExposure | reference Exposure |
templateFwhmPix | FWHM (in pixels) of the Psf in the template image (image to convolve) |
scienceFwhmPix | FWHM (in pixels) of the Psf in the science image |
candidateList | a list of footprints/maskedImages for kernel candidates; if None then source detection is run.
|
doWarping | what to do if templateExposure's and scienceExposure's WCSs do not match:
|
convolveTemplate | convolve the template image or the science image
|
Definition at line 483 of file imagePsfMatch.py.
|
inherited |
Psf-match and subtract two MaskedImages.
Do the following, in order:
templateMaskedImage | MaskedImage to PSF-match to scienceMaskedImage |
scienceMaskedImage | reference MaskedImage |
templateFwhmPix | FWHM (in pixels) of the Psf in the template image (image to convolve) |
scienceFwhmPix | FWHM (in pixels) of the Psf in the science image |
candidateList | a list of footprints/maskedImages for kernel candidates; if None then source detection is run.
|
Definition at line 566 of file imagePsfMatch.py.
|
inherited |
Definition at line 289 of file imagePsfMatch.py.
|
static |
Definition at line 260 of file snapPsfMatch.py.
|
inherited |
Definition at line 701 of file psfMatch.py.
|
inherited |
Definition at line 285 of file imagePsfMatch.py.
|
inherited |
Definition at line 292 of file imagePsfMatch.py.
|
inherited |
Definition at line 291 of file imagePsfMatch.py.
|
inherited |
Definition at line 696 of file psfMatch.py.