ImageD11.sinograms.polefigures module#

WARNING: work in progress

ImageD11.sinograms.polefigures.calc_dty(ds, voxel_mask, omega1, omega2, y0)#

Convert the calculated omega values into the dty motor position that would have put each voxel on the beam at that omega, so they can be overlaid on the measured (omega, dty) sinogram.

ImageD11.sinograms.polefigures.calc_gve_angles(pmap, hkls, pars)#

For every indexed voxel of a point-by-point map (pmap), use its best UBI matrix to predict where each of hkls should diffract to.

Returns voxel_mask, selecting the indexed voxels out of pmap’s 2D voxel grid, together with the calculated (tth, eta, omega). Each hkl has two solutions (a Friedel pair), so eta and omega each come back as a pair of arrays (eta1, eta2) / (omega1, omega2), shaped (n_indexed_voxels, len(hkls)).

ImageD11.sinograms.polefigures.main(pars, dataset)#
ImageD11.sinograms.polefigures.plot_ring_polefigures(ref_ucell, mults, eta1, eta2, omega1, omega2, cf_2d, ds_tol=0.005, bin_deg=1.0, ds=None)#

For each ring described by mults, compare the (eta, omega) pole figure forward-simulated from the point-by-point map (every indexed voxel’s best UBI, projected through hkl) against the measured 2D peaks lying close to that ring’s d-spacing.

bin_deg sets the (eta, omega) histogram bin width in degrees - a finer bin_deg gives sharper pole figure spots but needs more indexed voxels per spot to show up. dataset.ostep (the scan’s angular step) is a natural alternative choice.

ds (a DataSet) sets the omega range from ds.obinedges; without it the range of the observed cf_2d.omega is used.

ImageD11.sinograms.polefigures.plot_ring_sinograms(ds, cf_2d, ref_ucell, mults, omega1, omega2, dty1, dty2, ds_tol=0.005, omega_step=5)#

For each ring described by mults, compare the (omega, dty) sinogram of the calculated peaks (from the point-by-point map) against the measured 2D peaks lying close to that ring’s d-spacing.

ImageD11.sinograms.polefigures.ring_hkls(ucell, dsmax, n_rings=None)#

List the powder rings of ucell out to dsmax (in 1/d), with their multiplicities.

hkls come back ring-by-ring, so a per-ring block of hkls can be recovered from mults (e.g. with np.cumsum(mults)). Pass n_rings to keep only the first n_rings low-angle rings (dsmax must still be large enough to reach them).

class ImageD11.sinograms.polefigures.splatter(parfile, dxfile='/data/id11/nanoscope/Eiger/spatial_20210415_JW/e2dx.edf', dyfile='/data/id11/nanoscope/Eiger/spatial_20210415_JW/e2dy.edf')#

Bases: object

splats pixels onto polefigures

process(dsfile)#
ImageD11.sinograms.polefigures.wrap_omega(omega, lo)#

Map omega (degrees) into [lo, lo+360). Circular, not a linear shift.