LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
A simulated dataset consisting of a test image and an associated truth catalog. More...
Public Member Functions | |
def | makeMinimalSchema |
def | __init__ |
Initialize the dataset. More... | |
def | addSource |
Add a source to the simulation. More... | |
def | addBlend |
Return a context manager that allows a blend of multiple sources to be added. More... | |
def | transform |
Create a copy of the dataset transformed to a new WCS, with new Psf and Calib. More... | |
def | realize |
Create a simulated with noise and a simulated post-detection catalog with (Heavy)Footprints. More... | |
Static Public Member Functions | |
def | makePerturbedWcs |
Create a new undistorted TanWcs that is similar but not identical to another, with random scaling, rotation, and offset (in both pixel position and reference position). More... | |
def | makeEmptyExposure |
Create an Exposure, with a Calib, Wcs, and Psf, but no pixel values set. More... | |
def | drawGaussian |
Create an image of an elliptical Gaussian. More... | |
Public Attributes | |
threshold | |
exposure | |
psfShape | |
schema | |
catalog | |
Private Member Functions | |
def | _installFootprint |
A simulated dataset consisting of a test image and an associated truth catalog.
TestDataset creates an idealized image made of pure Gaussians (including a Gaussian PSF), with simple noise and idealized Footprints/HeavyFootprints that simulated the outputs of detection and deblending. Multiple noise realizations can be created from the same underlying sources, allowing uncertainty estimates to be verified via Monte Carlo.
Typical usage:
def lsst.meas.base.tests.TestDataset.__init__ | ( | self, | |
bbox, | |||
threshold = 10.0 , |
|||
exposure = None , |
|||
kwds | |||
) |
Initialize the dataset.
[in] | bbox | Bounding box of the test image. |
[in] | threshold | Threshold absolute value used to determine footprints for simulated sources. This thresholding will be applied before noise is actually added to images (or before the noise level is even known), so this will necessarily produce somewhat artificial footprints. |
[in] | exposure | lsst.afw.image.ExposureF test sources should be added to. Ownership should be considered transferred from the caller to the TestDataset. Must have a Gaussian Psf for truth catalog shapes to be exact. |
[in] | **kwds | Keyword arguments forwarded to makeEmptyExposure if exposure is None. |
Definition at line 278 of file tests.py.
|
private |
Create a Footprint for a simulated source and add it to its truth catalog record.
Definition at line 300 of file tests.py.
def lsst.meas.base.tests.TestDataset.addBlend | ( | self | ) |
Return a context manager that allows a blend of multiple sources to be added.
Example:
Note that nothing stops you from creating overlapping sources just using the addSource() method, but addBlend() is necesssary to create a parent object and deblended HeavyFootprints of the type produced by the detection and deblending pipelines.
Definition at line 349 of file tests.py.
def lsst.meas.base.tests.TestDataset.addSource | ( | self, | |
flux, | |||
centroid, | |||
shape = None |
|||
) |
Add a source to the simulation.
[in] | flux | Total flux of the source to be added. |
[in] | centroid | Position of the source to be added (lsst.afw.geom.Point2D). |
[in] | shape | 2nd moments of the source before PSF convolution (lsst.afw.geom.ellipses.Quadrupole). Note that the truth catalog records post-convolution moments). If None, a point source will be added. |
Definition at line 316 of file tests.py.
|
static |
Create an image of an elliptical Gaussian.
[in,out] | bbox | Bounding box of image to create. |
[in] | flux | Total flux of the Gaussian (normalized analytically, not using pixel values) |
[in] | ellipse | lsst.afw.geom.ellipses.Ellipse holding the centroid and shape. |
Definition at line 260 of file tests.py.
|
static |
Create an Exposure, with a Calib, Wcs, and Psf, but no pixel values set.
[in] | bbox | Bounding box of the image (image coordinates) as returned by makeCatalog. |
[in] | wcs | New Wcs for the exposure (created from crval and cdelt if None). |
[in] | crval | afw.coord.Coord: center of the TAN WCS attached to the image. |
[in] | cdelt | afw.geom.Angle: pixel scale of the image |
[in] | psfSigma | Radius (sigma) of the Gaussian PSF attached to the image |
[in] | psfDim | Width and height of the image's Gaussian PSF attached to the image |
[in] | fluxMag0 | Flux at magnitude zero (in e-) used to set the Calib of the exposure. |
Definition at line 231 of file tests.py.
def lsst.meas.base.tests.TestDataset.makeMinimalSchema | ( | cls | ) |
Return the minimal schema needed to hold truth catalog fields. When TestDataset.realize() is called, the schema must include at least these fields. Usually it will include additional fields for measurement algorithm outputs, allowing the same catalog to be used for both truth values (the fields from the minimal schema) and the measurements.
Definition at line 145 of file tests.py.
|
static |
Create a new undistorted TanWcs that is similar but not identical to another, with random scaling, rotation, and offset (in both pixel position and reference position).
The maximum and minimum arguments are interpreted as absolute values for a split range that covers both positive and negative values (as this method is used in testing, it is typically most important to avoid perturbations near zero). Scale factors are treated somewhat differently: the actual scale factor is chosen between minScaleFactor and maxScaleFactor OR (1/maxScaleFactor) and (1/minScaleFactor).
The default range for rotation is 30-60 degrees, and the default range for reference shift is 0.5-1.0 arcseconds (these cannot be safely included directly as default values because Angle objects are mutable).
Definition at line 180 of file tests.py.
def lsst.meas.base.tests.TestDataset.realize | ( | self, | |
noise, | |||
schema | |||
) |
Create a simulated with noise and a simulated post-detection catalog with (Heavy)Footprints.
[in] | noise | Standard deviation of noise to be added to the exposure. The noise will be Gaussian and constant, appropriate for the sky-limited regime. |
[in] | schema | Schema of the new catalog to be created. Must start with self.schema (i.e. schema.contains(self.schema) must be True), but typically contains fields for already-configured measurement algorithms as well. |
Definition at line 407 of file tests.py.
def lsst.meas.base.tests.TestDataset.transform | ( | self, | |
wcs, | |||
kwds | |||
) |
Create a copy of the dataset transformed to a new WCS, with new Psf and Calib.
[in] | wcs | Wcs for the new dataset. |
[in] | **kwds | Additional keyword arguments passed on to makeEmptyExposure. If not specified, these revert to the defaults for makeEmptyExposure, not the values in the current dataset. |
Definition at line 367 of file tests.py.