GalSim-developers/GalSim — pull request #451 by rmjarvis (2013-07-13 00:51:38+00:00)
Title: #442 Improve Lanczos DC flux conservation

This PR is mostly for my work in improving the ability of our Lanczos interpolant to preserve a constant flux for a DC input image using the `conserve_flux` parameter.

It turns out that the correction sceme we are using gets progressively less effective as you add more terms, so even though I went from 1 correction term to 5, I only increased the accuracy from about 4e-4 to 7e-6. Still, since we often target 1.e-5 for many or our accuracy items, this seems like a worthwhile improvement.

Another change on the branch is that I made RealGalaxy and OpticalPSF use the same default interpolant as we set in InterpolatedImage. We had been having RealGalaxy use Lanczos-5 by default, and the other two used Quintic. I think we want these to be regularized.

I picked Quintic for the common default interpolant because there was a test in test_interpolatedimage.py that failed when I used Lanczos-5. Specifically, the magnification test. Melanie also found that Lanczos doesn't do a great job on her magnification tests in branch #389. However, there are other tests where she found Lanczos to be better than Quintic, so we might reconsider this at some point. But with Quintic, all the unit tests pass.

Finally, I moved the unit tests that were in test_spline.py into test_interpolatedimage.py and recast them as reference tests rather than tests of the spline routine, since most of them now don't use table look-ups. We can think about whether we actually want to make some unit tests of the spline function in Table now that it's wrapped into python (as LookupTable), but I think this doesn't need to be very high priority.