LSST Applications
21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
|
Public Member Functions | |
def | makeMinimalSchema (cls) |
def | __init__ (self, bbox, threshold=10.0, exposure=None, **kwds) |
def | addSource (self, instFlux, centroid, shape=None) |
def | addBlend (self) |
def | transform (self, wcs, **kwds) |
def | realize (self, noise, schema, randomSeed=1) |
Static Public Member Functions | |
def | makePerturbedWcs (oldWcs, minScaleFactor=1.2, maxScaleFactor=1.5, minRotation=None, maxRotation=None, minRefShift=None, maxRefShift=None, minPixShift=2.0, maxPixShift=4.0, randomSeed=1) |
def | makeEmptyExposure (bbox, wcs=None, crval=None, cdelt=None, psfSigma=2.0, psfDim=17, calibration=4) |
def | drawGaussian (bbox, instFlux, ellipse) |
Public Attributes | |
keys | |
threshold | |
exposure | |
psfShape | |
schema | |
catalog | |
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())
def lsst.meas.base.tests.TestDataset.__init__ | ( | self, | |
bbox, | |||
threshold = 10.0 , |
|||
exposure = None , |
|||
** | kwds | ||
) |
Definition at line 381 of file tests.py.
def 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)
def lsst.meas.base.tests.TestDataset.addSource | ( | self, | |
instFlux, | |||
centroid, | |||
shape = None |
|||
) |
Add a source to the simulation. 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. 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 406 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.
|
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. Returns ------- exposure : `lsst.age.image.ExposureF` An empty image.
Definition at line 310 of file tests.py.
def 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 167 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 207 of file tests.py.
def 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 518 of file tests.py.
def 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 469 of file tests.py.