LSST Applications g0f08755f38+9c285cab97,g1635faa6d4+13f3999e92,g1653933729+a8ce1bb630,g1a0ca8cf93+bf6eb00ceb,g28da252d5a+0829b12dee,g29321ee8c0+5700dc9eac,g2bbee38e9b+9634bc57db,g2bc492864f+9634bc57db,g2cdde0e794+c2c89b37c4,g3156d2b45e+41e33cbcdc,g347aa1857d+9634bc57db,g35bb328faa+a8ce1bb630,g3a166c0a6a+9634bc57db,g3e281a1b8c+9f2c4e2fc3,g414038480c+077ccc18e7,g41af890bb2+fde0dd39b6,g5fbc88fb19+17cd334064,g781aacb6e4+a8ce1bb630,g80478fca09+55a9465950,g82479be7b0+d730eedb7d,g858d7b2824+9c285cab97,g9125e01d80+a8ce1bb630,g9726552aa6+10f999ec6a,ga5288a1d22+2a84bb7594,gacf8899fa4+c69c5206e8,gae0086650b+a8ce1bb630,gb58c049af0+d64f4d3760,gc28159a63d+9634bc57db,gcf0d15dbbd+4b7d09cae4,gda3e153d99+9c285cab97,gda6a2b7d83+4b7d09cae4,gdaeeff99f8+1711a396fd,ge2409df99d+5e831397f4,ge79ae78c31+9634bc57db,gf0baf85859+147a0692ba,gf3967379c6+41c94011de,gf3fb38a9a8+8f07a9901b,gfb92a5be7c+9c285cab97,w.2024.46
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.