dty_offsets#
- anri.index.dty_offsets(frame_dty, frame_omega, ybinedges, gridstep, om0, b_o, n_o, dty0, ystep, bin_dty=None, return_exposure=False)[source]#
Each histogram row’s dty, per omega bin, less its nominal dty: where the beam really was.
A row is the frames whose dty, as
anri.io.stream_sparse()binned them (bin_dty; default each DataSet row’s mean dty, as when it bins by the DataSet’s dty), falls in one bin ofybinedges. In a step scan every frame of a row is at the row’s dty and the offsets are 0. In a fly or helical scan dty moves while omega turns (e.g. one dty step per turn): the frames of one omega bin were taken at a dty up to half a step away from the row’s.anri.index.system()uses the offsets (scan["ddty"]) to put each voxel in the rows that really saw it.- Parameters:
frame_dty (
Array|ndarray|bool|number|bool|int|float|complex) – [rows, frames] each frame’s dty and omega, e.g.anri.io.read_frame_dty()and the DataSet’somegaframe_omega (
Array|ndarray|bool|number|bool|int|float|complex) – [rows, frames] each frame’s dty and omega, e.g.anri.io.read_frame_dty()and the DataSet’somegaybinedges (
Array|ndarray|bool|number|bool|int|float|complex) – [n + 1] dty bin edges of the rows (the DataSet’sybinedges)gridstep (
int) – Rows summed in groups of this, as in the histogramom0 (
float) – The histogram’s first omega bin edge, bin width and number of binsb_o (
float) – The histogram’s first omega bin edge, bin width and number of binsn_o (
int) – The histogram’s first omega bin edge, bin width and number of binsdty0 (
float) – The histogram’s rows: row k is nominally at dty0 + k ystepystep (
float) – The histogram’s rows: row k is nominally at dty0 + k ystepbin_dty (
Array|ndarray|bool|number|bool|int|float|complex|None, default:None) – [rows, frames] the dty each frame was binned by (e.g.frame_dtyitself when frames are binned by their own dty); default each row’s mean offrame_dtyreturn_exposure (
bool, default:False) – Also return each (row, omega bin)’s exposure: its frames over the usual number (the median over bins with frames). Binned by their own dty, a helical scan’s frames give some bins none and some two rotations’ worth; the model must know (scan["exposure"])
- Returns:
offsets (
np.ndarray) – [n_rows, n_o] mean dty of the frames in each (row, omega bin) less dty0 + k ystep; 0 where no framesexposure (
np.ndarray) – [n_rows, n_o], if return_exposure