#524 - Implementation of a model for CCD charge deflection in images, following Antilogus et al (2014)

This branch is ready for review by a wider group I think, although merging the branch is not highly urgent.

On #524 , @danielgruen and I have added a module (`galsim/cdmodel.py`) to describe charge deflection in CCD pixels, also known as the "brighter-fatter" effect, following the model of Antilogus et al (2014), see http://arxiv.org/abs/1402.0725.

The effect is applied to images at the C++ layer via a new `BaseImage` member function, `applyCD()`.  We chose the constness etc. settings in the way we thought made sense, but comments welcomed.  The Python module, and the classes which store the different charge deflection models, then use this interface to apply the effect.

@danielgruen has put some unit tests in place, and is already using the code to perform tests of the effect's impact on weak lensing measurements.  However, as ever, suggestions for improved docstrings and unit tests would be welcomed on this PR.
The checks are in the python layer now. @rmjarvis Do you think we should do
an additional assert statement here?

2014-09-03 3:54 GMT+02:00 Mike Jarvis <notifications@github.com>:

> In src/Image.cpp:
>
> > +{
> > +    // images aL, aR, aB, aT contain shift coefficients for left, right, bottom and top border
> > +    // dmax is maximum separation considered
> > +    // gain_ratio is gain_image/gain_flat when shift coefficients were measured on flat and
> > +    //    image has different gain
> > +
> > +    // Perform sanity check
> > +    if(dmax < 0) throw ImageError("Attempt to apply CD model with invalid extent");
> > +    // Get the array dimension and perform other checks
> > +    const int arraydim = 1 + aL.getXMax() - aL.getXMin();
> > +    if (arraydim != (2 * dmax + 1) * (2 * dmax + 1)) throw ImageError(
> > +        "Dimensions of input image do not match specified dmax");
> > +    if (1 + aR.getXMax() - aR.getXMin() != arraydim ||
> > +        1 + aB.getXMax() - aB.getXMin() != arraydim ||
> > +        1 + aT.getXMax() - aT.getXMin() != arraydim)
> > +        throw ImageError("All input aL, aR, aB, aT Images must be the same dimensions");
>
> I think these two checks have already been done in the python layer, so
> you could probably convert them to assert statements rather than check and
> throw.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GalSim-developers/GalSim/pull/592/files#r17027988>.
>