Charge Deflection Model

We include in GalSim a basic implementation of the Antilogus charge deflection model. Probably at this point, there are better implementations of this model, so this might not be very useful for most users. However, if you just want a quick and dirty way to simulate the so-called “Brighter-Fatter Effect”, you can use this.

Note

A better implementation of brighter-fatter is now available as part of the SiliconSensor model. It does not use the Antilogus model at all, but rather tries to simulate the underlying physics of the effect.

class galsim.cdmodel.BaseCDModel(a_l, a_r, a_b, a_t)[source]

Base class for the most generic, i.e. no with symmetries or distance scaling relationships assumed, pixel boundary charge deflection model (as per Antilogus et al 2014).

__init__(a_l, a_r, a_b, a_t)[source]

Initialize a generic CDModel (charge deflection model).

Usually this class will not be instantiated directly, but there is nothing to prevent you from doing so. Each of the input a_l, a_r, a_b & a_t matrices must have the same shape and be odd-dimensioned.

The model implemented here is described in Antilogus et al. (2014). The effective border of a pixel shifts to an extent proportional to the flux in a pixel at separation (dx,dy) and a coefficient a(dx,dy). Contributions of all neighbouring pixels are superposed. Border shifts are calculated for each (l=left, r=right (=positive x), b=bottom, t=top (=pos. y)) border and the resulting change in flux in a pixel is the shift times the mean of its flux and the flux in the pixel on the opposite side of the border (caveat: in Antilogus et al. 2014 the sum is used instead of the mean, making the a(dx,dy) a factor of 2 smaller).

The parameters of the model are the a_l/r/b/t matrices, whose entry at (dy,dx) gives the respective shift coefficient. Note that for a realistic model, the matrices have a number of symmetries, as described in Antilogus et al. (2014). Use derived classes like PowerLawCD to have a model that automatically fulfills the symmetry conditions.

Note that there is a gain factor included in the coefficients. When the a_* are measured from flat fields according to eqn. 4.10 in Antilogus et. al (2014) and applied to images that have the same gain as the flats, the correction is as intended. If the gain in the images is different, this can be accounted for with the gain_ratio parameter when calling applyForward or applyBackward.

Parameters:
  • a_l – NumPy array containing matrix of deflection coefficients of left pixel border

  • a_r – NumPy array containing matrix of deflection coefficients of right pixel border

  • a_b – NumPy array containing matrix of deflection coefficients of bottom pixel border

  • a_t – NumPy array containing matrix of deflection coefficients of top pixel border

applyBackward(image, gain_ratio=1.0)[source]

Apply the charge deflection model in the backward direction (accurate to linear order).

Returns an image with the backward charge deflection transformation applied. The input image is not modified, but its WCS is included in the returned image.

Parameters:

gain_ratio – Ratio of gain_image/gain_flat when shift coefficients were derived from flat fields; default value is 1., which assumes the common case that your flat and science images have the same gain value

applyForward(image, gain_ratio=1.0)[source]

Apply the charge deflection model in the forward direction.

Returns an image with the forward charge deflection transformation applied. The input image is not modified, but its WCS is included in the returned image.

Parameters:

gain_ratio – Ratio of gain_image/gain_flat when shift coefficients were derived from flat fields; default value is 1., which assumes the common case that your flat and science images have the same gain value

class galsim.cdmodel.PowerLawCD(n, r0, t0, rx, tx, r, t, alpha)[source]

Bases: BaseCDModel

Class for parametrizing charge deflection coefficient strengths as a power law in distance from affected pixel border.

__init__(n, r0, t0, rx, tx, r, t, alpha)[source]

Initialize a power-law charge deflection model.

The deflections from charges in the six pixels directly neighbouring a pixel border are modelled independently by the parameters r0, t0 (directly adjacent to borders between two pixels in the same row=y / column=x) and rx, tx (pixels on the corner of pixel borders).

Deflections due to charges further away are modelled as a power-law:

a = A * numpy.sin(theta) * (r_distance)**(-alpha)

where A is a power-law amplitude (r for a_l / a_b and t for a_b / a_t), theta is the angle between the pixel border line and the line from border center to the other pixel center.

Sign conventions are such that positive r0, t0, rx, tx, r, t correspond to physical deflection of equal charges (this is also how the theta above is defined).

Parameters:
  • n – Maximum separation [pix] out to which charges contribute to deflection

  • r0 – a_l(0,-1)=a_r(0,+1) deflection coefficient along x direction

  • t0 – a_b(-1,0)=a_t(+1,0) deflection coefficient along y direction

  • rx – a_l(-1,-1)=a_r(+1,+1) diagonal contribution to deflection along x direction

  • tx – a_b(-1,-1)=a_t(+1,+1) diagonal contribution to deflection along y direction

  • r – Power-law amplitude for contribution to deflection along x from further away

  • t – Power-law amplitude for contribution to deflection along y from further away

  • alpha – Power-law exponent for deflection from further away