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:
Returns:

result (dict) – Per checked peak: “entry”, “hkl” (row of hkls) 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)