ess.reduce.live.raw.Histogrammer#
- class ess.reduce.live.raw.Histogrammer(coords, edges)[source]#
Histogrammer for a detector view.
The histogrammer is used to project the detector data onto a different coordinate system. This class implements the common logic for different projections. For each concrete projection a setup mechanism computes relevant coordinates. This is done, e.g., in
project_xy()
andproject_onto_cylinder()
.Methods
__init__
(coords, edges)apply_full
(var)Apply the histogrammer to a variable using all replicas.
from_coords
(coords, resolution)Create a histogrammer from coordinates and resolution.
Return an array with input indices corresponding to each histogram bin.
Attributes
replicas
- apply_full(var)[source]#
Apply the histogrammer to a variable using all replicas.
This is used for one-off operations where the full data is needed, e.g., for transforming pixel weights. Compare to
__call__()
, which applies the histogrammer to a single replica for efficiency.- Return type:
- static from_coords(coords, resolution)[source]#
Create a histogrammer from coordinates and resolution.
- Parameters:
coords (
live.raw.ProjectedCoords
(scipp.DataGroup
)) – Coordinates to use for histogramming. May contain more than the dimensions used for histogramming.resolution (
live.raw.DetectorViewResolution
(dict
)) – Resolution to use for histogramming. The keys are the dimensions to histogram, and the values are the number of bins to use. The order of the dimensions is preserved in the output and thus controls which axis is which in a plot.
- Return type: