core Module

Helper Classes

Dictionary-like classes

MD_dict([md_dict]) A class to make dealing with the meta-data scheme for DataExchange easier
verbosedict A sub-class of dict which raises more verbose errors if a key is not found.
RCParamDict() A class to make dealing with storing default values easier.

Image warping functions

img_to_relative_xyi(img, cx, cy[, ...]) Convert the 2D image to a list of x y I coordinates where
pixel_to_radius(shape, calibrated_center[, ...]) Converts pixel positions to radius from the calibrated center
pixel_to_phi(shape, calibrated_center[, ...]) Converts pixel positions to \(\phi\), the angle from vertical.

Image pre-processing

img_subtraction_pre

Histograms and Integration

Binning

bin_1D(x, y[, nx, min_x, max_x]) Bin the values in y based on their x-coordinates
wedge_integration(src_data, center, ...) Implementation of caking.
grid3d(q, img_stack[, nx, ny, nz, xmin, ...]) Grid irregularly spaced data points onto a regular grid via histogramming

Utility functions

bin_edges([range_min, range_max, nbins, step]) Generate bin edges.
bin_edges_to_centers(input_edges) Helper function for turning a array of bin edges into

Helper functions

pairwise(iterable) s -> (s0,s1), (s1,s2), (s2, s3), ...

Physical relations

q_to_d(q) Helper function to convert \(d\) to \(q\).
d_to_q(d) Helper function to convert \(d\) to \(q\).
q_to_twotheta(q, wavelength) Helper function to convert \(q\) + \(\lambda\) to \(2\theta\).
twotheta_to_q(two_theta, wavelength) Helper function to convert \(2\theta\) + \(\lambda\) to \(q\).