Open xrif archives from Python directly using the xrif library.
from fixr import xrif2numpy
import logging
logging.basicConfig(level='DEBUG')
fh = open('example_data/camwfs_20240315225750994842000.xrif', 'rb')
data = xrif2numpy(fh)which will print something like
DEBUG:fixr:xrif compression details:
difference method: previous
reorder method: bytepack
compression method: LZ4
LZ4 acceleration: 1
dimensions: 120 x 120 x 1 x 512
raw size: 14745600 bytes
encoded size: 7446095 bytes
ratio: 0.505
The file ends with the timing information for the frames, stored as a separate xrif section:
timings = xrif2numpy(fh)Each row contains the frame index, acquisition timestamp (as integer seconds and integer nanoseconds), and write timestamp (again as two integers).
>>> timings.shape
(787, 1, 1, 5)
>>> timings.dtype
dtype('uint64')
For an example that uses the C xrif lib more directly, see minimal_ex.py.
- Fix macOS-ism (using
.dylibinstead of.soto load library) - Declare NumPy >= 2.0 dependency
- Update various bits of CI machinery
- Initial release