islatu.scan

This module contains the Scan and Scan2D classes. A Scan is a measurement and so inherits from MeasurementBase. An instance of Scan contains scan metadata, as well as a suite of methods useful for data correction, uncertainty calculations and the like.

A Scan2D is a Scan whose Data object’s intensity values are computed from an image captured by an area detector. Many of Scan’s methods are overloaded to make use of the additional information provided by the area detector, and extra image manipulation methods are included in Scan2D.

class islatu.scan.Scan(data: Data, metadata: Metadata)[source]

Bases: MeasurementBase

A class used to store reflectometry scans taken with a point detector.

footprint_correction(beam_width, sample_size)[source]

Class method for islatu.corrections.footprint_correction().

Parameters
  • beam_width (float) – Width of incident beam, in metres.

  • sample_size (uncertainties.core.Variable) – Width of sample in the dimension of the beam, in metres.

  • theta (float) – Incident angle, in degrees.

qdcd_normalisation(itp)[source]

Perform normalisation by DCD variance.

Parameters

itp (tuple) – Containing interpolation knots (array_like), B-spline coefficients (array_like), and degree of spline (int).

subsample_q(q_min=0, q_max=inf)[source]

Delete data points less than q_min and more than q_max.

Parameters
  • q_min – The minimum q to be included in this scan. Defaults to 0 Å.

  • q_max – The maximum q to be included in this scan. Defaults to inf Å.

transmission_normalisation()[source]

Perform the transmission correction.

class islatu.scan.Scan2D(data: Data, metadata: Metadata, images: List[Image])[source]

Bases: Scan

data

The intensity as a function of Q data for this scan.

Type

islatu.data.Data

metadata

This scan’s metadata.

Type

islatu.metadata.Metadata

images

The detector images in the given scan.

Type

list of islatu.image.Image

bkg_sub(bkg_sub_function, **kwargs)[source]

Perform background substraction for each image in a Scan.

Parameters
  • bkg_sub_function (callable) – Background subtraction function to be used.

  • kwargs (dict, optional) – Keyword arguments for the background subtraction function. Defaults to None.

  • progress (bool, optional) – Show a progress bar. Requires the tqdm package. Defaults to True.

crop(crop_function, **kwargs)[source]

Crop every image in images according to crop_function.

Parameters
  • crop_function (callable) – Cropping function to be used.

  • kwargs (dict, optional) – Keyword arguments for the cropping function. Defaults to None.

  • progress (bool, optional) – Show a progress bar. Requires the tqdm package. Defaults to True.

remove_data_points(indices)[source]

Convenience method for the removal of specific data points by their indices.

Parameters

indices – The indices to be removed.