GalSim-developers/GalSim — pull request #427 by rmandelb (2013-05-28 18:12:02+00:00)
Title: #419 - image arithmetic

This fairly small pull request is for (a) a change in how image arithmetic is done (per Mike's request here: https://github.com/GalSim-developers/GalSim/issues/419#issuecomment-18319361 ) and (b) a small addition to the image arithmetic capabilities: float images can now be raised to a power.

I checked that the revamping of the image arithmetic didn't break any existing code e.g., in the tests or demos. I added a unit test for the new pow function, and was slightly surprised at the level of accuracy that was achievable - i.e., lower than I thought it should be - so comments are certainly welcome on that. I *attempted* to add a unit test for the new exceptions that are raised when attempting to do arithmetic on images that are inconsistent in shape/scale, but for some reason that's not working (see commented out new code in test_Image.py). I did confirm that the code raises the proper exception when you do such operations, so I am mystified as to why this test is failing. Possibly I am doing something stupid in my use of np.testing.assert_raises, and would be happy to hear suggestions on fixing this test.