#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.
@barnabytrowe just timed this, and it's quite insignificant, so I suggest
we leave it with the clunky loop.

2014-09-03 3:44 GMT+02:00 Mike Jarvis <notifications@github.com>:

> In galsim/cdmodel.py:
>
> > +        @param tx     a_b(-1,-1)=a_t(+1,+1) diagonal contribution to deflection along y direction
> > +        @param r      power-law amplitude for contribution to deflection along x from further away
> > +        @param t      power-law amplitude for contribution to deflection along y from further away
> > +        @param alpha  power-law exponent for deflection from further away
> > +
> > +        """
> > +        # First define x and y coordinates in a square grid of shape (2n + 1) * (2n + 1)
> > +        x, y = np.meshgrid(np.arange(2 * n + 1) - n, np.arange(2 * n + 1) - n)
> > +
> > +        # prepare a_* matrices
> > +        a_l = np.zeros((2 * n + 1, 2 * n + 1))
> > +        a_r = np.zeros((2 * n + 1, 2 * n + 1))
> > +        a_b = np.zeros((2 * n + 1, 2 * n + 1))
> > +        a_t = np.zeros((2 * n + 1, 2 * n + 1))
> > +
> > +        # fill with power law model (slightly clunky loop but not likely a big time sink)
>
> Have you time checked this? I agree that it is probably not a significant
> time, so not worth working to optimize. But if it is, there are a number of
> numpy-vectorization things that would help speed this up. Not worth
> bothering though if the time on this is always negligible.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GalSim-developers/GalSim/pull/592/files#r17027766>.
>