calibration Module

Demos

This is the module for calibration functions and data

skxray.calibration.estimate_d_blind(name, wavelength, bin_centers, ring_average, window_size, max_peak_count, thresh)

Estimate the sample-detector distance

Given a radially integrated calibration image return an estimate for the sample-detector distance. This function does not require a rough estimate of what d should be.

For the peaks found the detector-sample distance is estimated via .. math

D = \frac{r}{\tan 2\theta}

where \(r\) is the distance in mm from the calibrated center to the ring on the detector and \(D\) is the distance from the sample to the detector.

Parameters:

name : str

The name of the calibration standard. Used to look up the expected peak location For valid options, see the name attribute on this function

wavelength : float

The wavelength of scattered x-ray in nm

bin_centers : array

The distance from the calibrated center to the center of the ring’s annulus in mm

ring_average : array

The average intensity in the given ring of a azimuthally integrated powder pattern. In counts [arb]

window_size : int

The number of elements on either side of a local maximum to use for locating and refining peaks. Candidates are identified as a relative maximum in a window sized (2*window_size + 1) and the same window is used for fitting the peaks to refine the location.

max_peak_count : int

Use at most this many peaks

thresh : float

Fraction of maximum peak height

Returns:

dist_sample : float

The detector-sample distance in mm. This is the mean of the estimate from all of the peaks used.

std_dist_sample : float

The standard deviation of d computed from the peaks used.

skxray.calibration.refine_center(image, calibrated_center, pixel_size, phi_steps, max_peaks, thresh, window_size, nx=None, min_x=None, max_x=None)

Refines the location of the center of the beam.

This relies on being able to see the whole powder pattern.

Parameters:

image : ndarray

The image

calibrated_center : tuple

(row, column) the estimated center

pixel_size : tuple

(pixel_height, pixel_width)

phi_steps : int

How many regions to split the ring into, should be >10

max_peaks : int

Number of rings to look it

thresh : float

Fraction of maximum peak height

window_size : int, optional

The window size to use (in bins) to use when refining peaks

nx : int, optional

Number of bins to use for radial binning

min_x : float, optional

The minimum radius to use for radial binning

max_x : float, optional

The maximum radius to use for radial binning

Returns:

calibrated_center : tuple

The refined calibrated center.