|
LSST Applications g011c388f00+f985364e28,g0265f82a02+cefac37fe7,g16a3bce237+cefac37fe7,g2079a07aa2+b9108c1c87,g2bbee38e9b+cefac37fe7,g337abbeb29+cefac37fe7,g3ddfee87b4+425a3f5e02,g4cf46543a9+2ef32aa566,g50ff169b8f+8309cf5058,g52b1c1532d+43dac7135f,g5d89126706+46afc7f72d,g83996f0134+2fb8039c37,g858d7b2824+59f22cc8bb,g87e100324b+59f22cc8bb,g8a8a8dda67+43dac7135f,g99855d9996+1ea0a8cf94,g9d147d8712+4559cd7206,g9ddcbc5298+389b8f2b7e,ga1e77700b3+4bafba478f,ga8c6da7877+1b58c58f75,gae46bcf261+cefac37fe7,gb700894bec+f0b514b300,gb8350603e9+4979c46fed,gba4ed39666+fb465f0d3e,gbeb006f7da+bf3b4a8997,gc86a011abf+59f22cc8bb,gcf0d15dbbd+425a3f5e02,gd162630629+d0c22ff203,gd44f2fa1a7+91fd017016,gdaeeff99f8+6b435c3f92,ge79ae78c31+cefac37fe7,ge9008a0c34+425a3f5e02,gee10cc3b42+43dac7135f,gf041782ebf+713927f999,gf1cff7945b+59f22cc8bb,w.2024.07
LSST Data Management Base Package
|
Classes | |
| class | NbasisEvaluator |
Functions | |
| makeFlatNoiseImage (mi, seedStat=afwMath.MAX) | |
| Add noise. | |
| makePoissonNoiseImage (im) | |
| 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. | |
| makeFakeKernelSet (sizeCell=128, nCell=3, deltaFunctionCounts=1.e4, tGaussianWidth=1.0, addNoise=True, bgValue=100., display=False) | |
| backgroundSubtract (config, maskedImages) | |
| Background subtraction for ip_diffim. | |
| writeKernelCellSet (kernelCellSet, psfMatchingKernel, backgroundModel, outdir) | |
| More coarse debugging. | |
| sourceToFootprintList (candidateInList, templateExposure, scienceExposure, kernelSize, config, log) | |
| Converting types. | |
| sourceTableToCandidateList (sourceTable, templateExposure, scienceExposure, kConfig, dConfig, log, basisList, doBuild=False) | |
| 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.
| 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.
| 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.
| lsst.ip.diffim.diffimTools.makeFlatNoiseImage | ( | mi, | |
seedStat = afwMath.MAX |
|||
| ) |
Add noise.
Definition at line 52 of file diffimTools.py.
| 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.
| 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.
| 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.
| 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.