pyextal.hdf5io.raw

Raw LARBED measurement and pre-refinement results: /raw and /pre_refinement.

Classes

Functions

save_raw(h5path, dp, variance, g_vectors, *[, prefix, ...])

Write raw LARBED measurement into /raw of an HDF5 file.

save_pre_refinement(h5path, roi, fine, g_include)

Write pre-refinement outputs from a LARBEDROI + FineOptimize run to HDF5.

load_pre_refinement(h5path)

Load pre-refinement outputs.

Module Contents

class pyextal.hdf5io.raw.PreRefinementResult

Bases: tuple

simgrid
templates
variance
roi_regions
geometry
g_include
grid_shape
pyextal.hdf5io.raw.save_raw(h5path, dp, variance, g_vectors, *, prefix='', crystal_dat='', date='')

Write raw LARBED measurement into /raw of an HDF5 file.

Parameters:
  • h5path (path-like)

  • dp ((n_beams, ny, nx) array)

  • variance ((n_beams, ny, nx) array)

  • g_vectors ((n_beams, 3) int array — Miller indices)

  • prefix (optional provenance strings. When) – crystal_dat names an existing file its text is embedded as /crystal_dat (see store_dat) and the attr holds its name.

  • crystal_dat (optional provenance strings. When) – crystal_dat names an existing file its text is embedded as /crystal_dat (see store_dat) and the attr holds its name.

  • date (optional provenance strings. When) – crystal_dat names an existing file its text is embedded as /crystal_dat (see store_dat) and the attr holds its name.

pyextal.hdf5io.raw.save_pre_refinement(h5path, roi, fine, g_include)

Write pre-refinement outputs from a LARBEDROI + FineOptimize run to HDF5.

Replaces the 6 np.save calls in the notebook export cell. The arrays are stored in 2D spatial form (n_rows, n_cols) so the file is self-describing.

Parameters:
  • h5path (path-like)

  • roi (LARBEDROI (must have had selectROI called — simGrid, templates, variance present))

  • fine (FineOptimize (must have been run — fine.thickness, fine.errorFunc.scale/.background))

  • g_include (list of (h,k,l) tuples — the reflections included in the ROI)

pyextal.hdf5io.raw.load_pre_refinement(h5path)

Load pre-refinement outputs.

Returns:

simgrid (n_rows, n_cols, 3) templates (n_beams, n_rows, n_cols) variance (n_beams, n_rows, n_cols) roi_regions (n_regions, 4, 2) geometry dict — thickness, scale, background, gl, rotation, allshift g_include (n_beams, 3) int array grid_shape (n_rows, n_cols)

Return type:

PreRefinementResult namedtuple with fields