FastCCD Routines

API Reference

csxtools.fastccd.correct_images(images, dark=None, flat=None, gain=(1, 4, 8))[source]

Subtract backgrond and gain correct images

This routine subtrtacts the backgrond and corrects the images for the multigain FastCCD ADC.

Parameters:
  • in (array_like) – Input array of images to correct of shape (N, y, x) where N is the number of images and x and y are the image size.
  • dark (array_like, optional) – Input array of dark images. This should be of shape (3, y, x). dark[0] is the gain 8 (most sensitive setting) dark image with dark[2] being the gain 1 (least sensitive) dark image.
  • flat (array_like, optional) – Input array for the flatfield correction. This should be of shape (y, x)
  • gain (tuple, optional) – These are the gain multiplication factors for the three different gain settings
Returns:

Array of corrected images of shape (N, y, x)

Return type:

array_like

csxtools.fastccd.photon_count(data, thresh, mean_filter, std_filter, nsum=3, nan=False)[source]

Do single photon counting on CCD image

This routine does single photon counting by cluster analysis. The image is searched for bright pixels within a threshold and then the energy deposited by each photon is calculated.

Parameters:
  • data (array_like) – Stack of CCD images. This array should be of shape (N, y, x) where N is the number of images
  • thresh (tuple) – Threshold to use for identifying photons. This should be a tuple of (min, max)
  • mean_filter (tuple) – Filter only the values of the mean which are within the limits of the tuple of the form (min, max)
  • std_filter (tuple) – Filter only the values of the standard deviation which are within the limits of the tuple of the form (min, max)
  • nsum (int) – The number of pixels to use to calculate the energy deposited by the photon. This should be 0 < nsum <= 9.
  • nan (bool) – If true, replace empty pixels with np.nan
Returns:

Two arrays are returned. The first is an array of size (N, y, x) where the elements are the integrated energy calculated for each photon hit. The second array is the standard deviation for the integrated intensity on each photon hit.

Return type:

tuple