master#

msfc_ccd.dark.master(images, axis, proportion=0.25)[source]#

Estimate the master dark image of each tap from a sequence of dark images.

The master dark is the trimmed mean of the sequence along axis, computed independently for each pixel. Trimming the largest and smallest values rejects cosmic rays and other spikes which affect a single image, while hot pixels and the fixed pattern of the sensor, which are present in every image, are preserved.

The images should have had their bias removed before calling this function, so that the result can be subtracted from other images which have had their bias removed in the same way.

Parameters:
  • images (CameraDataT) – A sequence of dark images, either for the whole sensor or for each tap.

  • axis (str) – The logical axis along which the images are a sequence of darks.

  • proportion (float) –

    The fraction of the largest and smallest values to remove from each pixel before taking the mean. The number of images removed is rounded down, so with fewer than 1 / proportion images nothing is removed.

    This trims far more than current(), which trims 1 percent of the pixels of each image. Here the trim is along the sequence for each pixel, and a cosmic ray affects only one or two of the few images in the sequence, while current() trims across the pixels of an image, where the hot pixels are part of the dark current and must be kept.

Returns:

  • A copy of images, of the same type, whose outputs are the master dark,

  • without axis.

Raises:

ValueError – If the images have no axis axis.

Return type:

CameraDataT