Skip to main content

Library for opening Nalu Scientific data files

Project description

NaluACQ

naluacq is a Rust crate for I/O with Nalu Scientific acquisitions in the GbE-compatible format.

The crate encompasses the following:

  • Reading acquisitions
  • Writing acquisitions (mainly used by naludaq_rs)
  • Parsing events from acquisitions
  • Calibration of events
  • Exporting acquisitions to other formats

Some of these features are made available in the Python (PyO3) bindings for this crate.

Structure of Acquisitions

An acquisition in the new format is a directory containing multiple files describing various aspects of the acquisition.

  • {n}.bin - binary event data file "n" (up to 500 MB) containing raw events back-to-back
  • {n}.idx - index file containing the offset and length of each event in the corresponding .bin file
  • metadata.yml - user-defined string metadata. NaluDAQ uses this to store board parameters and registers.
  • readout_metadata - more user-defined binary metadata. NaluDAQ uses this for extra information about the readout.
  • [pedestals_calibration] - optional binary file containing pedestal calibration data
  • [timing_calibration] - optional binary file containing timing calibration data
  • [adc2mv_calibration] - optional binary file containing ADC to mV calibration data

Event Storage

Events are stored in groups of 500 MB maximum known as "chunks." Each chunk is represented using two files: a .bin file which contains the raw event data and an .idx file which points to each event in the .bin file.

Bin File

Events are stored back-to-back in the .bin files as unparsed binary data. A maximum of 500 MB (at the time of writing) is allowed to be stored in a single .bin file. The rough structure is as follows:

  1. Metadata Sector
    • 8-byte header indicating file version type and sector length
    • user-defined metadata stored as raw bytes
  2. Data Sector
    • Event 1 (raw bytes)
    • Event 2 (raw bytes)
    • ...

Idx File

Because searching through the entire file for a specific event would be painfully slow, an index file is used to store the offset and length of each event in the corresponding .bin file. The index file is comprised of several 8-byte entries, each indicating the offset and length of a single event in the .bin file. A specific event can be found by reading the entry at 8 * index bytes and then reading length bytes from the .bin file starting at offset bytes.

Examples

Reading an Acquisition

use naluacq::Acquisition;

let acq = Acquisition::open("path/to/acquisition.acq").unwrap();

let idx = 0;
let raw_event = acq.get(idx).unwrap()

Parsing an Acquisitions

use naluacq::{Acquisition, Aardvarcv3Event, ParseInto};

let acq = Acquisition::open("path/to/acquisition.acq").unwrap();

let idx = 0;
let raw_event = acq.get(idx).unwrap()

let parsed_event: Aardvarcv3Event = raw_event.parse_into().unwrap();

Building the Documentation

cargo doc --open

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

naluacq-0.4.6-cp313-cp313-win_amd64.whl (523.8 kB view details)

Uploaded CPython 3.13Windows x86-64

naluacq-0.4.6-cp312-cp312-win_amd64.whl (523.8 kB view details)

Uploaded CPython 3.12Windows x86-64

naluacq-0.4.6-cp311-cp311-win_amd64.whl (523.9 kB view details)

Uploaded CPython 3.11Windows x86-64

naluacq-0.4.6-cp310-cp310-win_amd64.whl (523.9 kB view details)

Uploaded CPython 3.10Windows x86-64

naluacq-0.4.6-cp39-cp39-win_amd64.whl (524.4 kB view details)

Uploaded CPython 3.9Windows x86-64

naluacq-0.4.6-cp38-cp38-win_amd64.whl (524.4 kB view details)

Uploaded CPython 3.8Windows x86-64

File details

Details for the file naluacq-0.4.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: naluacq-0.4.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 523.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.6

File hashes

Hashes for naluacq-0.4.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 888a1de7d6c4e811479002c28534101276670ebb0708ae6a78b70c6809795856
MD5 3fa25db0f918a61de1c41e41baa1c7cb
BLAKE2b-256 83159eb9ec9bc6e0e51c778806487d9f5b4173a511b17f86bac79cb5a4db378c

See more details on using hashes here.

File details

Details for the file naluacq-0.4.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: naluacq-0.4.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 523.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.6

File hashes

Hashes for naluacq-0.4.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3b83e1102ad7aa73da0429d18c43059ea2e0c0cb8f15aedef598be8147e00432
MD5 319856b056edca5f29159943d8d5c8d2
BLAKE2b-256 c17efa2e4f7a0f6d2aa14af73e691401a5fc737e09807ba94dd89895dffe16f6

See more details on using hashes here.

File details

Details for the file naluacq-0.4.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: naluacq-0.4.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 523.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.6

File hashes

Hashes for naluacq-0.4.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a5ae5131b95dfc47416b1c2fb1a8f409d8128ef851ea11e54ed98247db9b43d1
MD5 dcefbae5c45edaa2a80bdbf7bed82d8e
BLAKE2b-256 13e2252e315b5d12f30e86dc9bf8df1b10c636c5d69e94242de7282d468af388

See more details on using hashes here.

File details

Details for the file naluacq-0.4.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: naluacq-0.4.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 523.9 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.6

File hashes

Hashes for naluacq-0.4.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c2c966db8599e01c678bce05ff6dc99ff502ff6d4fb59e08ce68b309e5cf5dfc
MD5 f3bc52ec2e5276c8d14fecf82d83f9e6
BLAKE2b-256 2ddba44737a7ece9c9cd32785a2a2dbe54ab5a0ac8357d49508d9b9a801093eb

See more details on using hashes here.

File details

Details for the file naluacq-0.4.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: naluacq-0.4.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 524.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.6

File hashes

Hashes for naluacq-0.4.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e93131eb89cd5e8b2854cdf9d9903bda911966580f8cf9950e9d822f54bb9e44
MD5 47648cdcd1a7db8aee2a1f5d61f84479
BLAKE2b-256 4b5727ee4feee192c7727c66bf0d5810d44b90cd4e32f3add83344cfee76295d

See more details on using hashes here.

File details

Details for the file naluacq-0.4.6-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: naluacq-0.4.6-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 524.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.6

File hashes

Hashes for naluacq-0.4.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 addad6fb9ebab7db2dc26da1422ea405d6058b06f5b3ec9a256333176391c1f4
MD5 eb4fdd0280f87f651f5c4cd0cfdaa493
BLAKE2b-256 5916b1216b7c9dbd2be45e110b0769e07d9d24a3160b88a3b4dab472da4439bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page