LSST Applications g04e9c324dd+8c5ae1fdc5,g134cb467dc+1b3060144d,g18429d2f64+f642bf4753,g199a45376c+0ba108daf9,g1fd858c14a+2dcf163641,g262e1987ae+7b8c96d2ca,g29ae962dfc+3bd6ecb08a,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+53e1a9e7c5,g4595892280+fef73a337f,g47891489e3+2efcf17695,g4d44eb3520+642b70b07e,g53246c7159+8c5ae1fdc5,g67b6fd64d1+2efcf17695,g67fd3c3899+b70e05ef52,g74acd417e5+317eb4c7d4,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+2efcf17695,g8d7436a09f+3be3c13596,g8ea07a8fe4+9f5ccc88ac,g90f42f885a+a4e7b16d9b,g97be763408+ad77d7208f,g9dd6db0277+b70e05ef52,ga681d05dcb+a3f46e7fff,gabf8522325+735880ea63,gac2eed3f23+2efcf17695,gb89ab40317+2efcf17695,gbf99507273+8c5ae1fdc5,gd8ff7fe66e+b70e05ef52,gdab6d2f7ff+317eb4c7d4,gdc713202bf+b70e05ef52,gdfd2d52018+b10e285e0f,ge365c994fd+310e8507c4,ge410e46f29+2efcf17695,geaed405ab2+562b3308c0,gffca2db377+8c5ae1fdc5,w.2025.35
LSST Data Management Base Package
|
Functions | |
getKernelCenterDisplacement (kernel, x, y, image=None) | |
getPsfFwhm (psf, average=True, position=None) | |
float | evaluateMeanPsfFwhm (afwImage.Exposure exposure, float fwhmExposureBuffer, int fwhmExposureGrid) |
afwImage.ImageD | computeAveragePsf (afwImage.Exposure exposure, float psfExposureBuffer, int psfExposureGrid) |
computeRobustStatistics (image, mask, statsCtrl, statistic=afwMath.MEANCLIP) | |
computePSFNoiseEquivalentArea (psf) | |
angleMean (angles) | |
evaluateMaskFraction (mask, maskPlane) | |
computeDifferenceImageMetrics (science, difference, stars, sky_sources=None) | |
populate_sattle_visit_cache (visit_info, historical=False) | |
Variables | |
_LOG = getLogger(__name__) | |
Support utilities for Measuring sources
lsst.ip.diffim.utils.angleMean | ( | angles | ) |
Calculate the mean of an array of angles. Parameters ---------- angles : `ndarray` An array of angles, in radians Returns ------- `lsst.geom.Angle` The mean angle
Definition at line 305 of file utils.py.
afwImage.ImageD lsst.ip.diffim.utils.computeAveragePsf | ( | afwImage.Exposure | exposure, |
float | psfExposureBuffer, | ||
int | psfExposureGrid ) |
Get the average PSF by evaluating it on a grid within an exposure. Parameters ---------- exposure : `~lsst.afw.image.Exposure` The exposure for which the average PSF is to be computed. The exposure must contain a `psf` attribute. psfExposureBuffer : `float` Fractional buffer margin to be left out of all sides of the image during the construction of the grid to compute average PSF in an exposure. psfExposureGrid : `int` Grid size to compute the average PSF in an exposure. Returns ------- psfImage : `~lsst.afw.image.Image` The average PSF across the exposure. Raises ------ ValueError Raised if the PSF cannot be computed at any of the grid points. See Also -------- `evaluateMeanPsfFwhm`
Definition at line 200 of file utils.py.
lsst.ip.diffim.utils.computeDifferenceImageMetrics | ( | science, | |
difference, | |||
stars, | |||
sky_sources = None ) |
Compute quality metrics (saved to the task metadata) on the difference image, at the locations of detected stars on the science image. This restricts the metric to locations that should be well-subtracted. Parameters ---------- science : `lsst.afw.image.ExposureF` Science exposure that was subtracted. difference : `lsst.afw.image.ExposureF` Result of subtracting template and science. stars : `lsst.afw.table.SourceCatalog` Good calibration sources detected on science image; these footprints are what the metrics are computed on. Returns ------- metrics : `lsst.pipe.base.Struct` ``differenceFootprintRatioMean`` : `float` Mean of the ratio of the absolute value of the difference image (with the mean absolute value of the sky regions on the difference image removed) to the science image, computed in the footprints of stars detected on the science image (the sums below are of the pixels in each star or sky footprint): :math:`\mathrm{mean}_{footprints}((\sum |difference| - \mathrm{mean}(\sum |difference_{sky}|)) / \sum science)` ``differenceFootprintRatioStdev`` : `float` Standard Deviation across footprints of the above ratio. ``differenceFootprintSkyRatioMean`` : `float` Mean of the ratio of the absolute value of sky source regions on the difference image to the science image (the sum below is of the pixels in each sky source footprint): :math:`\mathrm{mean}_{footprints}(\sum |difference_{sky}| / \sum science_{sky})` ``differenceFootprintSkyRatioStdev`` : `float` Standard Deivation across footprints of the above sky ratio.
Definition at line 341 of file utils.py.
lsst.ip.diffim.utils.computePSFNoiseEquivalentArea | ( | psf | ) |
Compute the noise equivalent area for an image psf Parameters ---------- psf : `lsst.afw.detection.Psf` Returns ------- nea : `float`
Definition at line 289 of file utils.py.
lsst.ip.diffim.utils.computeRobustStatistics | ( | image, | |
mask, | |||
statsCtrl, | |||
statistic = afwMath.MEANCLIP ) |
Calculate a robust mean of the variance plane of an exposure. Parameters ---------- image : `lsst.afw.image.Image` Image or variance plane of an exposure to evaluate. mask : `lsst.afw.image.Mask` Mask plane to use for excluding pixels. statsCtrl : `lsst.afw.math.StatisticsControl` Statistics control object for configuring the calculation. statistic : `lsst.afw.math.Property`, optional The type of statistic to compute. Typical values are ``afwMath.MEANCLIP`` or ``afwMath.STDEVCLIP``. Returns ------- value : `float` The result of the statistic calculated from the unflagged pixels.
Definition at line 265 of file utils.py.
lsst.ip.diffim.utils.evaluateMaskFraction | ( | mask, | |
maskPlane ) |
Evaluate the fraction of masked pixels in a mask plane. Parameters ---------- mask : `lsst.afw.image.Mask` The mask to evaluate the fraction on maskPlane : `str` The particular mask plane to evaluate the fraction Returns ------- value : `float` The calculated fraction of masked pixels
Definition at line 322 of file utils.py.
float lsst.ip.diffim.utils.evaluateMeanPsfFwhm | ( | afwImage.Exposure | exposure, |
float | fwhmExposureBuffer, | ||
int | fwhmExposureGrid ) |
Get the mean PSF FWHM by evaluating it on a grid within an exposure. Parameters ---------- exposure : `~lsst.afw.image.Exposure` The exposure for which the mean FWHM of the PSF is to be computed. The exposure must contain a `psf` attribute. fwhmExposureBuffer : `float` Fractional buffer margin to be left out of all sides of the image during the construction of the grid to compute mean PSF FWHM in an exposure. fwhmExposureGrid : `int` Grid size to compute the mean FWHM in an exposure. Returns ------- meanFwhm : `float` The mean PSF FWHM on the exposure. Raises ------ ValueError Raised if the PSF cannot be computed at any of the grid points. See Also -------- `getPsfFwhm` `computeAveragePsf`
Definition at line 140 of file utils.py.
lsst.ip.diffim.utils.getKernelCenterDisplacement | ( | kernel, | |
x, | |||
y, | |||
image = None ) |
Calculate the PSF matching kernel peak offset from the nominal position. Parameters ---------- kernel : `~lsst.afw.math.LinearCombinationKernel` The PSF matching kernel to evaluate. x : `float` The x position on the detector to evaluate the kernel y : `float` The y position on the detector to evaluate the kernel image : `~lsst.afw.image.ImageD` The image to use as base for computing kernel pixel values Returns ------- kernel_sum : `float` The sum of the kernel on the desired location dx : `float` The displacement of the kernel averaged peak, with respect to the center of the extraction of the kernel dy : `float` The displacement of the kernel averaged peak, with respect to the center of the extraction of the kernel pos_angle: `float` The position angle in detector coordinates of the displacement length : `float` The displacement module of the kernel centroid in pixel units
Definition at line 45 of file utils.py.
lsst.ip.diffim.utils.getPsfFwhm | ( | psf, | |
average = True, | |||
position = None ) |
Directly calculate the horizontal and vertical widths of a PSF at half its maximum value. Parameters ---------- psf : `~lsst.afw.detection.Psf` Point spread function (PSF) to evaluate. average : `bool`, optional Set to return the average width over Y and X axes. position : `~lsst.geom.Point2D`, optional The position at which to evaluate the PSF. If `None`, then the average position is used. Returns ------- psfSize : `float` | `tuple` [`float`] The FWHM of the PSF computed at its average position. Returns the widths along the Y and X axes, or the average of the two if `average` is set. See Also -------- evaluateMeanPsfFwhm
Definition at line 104 of file utils.py.
lsst.ip.diffim.utils.populate_sattle_visit_cache | ( | visit_info, | |
historical = False ) |
Populate a cache of predicted satellite positions in the sattle service. Parameters ---------- visit_info: `lsst.afw.table.ExposureRecord.visitInfo` Visit info for the science exposure being processed. historical: `bool` Set to True if observations are older than the current day. Raises ------ requests.HTTPError Raised if sattle call does not return success.
Definition at line 422 of file utils.py.