write_scan#

anri.io.write_scan(hout, scan, frame, pixel, value, omega, dty, det_shape, cut=1, omega_motor='rot_center', dty_motor='dty')[source]#

Write one dty row of sparse pixels as an ImageD11 scan group.

Values are rounded to integer counts and only counts > cut are kept, as ImageD11’s segmenter does. Pixels must be sorted by (frame, pixel), as anri.fwd.render_row() returns them.

Parameters:
  • hout (File) – Open, writable HDF5 file

  • scan (str) – Group name, e.g. “1.1”

  • frame (ndarray) – Sparse pixels: frame index within the row, pixel = slow * n_fast + fast, and intensity

  • pixel (ndarray) – Sparse pixels: frame index within the row, pixel = slow * n_fast + fast, and intensity

  • value (ndarray) – Sparse pixels: frame index within the row, pixel = slow * n_fast + fast, and intensity

  • omega (ndarray) – [n_frames] motor positions of the row

  • dty (ndarray) – [n_frames] motor positions of the row

  • det_shape (tuple[int, int]) – (n_slow, n_fast)

  • cut (float, default: 1) – Keep counts strictly above this

  • omega_motor (str, default: 'rot_center') – Motor names, which must match the DataSet’s omegamotor and dtymotor

  • dty_motor (str, default: 'dty') – Motor names, which must match the DataSet’s omegamotor and dtymotor

Returns:

n_pixels (int) – Number of pixels written