Image Processing Routines

API Reference

csxtools.image.rotate90(a, sense='ccw')[source]

Rotate a stack of images by 90 degrees

This routine rotates a stack of images by 90. The rotation is performed on the last two axes. i.e. For a stack of images of shape (N, y, x) N rotations of the image of size (y, x) are performed.

Parameters:
  • a (array_like) – Input array to be rotated. This should be of shape (N, y, x).
  • sense (string) – ‘cw’ to rotate clockwise, ‘ccw’ to rotate anitclockwise
Returns:

Rotated stack of images of shape (N, x, y)

Return type:

array

csxtools.image.stackmean(array)[source]

Cacluate the mean of a stack

This function calculates the mean of a stack of images (or any array). It ignores values that are np.NAN and does not include them in the mean calculation. It assumes an array of shape (.. i, j, x, y) where x and y are the size of the returned array (x, y).

Parameters:array (array_like) – Input array of at least 3 dimensions.
Returns:2D Array of mean of stack.
Return type:array
csxtools.image.stacksum(array)[source]

Cacluate the sum of a stack

This function calculates the sum of a stack of images (or any array). It ignores values that are np.NAN and does not include them in the sum calculation. It assumes an array of shape (.. i, j, x, y) where x and y are the size of the returned array (x, y).

Parameters:array (array_like) – Input array of at least 3 dimensions.
Returns:tuple of 2 arrays of the sum and number of points in the sum
Return type:tuple
csxtools.image.stackvar(array)[source]

Cacluate the varience of a stack

This function calculates the variance of a stack of images (or any array). It ignores values that are np.NAN and does not include them in the calculation. It assumes an array of shape (.. i, j, x, y) where x and y are the size of the returned array (x, y).

Parameters:array (array_like) – Input array of at least 3 dimensions.
Returns:tuple of 2 arrays of the varience and number of points in the calculation
Return type:tuple
csxtools.image.stackstderr(array)[source]

Cacluate the standard error of a stack

This function calculates the standard error of a stack of images (or any array). It ignores values that are np.NAN and does not include them in the calculation. It assumes an array of shape (.. i, j, x, y) where x and y are the size of the returned array (x, y).

Parameters:array (array_like) – Input array of at least 3 dimensions.
Returns:tuple of 2 arrays of the standard error and number of points in the calculation
Return type:tuple
csxtools.image.stackstd(array)[source]

Cacluate the standard deviation of a stack

This function calculates the standard deviation of a stack of images It ignores values that are np.NAN and does not include them in the sum calculation. It assumes an array of shape (.. i, j, x, y) where x and y are the size of the returned array (x, y).

Parameters:array (array_like) – Input array of at least 3 dimensions.
Returns:tuple of 2 arrays of the standard deviation and number of points in the calculation
Return type:tuple
csxtools.image.images_mean(images)[source]

Cacluate the mean ccd counts per event

This function calculates the mean of ccd counts for each event. The input is a “slicerator” object returned by get_fastccd_images.

Parameters:object (slicerator) – This is the output of get_fastccd_images
Returns:array
Return type:1D numpy array
csxtools.image.images_sum(images)[source]

Cacluate the total ccd counts per event

This function calculates the sum of ccd counts for each event. The input is a “slicerator” object returned by get_fastccd_images.

Parameters:object (slicerator) – This is the output of get_fastccd_images
Returns:array
Return type:1D numpy array