|
LSST Applications g00d0e8bbd7+8c5ae1fdc5,g013ef56533+603670b062,g083dd6704c+2e189452a7,g199a45376c+0ba108daf9,g1c5cce2383+bc9f6103a4,g1fd858c14a+cd69ed4fc1,g210f2d0738+c4742f2e9e,g262e1987ae+612fa42d85,g29ae962dfc+83d129e820,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+5eaa884f2a,g47891489e3+e32160a944,g53246c7159+8c5ae1fdc5,g5b326b94bb+dcc56af22d,g64539dfbff+c4742f2e9e,g67b6fd64d1+e32160a944,g74acd417e5+c122e1277d,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g88cb488625+47d24e4084,g89139ef638+e32160a944,g8d7436a09f+d14b4ff40a,g8ea07a8fe4+b212507b11,g90f42f885a+e1755607f3,g97be763408+34be90ab8c,g98df359435+ec1fa61bf1,ga2180abaac+8c5ae1fdc5,ga9e74d7ce9+43ac651df0,gbf99507273+8c5ae1fdc5,gc2a301910b+c4742f2e9e,gca7fc764a6+e32160a944,gd7ef33dd92+e32160a944,gdab6d2f7ff+c122e1277d,gdb1e2cdc75+1b18322db8,ge410e46f29+e32160a944,ge41e95a9f2+c4742f2e9e,geaed405ab2+0d91c11c6d,w.2025.44
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.