GalSim-developers/GalSim — pull request #513 by rmandelb (2014-03-07 22:11:59+00:00)
Title: #387 - lensing engine interpolation

This pull request is for some additional functionality in the lensing engine, along with some tests of the effects of interpolation of shears on the shear power spectrum or correlation function. I recommend going over the code in a different order from the diff on the github site: start with galsim/lensing_ps.py to learn the new features, and then look at the interpolation testing script in devel/modules/ (which uses those new features).

I also restructured the documentation on the lensing engine a bit, adding some new information about interpolation that comes from the tests done for this issue, and also trying to make the docstrings more generally readable. They are quite long, so I broke them up into different headings based on topic, and also rearranged some parts into what seemed like a more logical order.

To summarize briefly, the code changes are:
* Added interpolation testing script, devel/modules/lensing_engine_interpolants.py
* Provide option to buildGrid that will cut off the power spectrum above kmax to avoid aliasing. This is now the default behavior, and hence will be automatically used by calls via config as well.
* Added a utility function to take a regularly-spaced subsample of a pre-calculated grid of shears. This was necessary for my tests, but I thought others might potentially want access to it, so I put it into galsim/lensing_ps.py instead of the testing script.
* Added a utility to calculate the shear correlation function for a given power spectrum, taking into account the limiting values of k for a particular grid configuration. So, this does not include the effects of DFT vs. continuous treatment, but it at least accounts for some of the effects of a finite grid.
* Made it possible to interpolate the grid in a periodic way, which helps account for grid edge effects and preserve the shear power spectrum. People who care about the shear correlation function shouldn't use this option.
* Made the interpolant uval function accessible at the python level.
* Updates to unit tests.