GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
228 stars 107 forks source link

`save_photons` does not work for `ChromaticAiry` #1271

Closed jfcrenshaw closed 6 months ago

jfcrenshaw commented 10 months ago

When drawing a chromatic PSF using photon shooting, the save_photons parameter does not seem to work.

For example, the following achromatic code works fine:

psf = galsim.Airy(lam=500, diam=8)
image = psf.drawImage(method="phot", n_photons=1000, save_photons=True)
photons = image.photons

However, the following chromatic code raises AttributeError: 'Image' object has no attribute 'photons':

sed = galsim.SED('vega.txt', wave_type="nm", flux_type="fphotons")
bandpass = galsim.Bandpass("LSST_r.dat", wave_type="nm")

psf_chromatic = galsim.ChromaticAiry(lam=500, diam=8) * sed
image = psf_chromatic.drawImage(
    method="phot",
    n_photons=1000,
    save_photons=True,
    bandpass=bandpass,
)
photons = image.photons
rmjarvis commented 6 months ago

Fixed in #1289