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 of ybinedges. 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’s omega

  • frame_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’s omega

  • ybinedges (Array | ndarray | bool | number | bool | int | float | complex) – [n + 1] dty bin edges of the rows (the DataSet’s ybinedges)

  • gridstep (int) – Rows summed in groups of this, as in the histogram

  • om0 (float) – The histogram’s first omega bin edge, bin width and number of bins

  • b_o (float) – The histogram’s first omega bin edge, bin width and number of bins

  • n_o (int) – The histogram’s first omega bin edge, bin width and number of bins

  • dty0 (float) – The histogram’s rows: row k is nominally at dty0 + k ystep

  • ystep (float) – The histogram’s rows: row k is nominally at dty0 + k ystep

  • bin_dty (Array | ndarray | bool | number | bool | int | float | complex | None, default: None) – [rows, frames] the dty each frame was binned by (e.g. frame_dty itself when frames are binned by their own dty); default each row’s mean of frame_dty

  • return_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 frames

  • exposure (np.ndarray) – [n_rows, n_o], if return_exposure