LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Classes | |
class | NbasisEvaluator |
Functions | |
def | makeFlatNoiseImage (mi, seedStat=afwMath.MAX) |
Add noise. More... | |
def | makePoissonNoiseImage (im) |
def | fakeCoeffs () |
Make fake images for testing; one is a delta function (or narrow gaussian) and the other is a convolution of this with a spatially varying kernel. More... | |
def | makeFakeKernelSet (sizeCell=128, nCell=3, deltaFunctionCounts=1.e4, tGaussianWidth=1.0, addNoise=True, bgValue=100., display=False) |
def | backgroundSubtract (config, maskedImages) |
Background subtraction for ip_diffim. More... | |
def | writeKernelCellSet (kernelCellSet, psfMatchingKernel, backgroundModel, outdir) |
More coarse debugging. More... | |
def | sourceToFootprintList (candidateInList, templateExposure, scienceExposure, kernelSize, config, log) |
Converting types. More... | |
def | sourceTableToCandidateList (sourceTable, templateExposure, scienceExposure, kConfig, dConfig, log, basisList, doBuild=False) |
def lsst.ip.diffim.diffimTools.backgroundSubtract | ( | config, | |
maskedImages | |||
) |
Background subtraction for ip_diffim.
Subtract the background from masked images. Parameters ---------- config : TODO: DM-17458 TODO: DM-17458 maskedImages : `list` of `lsst.afw.image.MaskedImage` TODO: DM-17458 Returns ------- TODO: DM-17458 TODO: DM-17458
Definition at line 293 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.fakeCoeffs | ( | ) |
Make fake images for testing; one is a delta function (or narrow gaussian) and the other is a convolution of this with a spatially varying kernel.
Definition at line 99 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.makeFakeKernelSet | ( | sizeCell = 128 , |
|
nCell = 3 , |
|||
deltaFunctionCounts = 1.e4 , |
|||
tGaussianWidth = 1.0 , |
|||
addNoise = True , |
|||
bgValue = 100. , |
|||
display = False |
|||
) |
Generate test template and science images with sources. Parameters ---------- sizeCell : `int`, optional Size of the square spatial cells in pixels. nCell : `int`, optional Number of adjacent spatial cells in both direction in both images. deltaFunctionCounts : `float`, optional Flux value for the template image sources. tGaussianWidth : `float`, optional Sigma of the generated Gaussian PSF sources in the template image. addNoise : `bool`, optional If `True`, Poisson noise is added to both the generated template and science images. bgValue : `float`, optional Background level to be added to the generated science image. display : `bool`, optional If `True` displays the generated template and science images by `lsst.afw.display.Display`. Notes ----- - The generated images consist of adjacent ``nCell x nCell`` cells, each of pixel size ``sizeCell x sizeCell``. - The sources in the science image are generated by convolving the template by ``sKernel``. ``sKernel`` is a spatial `LinearCombinationKernel` of hard wired kernel bases functions. The linear combination has first order polynomial spatial dependence with polynomial parameters from ``fakeCoeffs()``. - The template image sources are generated in the center of each spatial cell from one pixel, set to `deltaFunctionCounts` counts, then convolved by a 2D Gaussian with sigma of `tGaussianWidth` along each axis. - The sources are also returned in ``kernelCellSet`` each source is "detected" exactly at the center of a cell. Returns ------- tMi : `lsst.afw.image.MaskedImage` Generated template image. sMi : `lsst.afw.image.MaskedImage` Generated science image. sKernel : `lsst.afw.math.LinearCombinationKernel` The spatial kernel used to generate the sources in the science image. kernelCellSet : `lsst.afw.math.SpatialCellSet` Cell grid of `lsst.afw.math.SpatialCell` instances, containing `lsst.ip.diffim.KernelCandidate` instances around all the generated sources in the science image. configFake : `lsst.ip.diffim.ImagePsfMatchConfig` Config instance used in the image generation.
Definition at line 109 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.makeFlatNoiseImage | ( | mi, | |
seedStat = afwMath.MAX |
|||
) |
Add noise.
Definition at line 52 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.makePoissonNoiseImage | ( | im | ) |
Return a Poisson noise image based on im Parameters ---------- im : `lsst.afw.image.Image` image; the output image has the same dtype, dimensions, and shape and its expectation value is the value of ``im`` at each pixel Returns ------- noiseIm : `lsst.afw.image.Image` Newly constructed image instance, same type as ``im``. Notes ----- - Warning: This uses an undocumented numpy API (the documented API uses a single float expectation value instead of an array). - Uses numpy.random; you may wish to call numpy.random.seed first.
Definition at line 61 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.sourceTableToCandidateList | ( | sourceTable, | |
templateExposure, | |||
scienceExposure, | |||
kConfig, | |||
dConfig, | |||
log, | |||
basisList, | |||
doBuild = False |
|||
) |
Convert a list of Sources into KernelCandidates. The KernelCandidates are used for fitting the Psf-matching kernel. Parameters ---------- sourceTable : TODO: DM-17458 TODO: DM-17458 templateExposure : TODO: DM-17458 TODO: DM-17458 scienceExposure : TODO: DM-17458 TODO: DM-17458 kConfig : TODO: DM-17458 TODO: DM-17458 dConfig : TODO: DM-17458 TODO: DM-17458 log : TODO: DM-17458 TODO: DM-17458 basisList : TODO: DM-17458 TODO: DM-17458 doBuild : `bool`, optional TODO: DM-17458 Returns ------- TODO: DM-17458 TODO: DM-17458
Definition at line 476 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.sourceToFootprintList | ( | candidateInList, | |
templateExposure, | |||
scienceExposure, | |||
kernelSize, | |||
config, | |||
log | |||
) |
Converting types.
Convert a list of sources for the PSF-matching Kernel to Footprints. Parameters ---------- candidateInList : TODO: DM-17458 Input list of Sources templateExposure : TODO: DM-17458 Template image, to be checked for Mask bits in Source Footprint scienceExposure : TODO: DM-17458 Science image, to be checked for Mask bits in Source Footprint kernelSize : TODO: DM-17458 TODO: DM-17458 config : TODO: DM-17458 Config that defines the Mask planes that indicate an invalid Source and Bbox grow radius log : TODO: DM-17458 Log for output Returns ------- candidateOutList : `list` a list of dicts having a "source" and "footprint" field, to be used for Psf-matching Raises ------ RuntimeError TODO: DM-17458 Notes ----- Takes an input list of Sources that were selected to constrain the Psf-matching Kernel and turns them into a List of Footprints, which are used to seed a set of KernelCandidates. The function checks both the template and science image for masked pixels, rejecting the Source if certain Mask bits (defined in config) are set within the Footprint.
Definition at line 376 of file diffimTools.py.
def lsst.ip.diffim.diffimTools.writeKernelCellSet | ( | kernelCellSet, | |
psfMatchingKernel, | |||
backgroundModel, | |||
outdir | |||
) |
More coarse debugging.
TODO: DM-17458 Parameters ---------- kernelCellSet : TODO: DM-17458 TODO: DM-17458 psfMatchingKernel : TODO: DM-17458 TODO: DM-17458 backgroundModel : TODO: DM-17458 TODO: DM-17458 outdir : TODO: DM-17458 TODO: DM-17458
Definition at line 335 of file diffimTools.py.