Closed FedericoBerlfein closed 2 months ago
I would suggest using the existing InterpolatedChromaticObject class, and make a classmethod factory function to construct it. Something like gasim.InterpolatedChromaticObject.from_images(images, wavelengths)
.
Thank you for the suggestion!
Given that InterpolatedChromaticObject
is a subclass of ChromaticObject
isn't it going to be a problem to make a classmethod that do not provide the expected input, meaning a ChromaticObject
?
Nope. No problem with that. ChromaticRealGalaxy
has a similar functionality. cf. http://galsim-developers.github.io/GalSim/_build/html/chromaticobject.html#galsim.ChromaticRealGalaxy.makeFromImages
That's doing a slightly different thing, but it's pretty similar, so worth taking a look.
Got it, thanks for the help Mike!
Implemented on #1296
Currently Galsim is not able to produce chromatic images directly from images, which could be a useful added feature. Specifically, the motivation behind this added implementation is for work on Euclid-like image simulations, where we will have the PSF information given as oversampled PSF images at specific wavelengths. Therefore the current Galsim methods for generating a chromatic PSF do not support this as an input, which is why we seek ideas/feedback on the best way to implement this.
To be more clear, currently chromatic objects in Galsim are generated from instantiating a
ChromaticObject
and then optionally using theinterpolate
method to draw images at set wavelengths to produce anInterpolatedChromaticObject
that linearly interpolates those stored images for later calculations. However, there is no way to directly instantiate aInterpolatedChromaticObject
from a list of images at specific wavelengths. This seems to be a straightforward extension, however, there are multiple ways to implement such a functionality if this is a desired addition to Galsim.InterpolatedChromaticObject
class to allow instantiation directly from a list of images, rather than instantiate it exclusively from aChromaticObject
.InterpolatedChromaticObject
class. The actual class would be very similar toInterpolatedChromaticObject
, but would skip some of the steps the class currently takes before creating images to interpolate, as these would be given as input.InterpolatedImage
class, which currently spatially interpolates a single image, and create anInterpolatedChromaticImage
class that can take also interpolate in wavelength.Our timeline is to implement something for this problem this week, and with the main goal of making simulations in the coming months, so the timeline of the project is relatively short.