islatu.image

The two-dimension detector generates images of the reflected intensity. The purpose of the Image class stored in this module is the investigation and manipulation of these images.

class islatu.image.Image(array: ndarray, transpose: bool = False)[source]

Bases: object

This class stores information about the detector images.

file_path

File path for the image.

Type

str

array

The image described as an array.

Type

array_like

array_original

The original value of the image array when it was loaded from disk.

Type

array_like

array_e

The errors on each pixel of the array.

Type

array_like

bkg

The background that was subtracted from the image.

Type

float

bkg_e

The uncertainty on the background.

Type

float

Parameters
  • file_path (str) – The file path for the image.

  • data (pandas.DataFrame, optional) – Experimental data about the measurement. Defaults to None.

  • transpose (bool, optional) – Should the data be rotated by 90 degrees? Defaults to False.

background_subtraction(background_subtraction_function, **kwargs)[source]

Perform a background subtraction based on some function.

Parameters
  • background_subtraction_function (callable) – The function to model the data and therefore remove the background.

  • **kwargs (dict) – The background substraction function keyword arguments.

crop(crop_function, **kwargs)[source]

Perform an image crop based on some function.

Parameters
  • crop_function (callable) – The function to crop the data.

  • **kwargs (dict) – The crop function keyword arguments.

property initial_std_devs

Get the standard deviation values of the original raw image array.

Returns

Standard deviation values of image.

Return type

array_like

property nominal_values

Get the nominal values of the image array.

Returns

Nominal values of image.

Return type

array_like

property shape

Array shape

Returns

The shape of the image.

Return type

tuple of int

sum()[source]

Perform a summation on the image’s array.

Returns

A tuple taking the form (summed_intensity, summed_intensity_e).