psfsim.mtf_diffusion

Detector MTF functions.

Attributes

MTF

MTF_image

Functions

diffusion_green(xd, yd[, x2, y2])

Charge diffusion Green's function as a function of Analysis coordinates in microns.

diffusion_prob(xd, yd[, width, x2, y2])

Charge diffusion probability as a function of Analysis coordinates in microns.

intensity_to_image(intensity, x_in, y_in, x_out, ...)

Function to convolve an intensity image with the Green's function.

diffusion_green_image(xd, yd, sX, sY, intensity[, ...])

Function to compute the detector response at the detector on (SCAx, SCAy) from an image with

MTF_image_vec(psX, psY, sX, sY, intensity[, npix_boundary])

Function to compute the detector response at the detector on (SCAx, SCAy) from an image with

MTF_SCA(psX, psY, x, y[, npix_boundary])

psX, psY : postage_stamp_size x postage_stamp_size meshgrid of the coordinates (in the Analysis

MTF_SCA_postage_stamp(x, y, psX, psY, intensity[, ...])

Function to compute the detector response at the detector on (SCAx, SCAy) from an image with

Module Contents

diffusion_green(xd, yd, x2=0.0, y2=0.0)[source]

Charge diffusion Green’s function as a function of Analysis coordinates in microns.

The MTF is calculated using a three-gaussian approximation of the charge diffusion in the SCA, where the parameters are derived from the charge diffusion model described in Emily Macbeth’s paper and the three-gaussian approximation in https://arxiv.org/pdf/2501.05632.

Parameters:
  • xd (float or np.ndarray of float) – The coordinates where the Green’s function is to be computed. Must be the same shape, or broadcastable to the same shape.

  • yd (float or np.ndarray of float) – The coordinates where the Green’s function is to be computed. Must be the same shape, or broadcastable to the same shape.

  • x2 (float, optional) – The location where the charges are generated.

  • y2 (float, optional) – The location where the charges are generated.

Returns:

The Green’s function at the indicated positions, same shape as xd.

Return type:

float or np.ndarray of float

diffusion_prob(xd, yd, width=10.0, x2=0.0, y2=0.0)[source]

Charge diffusion probability as a function of Analysis coordinates in microns.

This is the integral of the Green’s function over a square of width width centered on (0, 0).

The MTF is calculated using a three-gaussian approximation of the charge diffusion in the SCA, where the parameters are derived from the charge diffusion model described in Emily Macbeth’s paper and the three-gaussian approximation in https://arxiv.org/pdf/2501.05632.

Parameters:
  • xd (float or np.ndarray of float) – The coordinates where the Green’s function is to be computed. Must be the same shape, or broadcastable to the same shape.

  • yd (float or np.ndarray of float) – The coordinates where the Green’s function is to be computed. Must be the same shape, or broadcastable to the same shape.

  • width (float, int) – The width of the integration zone in microns (on each axis).

  • x2 (float, optional) – The location where the charges are generated.

  • y2 (float, optional) – The location where the charges are generated.

Returns:

The integrated probability centered at the indicated positions, same shape as xd.

Return type:

float or np.ndarray of float

See also

diffusion_green

The probability density function.

intensity_to_image(intensity, x_in, y_in, x_out, y_out, n_out, dx, reflect=True, tophat=True)[source]

Function to convolve an intensity image with the Green’s function.

Parameters:
  • intensity (np.ndarray of float) – The intensity image.

  • x_in (float) – The center of the intensity input image in microns.

  • y_in (float) – The center of the intensity input image in microns.

  • x_out (float) – The center of the desired output image in microns.

  • y_out (float) – The center of the desired output image in microns.

  • n_out (int) – The desired output postage stamp size.

  • dx (float) – The grid spacing in microns.

  • reflect (bool, optional) – Reflect at the detector active region edge.

  • tophat (bool, optional) – Integrate over the pixel tophat. Note that if this option is chosen, the unit of the output is the unit of the intensity times micron^2.

Returns:

The output image.

Return type:

np.ndarray of float

MTF[source]
diffusion_green_image(xd, yd, sX, sY, intensity, npix_boundary=1)[source]

Function to compute the detector response at the detector on (SCAx, SCAy) from an image with analysis coordinates sX, sY (meshgrid) and the intensity profile given by Intensity.

sX, sY : ulen x ulen meshgrid arrays of the image coordinates (in analysis coordinates, in mm) xd, yd : x and y coordinates (in the Analysis coordinate system) of the postage stamp point intensity : ulen x ulen array of intensity values integrated over the depth of the detector.

MTF_image[source]
MTF_image_vec(psX, psY, sX, sY, intensity, npix_boundary=1)[source]

Function to compute the detector response at the detector on (SCAx, SCAy) from an image with analysis coordinates sX, sY (meshgrid) and the intensity profile given by Intensity.

sX, sY : ulen x ulen meshgrid arrays of the image coordinates (in analysis coordinates, in mm) psX, psY : postage_stamp_size x postage_stamp_size meshgrid of the coordinates (in the Analysis coordinate system) of the postage stamp points intensity : ulen x ulen array of intensity values integrated over the depth of the detector.

MTF_SCA(psX, psY, x, y, npix_boundary=1)[source]

psX, psY : postage_stamp_size x postage_stamp_size meshgrid of the coordinates (in the Analysis coordinate system) of the postage stamp points

x, y : Analysis coordinates of the point in the SCA from which the diffusion is computed (in microns)

npix_boundary : number of pixels in the boundary layer where reflection boundary conditions are applied

MTF_SCA_postage_stamp(x, y, psX, psY, intensity, npix_boundary=1)[source]

Function to compute the detector response at the detector on (SCAx, SCAy) from an image with analysis coordinates sX, sY (meshgrid) and the intensity profile given by Intensity.

x, y : arrays of the analysis coordinates (in mm) over which the intensity is defined. Each is a 1D array with len=ulen

psX, psYpostage_stamp_size x postage_stamp_size meshgrid of the coordinates (in the Analysis

coordinate system) of the postage stamp points

intensity : ulen x ulen array of intensity values integrated over the depth of the detector.