GalSim-developers/GalSim — pull request #189 by barnabytprowe (2012-06-13 08:06:16+00:00)
Title: #142 - fixed size specs to always have a .getHalfLightRadius() method, other improvements, & Airy consistency

Hi all,

A few commits in this PR, but not so much actual content (is more a record of my trial and error).

As per discussion on #142, I've added a `.getHalfLightRadius()` method to pretty much everything that has a size and is circularly symmetric so that an HLR can be intuitively defined. I've also added some other size methods to classes (e.g. `getScaleRadius` in Moffat, Sersic etc., `.getFWM()` for Moffat, Airy) where this is easy, straightforward. Classes (or cases of classes, e.g. Airy with with obscuration) for which these size measures cannot be straightforwardly calculated raise a `NotImplementedError` exception.

Also, I changed the input `SBAiry` size parameter to be `lam_over_D` rather than its inverse `D` as previously defined. This brings the `SBAiry` into consistency with the `OpticalPSF` class and is a similar pattern as that used by the atmoshperic PSF too (here the size scaling param is `lam_over_r0`). This parameter is perhaps more intuitive as it scales with size rather than reciprocal size.

Finally, as Mike suggested on #142 I also removed any size defaults in the C++: these now have to be explicit. There was a bit of chasing around src/SBProfile.cpp, pysrc/SBProfile.cpp and /src/SBParse.cpp to ensure consistency, and the unit tests were very helpful for this. I can't rule out errors though, even despite all unit tests passing (for me), so comments very much welcomed.

Comments welcome.