peak_to_pixels#

anri.fwd.peak_to_pixels(centroid, erf_scale, amplitude, bins, window_sizes)[source]#

Compute the intensity of a single Gaussian peak over a local pixel window.

Parameters:
  • centroid (Array) – [n] centroid of the Gaussian peak in (slow, fast, omega[, dty]) coordinates.

  • erf_scale (Array) – [n] per-axis scaling factors \(s_i = \frac{1}{\sigma_i\sqrt{2}}\) precomputed by prepare_gaussian_bin().

  • amplitude (float) – Integrated intensity of the peak.

  • bins (tuple[Array, ...]) – Tuple of n coordinate arrays giving bin centres along each of (slow, fast, omega[, dty]). Bin half-widths \(h_i\) are derived from the spacing of each array as \(h_i = (b_i[1] - b_i[0]) / 2\), so uniform spacing per axis is assumed.

  • window_sizes (tuple[int, ...]) – Number of bins along each axis, one per axis. Each entry must not exceed the length of the corresponding bin array. Static for JIT and vmap compilation.

Returns:

  • intensities (jax.Array) – Dense block of integrated intensities scaled by amplitude, with shape window_sizes.

  • starts (jax.Array) – [n] start indices locating the window within each axis of bins, for scattering the output back into a global array.

Notes

A local window of window_sizes[i] bins is extracted around centroid along each axis i via jax.lax.dynamic_slice(). The resulting local bin centres are assembled into an [prod(window_sizes), n] grid and passed to sample_gaussian_bins() — see that function for the underlying maths.

See also

prepare_gaussian_bin

Precomputes \(s_i\) from a covariance matrix.

sample_gaussian_bins

Core bin-integration function called internally.

peaks_to_pixels

Vectorised form of this function over a batch of peaks.