GalSim-developers/GalSim — pull request #410 by rmjarvis (2013-04-29 12:15:19+00:00)
Title: #407 Fix drawK errors, and improve non-truncated Moffat

In branch #350, I accidentally broke the drawK function, which we didn't notice at the time, since we didn't have any unit tests for it. So here, I:
- made drawK work correctly with the new fillKValue functions
- updated how the python level drawK automatically determines the image size and dk if none are provided (these had also been incorrect)
- added unit tests to test all this

In addition, while writing the unit tests, I decided to mirror the `test_draw` function, which happens to use an Exponential profile. So I figured I'd use a Moffat with beta = 1.5 as the real-space profile to get an Exponential in k-space and have the same tests work for `test_drawK`. Well, I discovered that the calculation of the Hankel transform for untruncated Moffats isn't terribly accurate or fast in general, and even fails entirely for beta = 1.5.

On the other hand, I also discovered that untruncated Moffats have an analytic Hankel transform (involving a BesselK function). So I revamped the Moffat class a bit to use these instead.