A simulated dataset consisuting of test image and 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.
Parameters
----------
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
Bounding box of the test image.
threshold : `float`
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.
exposure : `lsst.afw.image.ExposureF`
The image to which test sources should be added. Ownership should
be considered transferred from the caller to the TestDataset.
Must have a Gaussian PSF for truth catalog shapes to be exact.
**kwds
Keyword arguments forwarded to makeEmptyExposure if exposure is `None`.
Notes
-----
Typical usage:
.. code-block: py
bbox = lsst.geom.Box2I(lsst.geom.Point2I(0,0), lsst.geom.Point2I(100,
100))
dataset = TestDataset(bbox)
dataset.addSource(instFlux=1E5, centroid=lsst.geom.Point2D(25, 26))
dataset.addSource(instFlux=2E5, centroid=lsst.geom.Point2D(75, 24),
shape=lsst.afw.geom.Quadrupole(8, 7, 2))
with dataset.addBlend() as family:
family.addChild(instFlux=2E5, centroid=lsst.geom.Point2D(50, 72))
family.addChild(instFlux=1.5E5, centroid=lsst.geom.Point2D(51, 74))
exposure, catalog = dataset.realize(noise=100.0,
schema=TestDataset.makeMinimalSchema())
Definition at line 126 of file tests.py.
lsst.meas.base.tests.TestDataset.makeEmptyExposure |
( |
|
bbox, |
|
|
|
wcs = None , |
|
|
|
crval = None , |
|
|
|
cdelt = None , |
|
|
|
psfSigma = 2.0 , |
|
|
|
psfDim = 17 , |
|
|
|
calibration = 4 , |
|
|
|
visitId = 1234 , |
|
|
|
mjd = 60000.0 |
|
) |
| |
|
static |
Create an Exposure, with a PhotoCalib, Wcs, and Psf, but no pixel values.
Parameters
----------
bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D`
Bounding box of the image in image coordinates.
wcs : `lsst.afw.geom.SkyWcs`, optional
New WCS for the exposure (created from CRVAL and CDELT if `None`).
crval : `lsst.afw.geom.SpherePoint`, optional
ICRS center of the TAN WCS attached to the image. If `None`, (45
degrees, 45 degrees) is assumed.
cdelt : `lsst.geom.Angle`, optional
Pixel scale of the image. If `None`, 0.2 arcsec is assumed.
psfSigma : `float`, optional
Radius (sigma) of the Gaussian PSF attached to the image
psfDim : `int`, optional
Width and height of the image's Gaussian PSF attached to the image
calibration : `float`, optional
The spatially-constant calibration (in nJy/count) to set the
PhotoCalib of the exposure.
visitId : `int`, optional
Visit id to store in VisitInfo.
mjd : `float`, optional
Modified Julian Date of this exposure to store in VisitInfo.
Returns
-------
exposure : `lsst.age.image.ExposureF`
An empty image.
Definition at line 326 of file tests.py.
lsst.meas.base.tests.TestDataset.makePerturbedWcs |
( |
|
oldWcs, |
|
|
|
minScaleFactor = 1.2 , |
|
|
|
maxScaleFactor = 1.5 , |
|
|
|
minRotation = None , |
|
|
|
maxRotation = None , |
|
|
|
minRefShift = None , |
|
|
|
maxRefShift = None , |
|
|
|
minPixShift = 2.0 , |
|
|
|
maxPixShift = 4.0 , |
|
|
|
randomSeed = 1 |
|
) |
| |
|
static |
Return a perturbed version of the input WCS.
Create a new undistorted TAN WCS that is similar but not identical to
another, with random scaling, rotation, and offset (in both pixel
position and reference position).
Parameters
----------
oldWcs : `lsst.afw.geom.SkyWcs`
The input WCS.
minScaleFactor : `float`
Minimum scale factor to apply to the input WCS.
maxScaleFactor : `float`
Maximum scale factor to apply to the input WCS.
minRotation : `lsst.geom.Angle` or `None`
Minimum rotation to apply to the input WCS. If `None`, defaults to
30 degrees.
maxRotation : `lsst.geom.Angle` or `None`
Minimum rotation to apply to the input WCS. If `None`, defaults to
60 degrees.
minRefShift : `lsst.geom.Angle` or `None`
Miniumum shift to apply to the input WCS reference value. If
`None`, defaults to 0.5 arcsec.
maxRefShift : `lsst.geom.Angle` or `None`
Miniumum shift to apply to the input WCS reference value. If
`None`, defaults to 1.0 arcsec.
minPixShift : `float`
Minimum shift to apply to the input WCS reference pixel.
maxPixShift : `float`
Maximum shift to apply to the input WCS reference pixel.
randomSeed : `int`
Random seed.
Returns
-------
newWcs : `lsst.afw.geom.SkyWcs`
A perturbed version of the input WCS.
Notes
-----
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).
The random number generator is primed with the seed given. If
`None`, a seed is automatically chosen.
Definition at line 223 of file tests.py.