Check out the Hyperspy Workshop May 13-17, 2024 Online

Calibration#

class pyxem.utils.calibration.Calibration(signal)[source]#

Bases: object

This is a class to hold the calibration parameters for some dataset and the methods for calibrating the dataset.

It is designed to hold information about the affine transformation and the mask to apply to the data for something like a beam stop.

There are 2 ways to set the calibration: 1. You can set the calibration with a known reciprocal space pixel size. This will assume

a flat ewald sphere.

  1. You can set the calibration directly with a known real pixel size, beam energy/wavelength, and detector distance. This is the most accurate method but requires detailed calibration information that is not trivial to acquire. In most cases option 1 is sufficient.

If you set the pixel size with hyperSpy.axes_manager.signal_axes[0].scale = 0.1 it will default to the first method. The underlying data will be stored in the metadata of the signal to be used later.

Attributes

Calibration.affine

Set the affine transformation to apply to the data.

Calibration.axes

Calibration.beam_energy

Calibration.center

Return the center in pixels

Calibration.detector_gain

Calibration.flat_ewald

If the ewald sphere is flat return True

Calibration.mask

Set the mask to apply to the data.

Calibration.pixel_extent

Return an array with axes [x/y, left/right, pixel_extent], as follows:

Calibration.scale

Return the scale in pixels

Calibration.shape

Calibration.units

Calibration.wavelength

Methods

Calibration.detector(pixel_size, ...[, ...])

Calibrate the signal with a known pixel size, detector distance, and beam energy/wavelength.

Calibration.get_slices1d(npt[, radial_range])

Get the slices and factors for some image that can be used to slice the image for 1d integration.

Calibration.get_slices2d(npt, npt_azim[, ...])

Get the slices and factors for some image that can be used to slice the image for 2d integration.

Calibration.to_pyfai()

Convert the calibration to a pyfai AzimuthalIntegrator.

Examples using Calibration#

Azimuthal Integration (in Pyxem!)

Azimuthal Integration (in Pyxem!)

Creating Interactive Virtual Images

Creating Interactive Virtual Images

Other Virtual Imaging

Other Virtual Imaging