Is there a way to pass a piecewise (discontinuous) function for the "spec" parameter of SED or the "throughput" parameter of Bandpass? I tried passing a delta function and a triangular function using numpy, but galsim would not accept either as a valid python function.
I want to try drawing an object at a single wavelength, and thought I should modify the SED or the bandpass to have a value only at a single wavelength. If there are better ways to do this, please let me know!
There's a better way to do this.
If you already have a ChromaticObject with some SED, you can get a GSObject corresponding to that ChromaticObject at a single wavelength using the ChromaticObject.evaluateAtWavelength() method. Once you have that GSObject, you can draw it into an image. For example:
You can do this and find that obj is chromatic, while foo is not. And you can do this easily for any number of wavelengths without having to redefine SEDs.