Insert fake objects into calexps.
Add fake stars and galaxies to the given calexp, specified in the dataRef. Galaxy parameters are read in
from the specified file and then modelled using galsim. Re-runs characterize image and calibrate image to
give a new background estimation and measurement of the calexp.
`ProcessFakeSourcesTask` inherits six functions from insertFakesTask that make images of the fake
sources and then add them to the calexp.
`addPixCoords`
Use the WCS information to add the pixel coordinates of each source
Adds an ``x`` and ``y`` column to the catalog of fake sources.
`trimFakeCat`
Trim the fake cat to about the size of the input image.
`mkFakeGalsimGalaxies`
Use Galsim to make fake double sersic galaxies for each set of galaxy parameters in the input file.
`mkFakeStars`
Use the PSF information from the calexp to make a fake star using the magnitude information from the
input file.
`cleanCat`
Remove rows of the input fake catalog which have half light radius, of either the bulge or the disk,
that are 0.
`addFakeSources`
Add the fake sources to the calexp.
Notes
-----
The ``calexp`` with fake souces added to it is written out as the datatype ``calexp_fakes``.
Definition at line 137 of file processCcdWithFakes.py.
def lsst.pipe.tasks.processCcdWithFakes.ProcessCcdWithFakesTask.run |
( |
|
self, |
|
|
|
fakeCat, |
|
|
|
exposure, |
|
|
|
wcs = None , |
|
|
|
photoCalib = None , |
|
|
|
exposureIdInfo = None |
|
) |
| |
Add fake sources to a calexp and then run detection, deblending and measurement.
Parameters
----------
fakeCat : `pandas.core.frame.DataFrame`
The catalog of fake sources to add to the exposure
exposure : `lsst.afw.image.exposure.exposure.ExposureF`
The exposure to add the fake sources to
wcs : `lsst.afw.geom.SkyWcs`
WCS to use to add fake sources
photoCalib : `lsst.afw.image.photoCalib.PhotoCalib`
Photometric calibration to be used to calibrate the fake sources
exposureIdInfo : `lsst.obs.base.ExposureIdInfo`
Returns
-------
resultStruct : `lsst.pipe.base.struct.Struct`
contains : outputExposure : `lsst.afw.image.exposure.exposure.ExposureF`
outputCat : `lsst.afw.table.source.source.SourceCatalog`
Notes
-----
Adds pixel coordinates for each source to the fakeCat and removes objects with bulge or disk half
light radius = 0 (if ``config.cleanCat = True``). These columns are called ``x`` and ``y`` and are in
pixels.
Adds the ``Fake`` mask plane to the exposure which is then set by `addFakeSources` to mark where fake
sources have been added. Uses the information in the ``fakeCat`` to make fake galaxies (using galsim)
and fake stars, using the PSF models from the PSF information for the calexp. These are then added to
the calexp and the calexp with fakes included returned.
The galsim galaxies are made using a double sersic profile, one for the bulge and one for the disk,
this is then convolved with the PSF at that point.
If exposureIdInfo is not provided then the SourceCatalog IDs will not be globally unique.
Definition at line 254 of file processCcdWithFakes.py.