GalSim-developers/GalSim — pull request #251 by rmjarvis (2012-09-17 15:01:09+00:00)
Title: #82 Separate image resize and image draw operations in c++

This is a pretty easy pull request I think. It cleans up two issues that have been around for a while: #82 and #167.

After breaking Image up into Image and ImageView, there was some redundancy in the code for the draw command, since there was a version for Image and one for ImageView. Most of the code was the same, but Image was allowed to resize the given image appropriately.

In this branch, I separated out the code to do the resizing from the code that does the drawing, and I have the python layer draw command call the resize function if appropriate and then the draw function. This is a bit cleaner and more modular.

The other advantage to doing this is that I could then apply the same resizing conventions at the python layer to the drawShoot command. So now those two commands are more parallel. (Of course drawShoot has a bunch of extra options relating to how many photons to shoot, but now it has the same kwargs as draw for setting up the image.)

I also added unit tests to test the correctness of the image, dx and wmult options in various combinations, so I think that takes care of the concerns raised in #167.