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.

Module Contents

Classes

Scan

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

Scan2D

Attributes:
data (islatu.data.Data):

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

metadata (islatu.metadata.Metadata):

This scan’s metadata.

images (list of islatu.image.Image):

The detector images in the given scan.

API

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

Bases: islatu.data.MeasurementBase

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

Initialization

subsample_q(q_min=0, q_max=float('inf'))

Delete data points less than q_min and more than q_max.

Args:
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(overwrite_transmission=None)

Perform the transmission correction.

qdcd_normalisation(itp)

Perform normalisation by DCD variance.

Args:
itp (tuple): Containing interpolation knots

(array_like), B-spline coefficients (array_like), and degree of spline (int).

footprint_correction(beam_width, sample_size)

Class method for islatu.corrections.footprint_correction().

Args:

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.

class scan.Scan2D(data: islatu.data.Data, metadata: islatu.metadata.Metadata, images: List[islatu.image.Image], remove_indices=None)

Bases: scan.Scan

Attributes:
data (islatu.data.Data):

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

metadata (islatu.metadata.Metadata):

This scan’s metadata.

images (list of islatu.image.Image):

The detector images in the given scan.

Initialization

crop(crop_function, **kwargs)

Crop every image in images according to crop_function.

args:
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.

bkg_sub(bkg_sub_function, **kwargs)

Perform background substraction for each image in a Scan.

Args:
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.

remove_data_points(indices)

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

Args:
indices:

The indices to be removed.