Search code examples
galsim

SED and PSF in Galsim


Setup

  • MacOS 10.12.6
  • Python 2.7
  • Galsim 1.4.4

Goal

I want to insert two SEDs (Balge and Disk) and using them to make WFIRST PSFs.

So far I am able to import SEDs by applying galsim.SED() and produce a PSF using wfirst.getPSF()


Problem

By applying the wfirst.getPSF(), I cannot take my desired SED into account.


I even tried:

I also tried using galsim.Bandpass()



More details:

Based on the recipe provided in Example(#13) One may produce PSF using wfirst.getPSF() and then convolve it the SED.

I followed this routine:

PSFs = wfirst.getPSF(SCAs=use_SCA, approximate_struts=True,_waves=10,logger=logger)
point = galsim.Gaussian(sigma=1.e-8, flux=1.)
star_sed = galsim.SED(lambda x:1, 'nm', 'flambda').withFlux(1.,filter_)  
star = galsim.Convolve(point*star_sed, PSF)

I was wondering if there is an option in which we can take SED into account when we want to make the PSF.

-Thank you


Solution

  • The key point of confusion is that the PSF does not have an SED; only astronomical objects such as stars and galaxies have SEDs. The process that you've pointed to in demo13.py is the correct way to include an SED: you attach it to the astronomical object in question (in this case a star, but you could also assign an SED to a galaxy, or assign different SEDs to separate components of a galaxy).

    So if you had achromatic galsim.GSObjects called bulge and disk for two galaxy components, and separate SEDs for each one (bulge_sed and disk_sed), a chromatic WFIRST PSF called psf, and a galsim.Bandpass filter, then you simply do:

    galaxy = bulge*bulge_sed + disk*disk_sed
    object = galsim.Convolve(galaxy, psf)
    object.drawImage(bandpass=filter, scale=wfirst.pixel_scale)
    

    The PSF for the bulge and disk will differ because the PSF is chromatic and you've given the bulge and disk different SEDs, so this should cover the use case that you've described. See demo12.py for more examples of how to use the chromatic functionality that you are asking about (especially example C in that demo is relevant to your question).