GalSim-developers/GalSim — pull request #425 by reikonakajima (2013-05-28 16:44:41+00:00)
Title: #420 (modified) Allow scale_radius-specified Sersic profiles

Allow Sersic (as well as DeVaucouleurs) profiles to be specified by the scale radius.

* Allow only one out of two scale specifications: `scale_radius` or `half_light_radius`.
* Added new function `getScaleRadius()` for Sersic and DeVauc classes.
* Made Sersic index limits (0.3<=n<=4.2) a constant in the `Sersic.h` header file.
* Created `include/galsim/SBUtils.h` to avoid duplicate code in various SBProfile class headers (Sersic, Gauss, Exponential, Moffat).
* Revamped/reorganized unit tests in `tests/test_SBProfile.py` for a thorough testing of the half-light radii, scale radii, normalization, truncation, and `flux_untruncated` flag setting.

What I thought would be a trivial change took me 4 days... Aaaarrrgh. Thanks in advance for going through/checking the code.