skxray.core.grid3d

skxray.core.grid3d(q, img_stack, nx=None, ny=None, nz=None, xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None, binary_mask=None)

Grid irregularly spaced data points onto a regular grid via histogramming

This function will process the set of reciprocal space values (q), the image stack (img_stack) and grid the image data based on the bounds provided, using defaults if none are provided.

Parameters:

q : ndarray

(Qx, Qy, Qz) - HKL values - Nx3 array

img_stack : ndarray

Intensity array of the images dimensions are: [num_img][num_rows][num_cols]

nx : int, optional

Number of voxels along x

ny : int, optional

Number of voxels along y

nz : int, optional

Number of voxels along z

xmin : float, optional

Minimum value along x. Defaults to smallest x value in q

ymin : float, optional

Minimum value along y. Defaults to smallest y value in q

zmin : float, optional

Minimum value along z. Defaults to smallest z value in q

xmax : float, optional

Maximum value along x. Defaults to largest x value in q

ymax : float, optional

Maximum value along y. Defaults to largest y value in q

zmax : float, optional

Maximum value along z. Defaults to largest z value in q

binary_mask : ndarray, optional

The binary mask provides a mechanism to remove unwanted pixels from the images. Binary mask can be two different shapes. - 1: 2-D with binary_mask.shape == np.asarray(img_stack[0]).shape - 2: 3-D with binary_mask.shape == np.asarray(img_stack).shape

Returns:

mean : ndarray

intensity grid. The values in this grid are the mean of the values that fill with in the grid.

occupancy : ndarray

The number of data points that fell in the grid.

std_err : ndarray

This is the standard error of the value in the grid box.

oob : int

Out Of Bounds. Number of data points that are outside of the gridded region.

bounds : list

tuple of (min, max, step) for x, y, z in order: [x_bounds, y_bounds, z_bounds]