lsst.synpipe  20.0.0+e69b5d60e7
Functions
lsst.synpipe.makeFakeGalaxy Namespace Reference

Functions

def makeGalaxy (flux, gal, psfImage, galType='sersic', cosmosCat=None, drawMethod='no_pixel', trunc=10.0, transform=None, addShear=False, calib=None, sersic_prec=0.01, addPoisson=False)
 
def parseRealGalaxy (gal)
 
def parseDoubleSersic (tflux, gal)
 
def arrayToGSObj (imgArr, scale=1.0, norm=False)
 
def galSimDrawImage (galObj, size=0, scale=1.0, method="no_pixel", addPoisson=False)
 
def galSimConvolve (galObj, psfObj, size=0, scale=1.0, method="no_pixel", returnObj=False)
 
def galSimAdd (galObjList, size=0, scale=1.0, method="no_pixel", returnArr=False)
 
def plotFakeGalaxy (galObj, galID=None, suffix=None, size=0, addPoisson=False)
 
def galSimFakeCosmos (cosmosCat, calib, gal, psfImage=None, plotFake=False, returnObj=True, sersic_prec=0.02, drawMethod='no_pixel', scale=1.0, transform=None, addShear=False, addPoisson=False)
 
def galSimFakeSersic (flux, gal, psfImage=None, scaleRad=False, returnObj=True, expAll=False, devAll=False, plotFake=False, trunc=0, drawMethod="no_pixel", addPoisson=False, scale=1.0, transform=None, addShear=False)
 
def galSimFakeDoubleSersic (comp1, comp2, psfImage=None, trunc=0, returnObj=True, devExp=False, plotFake=False, drawMethod='auto', addPoisson=False, scale=1.0, transform=None, addShear=False)
 
def galSimRealGalaxy (flux, real_galaxy_catalog, index=None, psfImage=None, random=False, returnObj=True, plotFake=False, drawMethod='auto', addPoisson=False, scale=1.0, transform=None)
 
def testMakeFake (galList, asciiTab=False, single=True, double=True, real=True)
 

Function Documentation

◆ arrayToGSObj()

def lsst.synpipe.makeFakeGalaxy.arrayToGSObj (   imgArr,
  scale = 1.0,
  norm = False 
)
Convert an input 2-D array into a GalSim Image object

TODO : Check the scale here
        According to the GalSim Doxygen
        If provided, use this as the pixel scale for the Image;
        this will override the pixel scale stored by the provided Image.
        If scale is None, then take the provided image's pixel scale.
        [default: None]

Definition at line 165 of file makeFakeGalaxy.py.

◆ galSimAdd()

def lsst.synpipe.makeFakeGalaxy.galSimAdd (   galObjList,
  size = 0,
  scale = 1.0,
  method = "no_pixel",
  returnArr = False 
)
Just add a list of GSObjs together using GalSim
Make sure all elements in the input list are GSObjs

Definition at line 234 of file makeFakeGalaxy.py.

◆ galSimConvolve()

def lsst.synpipe.makeFakeGalaxy.galSimConvolve (   galObj,
  psfObj,
  size = 0,
  scale = 1.0,
  method = "no_pixel",
  returnObj = False 
)
Just do convolution using GalSim

Make sure the inputs are both GalSim GSObj
The galaxy model should be the first one, and the PSF object is the second
one; Returns a imgArr or GSObj

Definition at line 215 of file makeFakeGalaxy.py.

◆ galSimDrawImage()

def lsst.synpipe.makeFakeGalaxy.galSimDrawImage (   galObj,
  size = 0,
  scale = 1.0,
  method = "no_pixel",
  addPoisson = False 
)
"Draw" a GalSim Object into an GalSim Image using certain method, and with
certain size

TODO : Think about the scale here:
  By default scale=None
  According to GalSim Doxygen :
  If provided, use this as the pixel scale for the image. If scale is None
  and image != None, then take the provided image's pixel scale.
  If scale is None and image == None, then use the Nyquist scale.
  If scale <= 0 (regardless of image), then use the Nyquist scale.

Definition at line 185 of file makeFakeGalaxy.py.

◆ galSimFakeCosmos()

def lsst.synpipe.makeFakeGalaxy.galSimFakeCosmos (   cosmosCat,
  calib,
  gal,
  psfImage = None,
  plotFake = False,
  returnObj = True,
  sersic_prec = 0.02,
  drawMethod = 'no_pixel',
  scale = 1.0,
  transform = None,
  addShear = False,
  addPoisson = False 
)
Generate fake galaxy using galSim.COSMOSCatalog objects.

Definition at line 279 of file makeFakeGalaxy.py.

◆ galSimFakeDoubleSersic()

def lsst.synpipe.makeFakeGalaxy.galSimFakeDoubleSersic (   comp1,
  comp2,
  psfImage = None,
  trunc = 0,
  returnObj = True,
  devExp = False,
  plotFake = False,
  drawMethod = 'auto',
  addPoisson = False,
  scale = 1.0,
  transform = None,
  addShear = False 
)
Make a fake double Sersic galaxy using the galSim.Sersic function

Inputs: total flux of the galaxy, and a record array that stores the
necessary parameters [reffPix, nSersic, axisRatio, posAng]

Output: a 2-D image array of the galaxy model  OR
        a GalSim object of the model

Options:
    psfImage:     PSF image for convolution
    trunc:        Flux of Sersic models will truncate at trunc * reffPix
                  radius; trunc=0 means no truncation
    drawMethod:   The method for drawImage: ['auto', 'fft', 'real_space']
    addPoisson:   Add Poisson noise
    plotFake:     Generate a PNG figure of the model
    devexp:       The first component will be seen as a nSersic=4 bulge;
                  And, the second one will be seen as a nSersic=1 disk
    returnObj:    If TRUE, will return the GSObj

Definition at line 475 of file makeFakeGalaxy.py.

◆ galSimFakeSersic()

def lsst.synpipe.makeFakeGalaxy.galSimFakeSersic (   flux,
  gal,
  psfImage = None,
  scaleRad = False,
  returnObj = True,
  expAll = False,
  devAll = False,
  plotFake = False,
  trunc = 0,
  drawMethod = "no_pixel",
  addPoisson = False,
  scale = 1.0,
  transform = None,
  addShear = False 
)
Make a fake single Sersic galaxy using the galSim.Sersic function

Inputs: total flux of the galaxy, and a record array that stores the
necessary parameters [reffPix, nSersic, axisRatio, posAng]

Output: a 2-D image array of the galaxy model  OR
        a GalSim object of the model

Options:
    psfImage:     PSF image for convolution
    trunc:        Flux of Sersic models will truncate at trunc * reffPix
                  radius; trunc=0 means no truncation
    drawMethod:   The method for drawImage: ['auto', 'fft', 'real_space']
    addPoisson:   Add Poisson noise
    plotFake:     Generate a PNG figure of the model
    expAll:       Input model will be seen as nSersic=1
    devAll:       Input model will be seen as nSersic=4
    returnObj:    If TRUE, will return the GSObj

Definition at line 371 of file makeFakeGalaxy.py.

◆ galSimRealGalaxy()

def lsst.synpipe.makeFakeGalaxy.galSimRealGalaxy (   flux,
  real_galaxy_catalog,
  index = None,
  psfImage = None,
  random = False,
  returnObj = True,
  plotFake = False,
  drawMethod = 'auto',
  addPoisson = False,
  scale = 1.0,
  transform = None 
)
Real galaxy.

Definition at line 550 of file makeFakeGalaxy.py.

◆ makeGalaxy()

def lsst.synpipe.makeFakeGalaxy.makeGalaxy (   flux,
  gal,
  psfImage,
  galType = 'sersic',
  cosmosCat = None,
  drawMethod = 'no_pixel',
  trunc = 10.0,
  transform = None,
  addShear = False,
  calib = None,
  sersic_prec = 0.01,
  addPoisson = False 
)
Function called by task to make galaxy images

INPUTS:
    flux = calibrated total flux
    gal = galaxy parameters in record (np.recarray)
    psfImage = np.ndarray of psfImage
    galType = type of galaxy we want to make, this has to agree
              with what's in the record array, options now are:
                'sersic' (single sersic),
                'dsersic' (double sersic), and
                'real' (for making galaxies from real HST images)
                'cosmos' (Using GalSim.COSMOSCatalog)

All the necessary keywords need to be in the fits catalog,
including maybe drawMethod and trunc...

Definition at line 9 of file makeFakeGalaxy.py.

◆ parseDoubleSersic()

def lsst.synpipe.makeFakeGalaxy.parseDoubleSersic (   tflux,
  gal 
)
Parse the input total flux [tflux] and parameter record array
[gal] into two parameter records for each component [comp1, comp2]

Definition at line 107 of file makeFakeGalaxy.py.

◆ parseRealGalaxy()

def lsst.synpipe.makeFakeGalaxy.parseRealGalaxy (   gal)
Place holder for real galaxi.

Definition at line 84 of file makeFakeGalaxy.py.

◆ plotFakeGalaxy()

def lsst.synpipe.makeFakeGalaxy.plotFakeGalaxy (   galObj,
  galID = None,
  suffix = None,
  size = 0,
  addPoisson = False 
)
Generate a PNG image of the model
By default, the image will be named as 'fake_galaxy.png'

Definition at line 253 of file makeFakeGalaxy.py.

◆ testMakeFake()

def lsst.synpipe.makeFakeGalaxy.testMakeFake (   galList,
  asciiTab = False,
  single = True,
  double = True,
  real = True 
)
Test the makeFake functions.

Definition at line 592 of file makeFakeGalaxy.py.