LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, bbox, threshold=10.0, exposure=None, **kwds) | |
makeMinimalSchema (cls) | |
addSource (self, instFlux, centroid, shape=None, setPeakSignificance=True) | |
addBlend (self) | |
transform (self, wcs, **kwds) | |
realize (self, noise, schema, randomSeed=1) | |
Static Public Member Functions | |
makePerturbedWcs (oldWcs, minScaleFactor=1.2, maxScaleFactor=1.5, minRotation=None, maxRotation=None, minRefShift=None, maxRefShift=None, minPixShift=2.0, maxPixShift=4.0, randomSeed=1) | |
makeEmptyExposure (bbox, wcs=None, crval=None, cdelt=None, psfSigma=2.0, psfDim=17, calibration=4, visitId=1234, mjd=60000.0) | |
drawGaussian (bbox, instFlux, ellipse) | |
Public Attributes | |
threshold | |
exposure | |
psfShape | |
schema | |
catalog | |
keys | |
Protected Member Functions | |
_installFootprint (self, record, image, setPeakSignificance=True) | |
Protected Attributes | |
_schema | |
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())
lsst.meas.base.tests.TestDataset.__init__ | ( | self, | |
bbox, | |||
threshold = 10.0, | |||
exposure = None, | |||
** | kwds ) |
Definition at line 170 of file tests.py.
|
protected |
Create simulated Footprint and add it to a truth catalog record.
Definition at line 410 of file tests.py.
lsst.meas.base.tests.TestDataset.addBlend | ( | self | ) |
Return a context manager which can add a blend of multiple sources. Notes ----- 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. Examples -------- .. code-block: py d = TestDataset(...) with d.addBlend() as b: b.addChild(flux1, centroid1) b.addChild(flux2, centroid2, shape2)
Definition at line 489 of file tests.py.
lsst.meas.base.tests.TestDataset.addSource | ( | self, | |
instFlux, | |||
centroid, | |||
shape = None, | |||
setPeakSignificance = True ) |
Add a source to the simulation. To insert a point source with a given signal-to-noise (sn), the total ``instFlux`` should be: ``sn*noise*psf_scale``, where ``noise`` is the noise you will pass to ``realize()``, and ``psf_scale=sqrt(4*pi*r^2)``, where ``r`` is the width of the PSF. Parameters ---------- instFlux : `float` Total instFlux of the source to be added. centroid : `lsst.geom.Point2D` Position of the source to be added. shape : `lsst.afw.geom.Quadrupole` Second moments of the source before PSF convolution. Note that the truth catalog records post-convolution moments. If `None`, a point source will be added. setPeakSignificance : `bool` Set the ``significance`` field for peaks in the footprints? See ``lsst.meas.algorithms.SourceDetectionTask.setPeakSignificance`` for how this field is computed for real datasets. Returns ------- record : `lsst.afw.table.SourceRecord` A truth catalog record. image : `lsst.afw.image.ImageF` Single-source image corresponding to the new source.
Definition at line 435 of file tests.py.
|
static |
Create an image of an elliptical Gaussian. Parameters ---------- bbox : `lsst.geom.Box2I` or `lsst.geom.Box2D` Bounding box of image to create. instFlux : `float` Total instrumental flux of the Gaussian (normalized analytically, not using pixel values). ellipse : `lsst.afw.geom.Ellipse` Defines the centroid and shape. Returns ------- image : `lsst.afw.image.ImageF` An image of the Gaussian.
Definition at line 383 of file tests.py.
|
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.makeMinimalSchema | ( | cls | ) |
Return the minimal schema needed to hold truth catalog fields. Notes ----- 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 180 of file tests.py.
|
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.
lsst.meas.base.tests.TestDataset.realize | ( | self, | |
noise, | |||
schema, | |||
randomSeed = 1 ) |
Simulate an exposure and detection catalog for this dataset. The simulation includes noise, and the detection catalog includes `~lsst.afw.detection.heavyFootprint.HeavyFootprint`\ s. Parameters ---------- noise : `float` Standard deviation of noise to be added to the exposure. The noise will be Gaussian and constant, appropriate for the sky-limited regime. schema : `lsst.afw.table.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. randomSeed : `int`, optional Seed for the random number generator. If `None`, a seed is chosen automatically. Returns ------- `exposure` : `lsst.afw.image.ExposureF` Simulated image. `catalog` : `lsst.afw.table.SourceCatalog` Simulated detection catalog.
Definition at line 557 of file tests.py.
lsst.meas.base.tests.TestDataset.transform | ( | self, | |
wcs, | |||
** | kwds ) |
Copy this dataset transformed to a new WCS, with new Psf and PhotoCalib. Parameters ---------- wcs : `lsst.afw.geom.SkyWcs` WCS for the new dataset. **kwds Additional keyword arguments passed on to `TestDataset.makeEmptyExposure`. If not specified, these revert to the defaults for `~TestDataset.makeEmptyExposure`, not the values in the current dataset. Returns ------- newDataset : `TestDataset` Transformed copy of this dataset.
Definition at line 508 of file tests.py.