GalSim-developers / GalSim

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

Can't photon shoot simple chromatic transformation #1229

Closed jmeyers314 closed 11 months ago

jmeyers314 commented 1 year ago

ChromaticTransformation._shoot attempts to evaluate wavelength-dependent jacobian, offset, and flux_ratios here, but some of the underlying methods (for example in ChromaticObject.expand here) don't work correctly when handed an array of wavelengths. Here's a short snippet that fails due to the above:

import galsim
bandpass = galsim.Bandpass('LSST_r.dat', 'nm')
psf = galsim.ChromaticObject(
    galsim.Gaussian(fwhm=1)
).dilate(lambda w: (w/500)**-0.3)
star = galsim.DeltaFunction()*galsim.SED('vega.txt', 'nm', 'flambda')
obj = galsim.Convolve(psf, star)
img = obj.drawImage(bandpass, nx=15, ny=15, scale=1, method='phot')
rmjarvis commented 11 months ago

Done #1236