LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Classes | |
class | InsertFakesConnections |
Functions | |
def | processImagesForInsertion (self, fakeCat, wcs, psf, photoCalib, band, pixelScale) |
def | addPixCoords (self, fakeCat, image) |
def | trimFakeCat (self, fakeCat, image) |
def | mkFakeGalsimGalaxies (self, fakeCat, band, photoCalib, pixelScale, psf, image) |
def | mkFakeStars (self, fakeCat, band, photoCalib, psf, image) |
def | cleanCat (self, fakeCat, starCheckVal) |
def | addFakeSources (self, image, fakeImages, sourceType) |
Variables | |
linWcs = wcs.linearizePixelToSky(skyCoord, geom.arcseconds) | |
mat = linWcs.getMatrix() | |
wcs | |
obj = galsim.InterpolatedImage(im, calculate_stepk=False) | |
def 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 1219 of file insertFakes.py.
def 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 994 of file insertFakes.py.
def 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 1178 of file insertFakes.py.
def 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 1047 of file insertFakes.py.
def 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 1123 of file insertFakes.py.
def 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 907 of file insertFakes.py.
def lsst.pipe.tasks.insertFakes.trimFakeCat | ( | self, | |
fakeCat, | |||
image | |||
) |
Trim the fake cat to about the size of the input image. `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 1018 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.linWcs = wcs.linearizePixelToSky(skyCoord, geom.arcseconds) |
# Unchanged doCleanCat = pexConfig.Field( doc="If true removes bad sources from the catalog.", dtype=bool, default=True, ) fakeType = pexConfig.Field( doc="What type of fake catalog to use, snapshot (includes variability in the magnitudes calculated " "from the MJD of the image), static (no variability) or filename for a user defined fits" "catalog.", dtype=str, default="static", ) calibFluxRadius = pexConfig.Field( doc="Aperture radius (in pixels) that was used to define the calibration for this image+catalog. " "This will be used to produce the correct instrumental fluxes within the radius. " "This value should match that of the field defined in slot_CalibFlux_instFlux.", dtype=float, default=12.0, ) coaddName = pexConfig.Field( doc="The name of the type of coadd used", dtype=str, default="deep", ) doSubSelectSources = pexConfig.Field( doc="Set to True if you wish to sub select sources to be input based on the value in the column" "set in the sourceSelectionColName config option.", dtype=bool, default=False ) insertImages = pexConfig.Field( doc="Insert images directly? True or False.", dtype=bool, default=False, ) doProcessAllDataIds = pexConfig.Field( doc="If True, all input data IDs will be processed, even those containing no fake sources.", dtype=bool, default=False, ) trimBuffer = pexConfig.Field( doc="Size of the pixel buffer surrounding the image. Only those fake sources with a centroid" "falling within the image+buffer region will be considered for fake source injection.", dtype=int, default=100, ) sourceType = pexConfig.Field( doc="The column name for the source type used in the fake source catalog.", dtype=str, default="sourceType", ) fits_alignment = pexConfig.ChoiceField( doc="How should injections from FITS files be aligned?", dtype=str, allowed={ "wcs": ( "Input image will be transformed such that the local WCS in " "the FITS header matches the local WCS in the target image. " "I.e., North, East, and angular distances in the input image " "will match North, East, and angular distances in the target " "image." ), "pixel": ( "Input image will _not_ be transformed. Up, right, and pixel " "distances in the input image will match up, right and pixel " "distances in the target image." ) }, default="pixel" ) # New source catalog config variables ra_col = pexConfig.Field( doc="Source catalog column name for RA (in radians).", dtype=str, default="ra", ) dec_col = pexConfig.Field( doc="Source catalog column name for dec (in radians).", dtype=str, default="dec", ) bulge_semimajor_col = pexConfig.Field( doc="Source catalog column name for the semimajor axis (in arcseconds) " "of the bulge half-light ellipse.", dtype=str, default="bulge_semimajor", ) bulge_axis_ratio_col = pexConfig.Field( doc="Source catalog column name for the axis ratio of the bulge " "half-light ellipse.", dtype=str, default="bulge_axis_ratio", ) bulge_pa_col = pexConfig.Field( doc="Source catalog column name for the position angle (measured from " "North through East in degrees) of the semimajor axis of the bulge " "half-light ellipse.", dtype=str, default="bulge_pa", ) bulge_n_col = pexConfig.Field( doc="Source catalog column name for the Sersic index of the bulge.", dtype=str, default="bulge_n", ) disk_semimajor_col = pexConfig.Field( doc="Source catalog column name for the semimajor axis (in arcseconds) " "of the disk half-light ellipse.", dtype=str, default="disk_semimajor", ) disk_axis_ratio_col = pexConfig.Field( doc="Source catalog column name for the axis ratio of the disk " "half-light ellipse.", dtype=str, default="disk_axis_ratio", ) disk_pa_col = pexConfig.Field( doc="Source catalog column name for the position angle (measured from " "North through East in degrees) of the semimajor axis of the disk " "half-light ellipse.", dtype=str, default="disk_pa", ) disk_n_col = pexConfig.Field( doc="Source catalog column name for the Sersic index of the disk.", dtype=str, default="disk_n", ) bulge_disk_flux_ratio_col = pexConfig.Field( doc="Source catalog column name for the bulge/disk flux ratio.", dtype=str, default="bulge_disk_flux_ratio", ) mag_col = pexConfig.Field( doc="Source catalog column name template for magnitudes, in the format " "``filter name``_mag_col. E.g., if this config variable is set to " "``%s_mag``, then the i-band magnitude will be searched for in the " "``i_mag`` column of the source catalog.", dtype=str, default="%s_mag" ) select_col = pexConfig.Field( doc="Source catalog column name to be used to select which sources to " "add.", dtype=str, default="select", ) # Deprecated config variables raColName = pexConfig.Field( doc="RA column name used in the fake source catalog.", dtype=str, default="raJ2000", deprecated="Use `ra_col` instead." ) decColName = pexConfig.Field( doc="Dec. column name used in the fake source catalog.", dtype=str, default="decJ2000", deprecated="Use `dec_col` instead." ) diskHLR = pexConfig.Field( doc="Column name for the disk half light radius used in the fake source catalog.", dtype=str, default="DiskHalfLightRadius", deprecated=( "Use `disk_semimajor_col`, `disk_axis_ratio_col`, and `disk_pa_col`" " to specify disk half-light ellipse." ) ) aDisk = pexConfig.Field( doc="The column name for the semi major axis length of the disk component used in the fake source" "catalog.", dtype=str, default="a_d", deprecated=( "Use `disk_semimajor_col`, `disk_axis_ratio_col`, and `disk_pa_col`" " to specify disk half-light ellipse." ) ) bDisk = pexConfig.Field( doc="The column name for the semi minor axis length of the disk component.", dtype=str, default="b_d", deprecated=( "Use `disk_semimajor_col`, `disk_axis_ratio_col`, and `disk_pa_col`" " to specify disk half-light ellipse." ) ) paDisk = pexConfig.Field( doc="The column name for the PA of the disk component used in the fake source catalog.", dtype=str, default="pa_disk", deprecated=( "Use `disk_semimajor_col`, `disk_axis_ratio_col`, and `disk_pa_col`" " to specify disk half-light ellipse." ) ) nDisk = pexConfig.Field( doc="The column name for the sersic index of the disk component used in the fake source catalog.", dtype=str, default="disk_n", deprecated="Use `disk_n` instead." ) bulgeHLR = pexConfig.Field( doc="Column name for the bulge half light radius used in the fake source catalog.", dtype=str, default="BulgeHalfLightRadius", deprecated=( "Use `bulge_semimajor_col`, `bulge_axis_ratio_col`, and " "`bulge_pa_col` to specify disk half-light ellipse." ) ) aBulge = pexConfig.Field( doc="The column name for the semi major axis length of the bulge component.", dtype=str, default="a_b", deprecated=( "Use `bulge_semimajor_col`, `bulge_axis_ratio_col`, and " "`bulge_pa_col` to specify disk half-light ellipse." ) ) bBulge = pexConfig.Field( doc="The column name for the semi minor axis length of the bulge component used in the fake source " "catalog.", dtype=str, default="b_b", deprecated=( "Use `bulge_semimajor_col`, `bulge_axis_ratio_col`, and " "`bulge_pa_col` to specify disk half-light ellipse." ) ) paBulge = pexConfig.Field( doc="The column name for the PA of the bulge component used in the fake source catalog.", dtype=str, default="pa_bulge", deprecated=( "Use `bulge_semimajor_col`, `bulge_axis_ratio_col`, and " "`bulge_pa_col` to specify disk half-light ellipse." ) ) nBulge = pexConfig.Field( doc="The column name for the sersic index of the bulge component used in the fake source catalog.", dtype=str, default="bulge_n", deprecated="Use `bulge_n` instead." ) magVar = pexConfig.Field( doc="The column name for the magnitude calculated taking variability into account. In the format " "``filter name``magVar, e.g. imagVar for the magnitude in the i band.", dtype=str, default="%smagVar", deprecated="Use `mag_col` instead." ) sourceSelectionColName = pexConfig.Field( doc="The name of the column in the input fakes catalogue to be used to determine which sources to" "add, default is none and when this is used all sources are added.", dtype=str, default="templateSource", deprecated="Use `select_col` instead." ) class InsertFakesTask(PipelineTask, CmdLineTask):
Definition at line 893 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.mat = linWcs.getMatrix() |
Definition at line 894 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.obj = galsim.InterpolatedImage(im, calculate_stepk=False) |
Definition at line 903 of file insertFakes.py.
lsst.pipe.tasks.insertFakes.wcs |
Definition at line 895 of file insertFakes.py.