GalSim-developers / GalSim

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

1294 from images #1296

Closed FedericoBerlfein closed 2 months ago

FedericoBerlfein commented 3 months ago

I have added a classmethod to the InterpolatedChromaticObject class called from_images() that takes in as input a list of Galsim Image objects and a list of wavelengths. This will allow the user to created aInterpolatedChromaticObject directly from images. The method also takes as arguments a list of stepk and maxk values if the user wishes to pass these directly to the InterpolatedImage object that is created within the method. Any other keyword that the InterpolatedImage class accepts can in addition be passed as kwargs to the method. In addition, unit tests have been added to the file test_chromatic.py that compare this initialization method to the "default" method. Any feedback/suggestions are highly appreciated!

FedericoBerlfein commented 2 months ago

I just pushed the changes discussed here. Mainly, I changed the main function from_images to do some sanity checks first (check pixel scale is the same for all images, check dimensions for all images match) and do sorting of the wavelengths and images. It then calls the _from_images function which has the actual functionality. It now calculates the default stepk and maxk from the average profile of the input images.

FedericoBerlfein commented 2 months ago

@rmjarvis I noticed that the code does not hit 100% coverage on codecov, however, the line that its telling me is not covered is a commented line. Not sure why this is happening or how to fix it. Let me know if you have any thoughts on this. I have also made changes based on previous conversations that are ready for review whenever you have time, let me know of any further comments or changes!

rmjarvis commented 2 months ago

Looks good. Thanks Federico.