|
def | showSourceSet (sSet, xy0=(0, 0), frame=0, ctype=afwDisplay.GREEN, symb="+", size=2) |
|
def | showKernelSpatialCells (maskedIm, kernelCellSet, showChi2=False, symb="o", ctype=None, ctypeUnused=None, ctypeBad=None, size=3, frame=None, title="Spatial Cells") |
|
def | showDiaSources (sources, exposure, isFlagged, isDipole, frame=None) |
|
def | showKernelCandidates (kernelCellSet, kernel, background, frame=None, showBadCandidates=True, resids=False, kernels=False) |
|
def | showKernelBasis (kernel, frame=None) |
|
def | plotKernelSpatialModel (kernel, kernelCellSet, showBadCandidates=True, numSample=128, keepPlots=True, maxCoeff=10) |
|
def | plotKernelCoefficients (spatialKernel, kernelCellSet, showBadCandidates=False, keepPlots=True) |
|
def | showKernelMosaic (bbox, kernel, nx=7, ny=None, frame=None, title=None, showCenter=True, showEllipticity=True) |
|
def | plotPixelResiduals (exposure, warpedTemplateExposure, diffExposure, kernelCellSet, kernel, background, testSources, config, origVariance=False, nptsFull=1e6, keepPlots=True, titleFs=14) |
|
def | calcCentroid (arr) |
|
def | calcWidth (arr, centx, centy) |
|
def | printSkyDiffs (sources, wcs) |
|
def | makeRegions (sources, outfilename, wcs=None) |
|
def | showSourceSetSky (sSet, wcs, xy0, frame=0, ctype=afwDisplay.GREEN, symb="+", size=2) |
|
def | plotWhisker (results, newWcs) |
|
def | getPsfFwhm (psf, average=True) |
|
def | detectTestSources (exposure) |
|
def | makeFakeWcs () |
|
def | makeTestImage (seed=5, nSrc=20, psfSize=2., noiseLevel=5., noiseSeed=6, fluxLevel=500., fluxRange=2., kernelSize=32, templateBorderSize=0, background=None, xSize=256, ySize=256, x0=12345, y0=67890, calibration=1., doApplyCalibration=False) |
|
def | makeStats (badMaskPlanes=None) |
|
def | computeRobustStatistics (image, mask, statsCtrl, statistic=afwMath.MEANCLIP) |
|
def | computePSFNoiseEquivalentArea (psf) |
|
def lsst.ip.diffim.utils.makeTestImage |
( |
|
seed = 5 , |
|
|
|
nSrc = 20 , |
|
|
|
psfSize = 2. , |
|
|
|
noiseLevel = 5. , |
|
|
|
noiseSeed = 6 , |
|
|
|
fluxLevel = 500. , |
|
|
|
fluxRange = 2. , |
|
|
|
kernelSize = 32 , |
|
|
|
templateBorderSize = 0 , |
|
|
|
background = None , |
|
|
|
xSize = 256 , |
|
|
|
ySize = 256 , |
|
|
|
x0 = 12345 , |
|
|
|
y0 = 67890 , |
|
|
|
calibration = 1. , |
|
|
|
doApplyCalibration = False |
|
) |
| |
Make a reproduceable PSF-convolved exposure for testing.
Parameters
----------
seed : `int`, optional
Seed value to initialize the random number generator for sources.
nSrc : `int`, optional
Number of sources to simulate.
psfSize : `float`, optional
Width of the PSF of the simulated sources, in pixels.
noiseLevel : `float`, optional
Standard deviation of the noise to add to each pixel.
noiseSeed : `int`, optional
Seed value to initialize the random number generator for noise.
fluxLevel : `float`, optional
Reference flux of the simulated sources.
fluxRange : `float`, optional
Range in flux amplitude of the simulated sources.
kernelSize : `int`, optional
Size in pixels of the kernel for simulating sources.
templateBorderSize : `int`, optional
Size in pixels of the image border used to pad the image.
background : `lsst.afw.math.Chebyshev1Function2D`, optional
Optional background to add to the output image.
xSize, ySize : `int`, optional
Size in pixels of the simulated image.
x0, y0 : `int`, optional
Origin of the image.
calibration : `float`, optional
Conversion factor between instFlux and nJy.
doApplyCalibration : `bool`, optional
Apply the photometric calibration and return the image in nJy?
Returns
-------
modelExposure : `lsst.afw.image.Exposure`
The model image, with the mask and variance planes.
sourceCat : `lsst.afw.table.SourceCatalog`
Catalog of sources detected on the model image.
Definition at line 1157 of file utils.py.
def lsst.ip.diffim.utils.plotKernelCoefficients |
( |
|
spatialKernel, |
|
|
|
kernelCellSet, |
|
|
|
showBadCandidates = False , |
|
|
|
keepPlots = True |
|
) |
| |
Plot the individual kernel candidate and the spatial kernel solution coefficients.
Parameters
----------
spatialKernel : `lsst.afw.math.LinearCombinationKernel`
The spatial spatialKernel solution model which is a spatially varying linear combination
of the spatialKernel basis functions.
Typically returned by `lsst.ip.diffim.SpatialKernelSolution.getSolutionPair()`.
kernelCellSet : `lsst.afw.math.SpatialCellSet`
The spatial cells that was used for solution for the spatialKernel. They contain the
local solutions of the AL kernel for the selected sources.
showBadCandidates : `bool`, optional
If True, plot the coefficient values for kernel candidates where the solution was marked
bad by the numerical algorithm. Defaults to False.
keepPlots: `bool`, optional
If True, sets ``plt.show()`` to be called before the task terminates, so that the plots
can be explored interactively. Defaults to True.
Notes
-----
This function produces 3 figures per image subtraction operation.
* A grid plot of the local solutions. Each grid cell corresponds to a proportional area in
the image. In each cell, local kernel solution coefficients are plotted of kernel candidates (color)
that fall into this area as a function of the kernel basis function number.
* A grid plot of the spatial solution. Each grid cell corresponds to a proportional area in
the image. In each cell, the spatial solution coefficients are evaluated for the center of the cell.
* Histogram of the local solution coefficients. Red line marks the spatial solution value at
center of the image.
This function is called if ``lsst.ip.diffim.psfMatch.plotKernelCoefficients==True`` in lsstDebug. This
function was implemented as part of DM-17825.
Definition at line 428 of file utils.py.