check_render#
- anri.fwd.check_render(entries, hkls, geom, row, det_shape, window=(3, 7, 7), n_peaks=100, n_samples=100000, n_entries=1000, seed=0)[source]#
Check rendered peaks against a Monte Carlo simulation of the beam spreads.
For a random sample of peaks of the row, samples wavelength, ky and kz from their Gaussian spreads, pushes every sample through the forward model (with the voxel at its real position), adds the detector point spread and the renderer’s variance floor, and histograms the (slow, fast, omega) positions into the peak’s window cells.
render_peaks()linearises the forward model and integrates the resulting Gaussian over the cells approximately, so this checks both approximations, for your own map and geometry.Only peaks whose whole window is on the detector and inside the scan are compared.
- Parameters:
entries (
dict) – As forrender_row()hkls (
ndarray) – As forrender_row()geom (
dict) – As forrender_row()row (
dict) – As forrender_row()det_shape (
tuple[int,int]) – As forrender_row()window (
tuple[int,int,int], default:(3, 7, 7)) – As forrender_row()n_peaks (
int, default:100) – Number of peaks to checkn_samples (
int, default:100000) – Monte Carlo samples per peak. The noise in a cell’s fraction is about sqrt(fraction / n_samples).n_entries (
int, default:1000) – Number of map entries to pick peaks from, at randomseed (
int, default:0) – Random seed
- Returns:
result (
dict) – Per checked peak: “entry”, “hkl” (row ofhkls) and “branch” (0 for etasign +1), “max_cell_error” (largest absolute difference between rendered and Monte Carlo fraction of the peak in any cell), “captured” (fraction of the rendered Gaussian inside the window) and “captured_mc” (fraction of the Monte Carlo samples inside it)