GalSim-developers/GalSim — pull request #386 by rmandelb (2013-04-05 18:40:15+00:00)
Title: #382 - power spectrum estimator

This pull request is for code to estimate a shear power spectrum based on gridded shears. The code was developed in a private repository, largely by Joe with tweaks from various others, so it has already undergone a fair amount of testing. A few notes:

(1) This was included in examples/ rather than as part of GalSim. The reason for this is that for GREAT3, if we use power spectra as our metric, we want to be able to distribute power spectrum estimation code that doesn't require the user to install GalSim (because that might be annoying for challenge participants). As a result it is not possible to import galsim and use the PowerSpectrumEstimator class; instead, it is necessary to specifically import that pse module. If someone can think of a better or more convenient way to do this, I'm open to suggestions.

(2) Because of how this was done, there are no changes to galsim code or unit tests in this PR. Those who wish to test out the code should see examples/pse.py, which includes docstrings that show example usage.

(3) I updated the lensing engine document to show some plots that use this power spectrum estimator rather than the GREAT10 one. Please see the last paragraph of section 6, and figures 6-7. I especially like the fact that the code can calculate the rebinned theoretical power spectrum, which includes the effects of our chosen ell binning on the estimated PS.

(4) When I was doing (3), I noticed that this code is a lot faster than the python version of the GREAT10 power spectrum estimation code (I cannot say anything about the matlab version since I've never used it). I'm guessing that this is a result of Joe's use of the numpy histogram function to bin the PS into our logarithmic ell bins. Anyway, regardless of the cause, it's good news for us that this is so fast.