LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
LSST Data Management Base Package
|
Classes | |
class | InsertFakesConnections |
Functions | |
_add_fake_sources (exposure, objects, calibFluxRadius=12.0, logger=None) | |
_isWCSGalsimDefault (wcs, hdr) | |
processImagesForInsertion (self, fakeCat, wcs, psf, photoCalib, band, pixelScale) | |
addPixCoords (self, fakeCat, image) | |
trimFakeCat (self, fakeCat, image) | |
mkFakeGalsimGalaxies (self, fakeCat, band, photoCalib, pixelScale, psf, image) | |
mkFakeStars (self, fakeCat, band, photoCalib, psf, image) | |
cleanCat (self, fakeCat, starCheckVal) | |
addFakeSources (self, image, fakeImages, sourceType) | |
Variables | |
linWcs = wcs.linearizePixelToSky(skyCoord, geom.arcseconds) | |
mat = linWcs.getMatrix() | |
wcs | |
obj = galsim.InterpolatedImage(im, calculate_stepk=False) | |
bitmask | |
Insert fakes into deepCoadds
|
protected |
Add fake sources to the given exposure Parameters ---------- exposure : `lsst.afw.image.exposure.exposure.ExposureF` The exposure into which the fake sources should be added objects : `typing.Iterator` [`tuple` ['lsst.geom.SpherePoint`, `galsim.GSObject`]] An iterator of tuples that contains (or generates) locations and object surface brightness profiles to inject. calibFluxRadius : `float`, optional Aperture radius (in pixels) used to define the calibration for this exposure+catalog. This is used to produce the correct instrumental fluxes within the radius. The value should match that of the field defined in slot_CalibFlux_instFlux. logger : `logging.Logger`, optional Logger.
Definition at line 46 of file insertFakes.py.
|
protected |
Decide if wcs = galsim.PixelScale(1.0) is explicitly present in header, or if it's just the galsim default. Parameters ---------- wcs : galsim.BaseWCS Potentially default WCS. hdr : galsim.fits.FitsHeader Header as read in by galsim. Returns ------- isDefault : bool True if default, False if explicitly set in header.
Definition at line 147 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.addFakeSources | ( | self, | |
image, | |||
fakeImages, | |||
sourceType ) |
Add the fake sources to the given image Parameters ---------- image : `lsst.afw.image.exposure.exposure.ExposureF` The image into which the fake sources should be added fakeImages : `typing.Iterator` [`tuple` ['lsst.afw.image.ImageF`, `lsst.geom.Point2d`]] An iterator of tuples that contains (or generates) images of fake sources, and the locations they are to be inserted at. sourceType : `str` The type (star/galaxy) of fake sources input Returns ------- image : `lsst.afw.image.exposure.exposure.ExposureF` Notes ----- Uses the x, y information in the ``fakeCat`` to position an image of the fake interpolated onto the pixel grid of the image. Sets the ``FAKE`` mask plane for the pixels added with the fake source.
Definition at line 1236 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.addPixCoords | ( | self, | |
fakeCat, | |||
image ) |
Add pixel coordinates to the catalog of fakes. Parameters ---------- fakeCat : `pandas.core.frame.DataFrame` The catalog of fake sources to be input image : `lsst.afw.image.exposure.exposure.ExposureF` The image into which the fake sources should be added Returns ------- fakeCat : `pandas.core.frame.DataFrame`
Definition at line 1003 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.cleanCat | ( | self, | |
fakeCat, | |||
starCheckVal ) |
Remove rows from the fakes catalog which have HLR = 0 for either the buldge or disk component, also remove galaxies that have Sersic index outside the galsim min and max allowed (0.3 <= n <= 6.2). Parameters ---------- fakeCat : `pandas.core.frame.DataFrame` The catalog of fake sources to be input starCheckVal : `str`, `bytes` or `int` The value that is set in the sourceType column to specifiy an object is a star. Returns ------- fakeCat : `pandas.core.frame.DataFrame` The input catalog of fake sources but with the bad objects removed
Definition at line 1195 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.mkFakeGalsimGalaxies | ( | self, | |
fakeCat, | |||
band, | |||
photoCalib, | |||
pixelScale, | |||
psf, | |||
image ) |
Make images of fake galaxies using GalSim. Parameters ---------- band : `str` pixelScale : `float` psf : `lsst.meas.extensions.psfex.psfexPsf.PsfexPsf` The PSF information to use to make the PSF images fakeCat : `pandas.core.frame.DataFrame` The catalog of fake sources to be input photoCalib : `lsst.afw.image.photoCalib.PhotoCalib` Photometric calibration to be used to calibrate the fake sources Yields ------ galImages : `generator` A generator of tuples of `lsst.afw.image.exposure.exposure.ExposureF` and `lsst.geom.Point2D` of their locations. Notes ----- Fake galaxies are made by combining two sersic profiles, one for the bulge and one for the disk. Each component has an individual sersic index (n), a, b and position angle (PA). The combined profile is then convolved with the PSF at the specified x, y position on the image. The names of the columns in the ``fakeCat`` are configurable and are the column names from the University of Washington simulations database as default. For more information see the doc strings attached to the config options. See mkFakeStars doc string for an explanation of calibration to instrumental flux.
Definition at line 1064 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.mkFakeStars | ( | self, | |
fakeCat, | |||
band, | |||
photoCalib, | |||
psf, | |||
image ) |
Make fake stars based off the properties in the fakeCat. Parameters ---------- band : `str` psf : `lsst.meas.extensions.psfex.psfexPsf.PsfexPsf` The PSF information to use to make the PSF images fakeCat : `pandas.core.frame.DataFrame` The catalog of fake sources to be input image : `lsst.afw.image.exposure.exposure.ExposureF` The image into which the fake sources should be added photoCalib : `lsst.afw.image.photoCalib.PhotoCalib` Photometric calibration to be used to calibrate the fake sources Yields ------ starImages : `generator` A generator of tuples of `lsst.afw.image.ImageF` of fake stars and `lsst.geom.Point2D` of their locations. Notes ----- To take a given magnitude and translate to the number of counts in the image we use photoCalib.magnitudeToInstFlux, which returns the instrumental flux for the given calibration radius used in the photometric calibration step. Thus `calibFluxRadius` should be set to this same radius so that we can normalize the PSF model to the correct instrumental flux within calibFluxRadius.
Definition at line 1140 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.processImagesForInsertion | ( | self, | |
fakeCat, | |||
wcs, | |||
psf, | |||
photoCalib, | |||
band, | |||
pixelScale ) |
Process images from files into the format needed for insertion. Parameters ---------- fakeCat : `pandas.core.frame.DataFrame` The catalog of fake sources to be input wcs : `lsst.afw.geom.skyWcs.skyWcs.SkyWc` WCS to use to add fake sources psf : `lsst.meas.algorithms.coaddPsf.coaddPsf.CoaddPsf` or `lsst.meas.extensions.psfex.psfexPsf.PsfexPsf` The PSF information to use to make the PSF images photoCalib : `lsst.afw.image.photoCalib.PhotoCalib` Photometric calibration to be used to calibrate the fake sources band : `str` The filter band that the observation was taken in. pixelScale : `float` The pixel scale of the image the sources are to be added to. Returns ------- galImages : `list` A list of tuples of `lsst.afw.image.exposure.exposure.ExposureF` and `lsst.geom.Point2D` of their locations. For sources labelled as galaxy. starImages : `list` A list of tuples of `lsst.afw.image.exposure.exposure.ExposureF` and `lsst.geom.Point2D` of their locations. For sources labelled as star. Notes ----- The input fakes catalog needs to contain the absolute path to the image in the band that is being used to add images to. It also needs to have the R.A. and declination of the fake source in radians and the sourceType of the object.
Definition at line 916 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.trimFakeCat | ( | self, | |
fakeCat, | |||
image ) |
Trim the fake cat to the size of the input image plus trimBuffer padding. `fakeCat` must be processed with addPixCoords before using this method. Parameters ---------- fakeCat : `pandas.core.frame.DataFrame` The catalog of fake sources to be input image : `lsst.afw.image.exposure.exposure.ExposureF` The image into which the fake sources should be added Returns ------- fakeCat : `pandas.core.frame.DataFrame` The original fakeCat trimmed to the area of the image
Definition at line 1027 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.bitmask |
Definition at line 1278 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.linWcs = wcs.linearizePixelToSky(skyCoord, geom.arcseconds) |
Definition at line 902 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.mat = linWcs.getMatrix() |
Definition at line 903 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.obj = galsim.InterpolatedImage(im, calculate_stepk=False) |
Definition at line 912 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.wcs |
Definition at line 904 of file insertFakes.py.