GalSim-developers / GalSim

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

Problem when applying SED to RandomWalk or RandomKnots object #1064

Closed matroxel closed 4 years ago

matroxel commented 4 years ago

In the new release, updates to the RandomWalk object seem to have broken something related to SEDs. When applying an SED to a RandomWalk or RandomKnots object, the code fails with:

galsim.errors.GalSimIncompatibleValuesError: profile must be a GSObject Values {}

Example:

import galsim sed = galsim.SED('CWW_E_ext.sed', 'A', 'flambda') knots = galsim.RandomKnots(10, half_light_radius=1.3, flux=100) gal = knots * sed

matroxel commented 4 years ago

@masayamn

rmjarvis commented 4 years ago

PR coming. But in the meanwhile, the following workaround might be acceptable if this is blocking anything:

sed = galsim.SED('CWW_E_ext.sed', 'A', 'flambda')
knots = galsim.RandomKnots(10, half_light_radius=1.3, flux=100)
gal = galsim.ChromaticObject(knots) * sed

This is functionally equivalent, and avoids the bug.