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.7-cp313-cp313-win_amd64.whl (523.7 kB view details)

Uploaded CPython 3.13Windows x86-64

naluacq-0.4.7-cp312-cp312-win_amd64.whl (523.7 kB view details)

Uploaded CPython 3.12Windows x86-64

naluacq-0.4.7-cp311-cp311-win_amd64.whl (523.8 kB view details)

Uploaded CPython 3.11Windows x86-64

naluacq-0.4.7-cp310-cp310-win_amd64.whl (523.8 kB view details)

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for naluacq-0.4.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f7eb6b021611ec3a48974d2ccb06d434b5acf8abb033a13fe06e82cf6b78cbb0
MD5 db5d1450069f75edb193b264e60f7f4d
BLAKE2b-256 d66bbd50ed860026d7187f2030adcfe8c6d645413795da7ad3ef13d9869c0009

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for naluacq-0.4.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3359cb7b3070c934e47ef040f7b87d1dca82f624eb66561bd04788d68b65404e
MD5 b93439f921135d9c799079d3b973c241
BLAKE2b-256 e52d3e70fd613cc5d04bbb2909d66c353688bcd0e1f0fe25663973205980987a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for naluacq-0.4.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4ab2db893f0e676eef567d507b1cddb6de15ca708b70e22926f92f22a9d4cd01
MD5 05fe96e6c8bafa7e65c66ab7b252b85d
BLAKE2b-256 549cc59350a00d54f883903b113668bc77ee48663741a1a89d8256488d71d45f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for naluacq-0.4.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b0e3a2acce9e0a413e490797db4bce07a223baa6224449479312ff76cc133397
MD5 b795c93ec18279ad3590a0419eb400ac
BLAKE2b-256 4843af78f59f700d5be464eb864cbf838763922d18eb8ef5245d4fba969ca873

See more details on using hashes here.

File details

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

File metadata

  • Download URL: naluacq-0.4.7-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.7

File hashes

Hashes for naluacq-0.4.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 7f776e5c00343c2ffe6372cc3b805c63b9b981661fbe9d77f9eac8b986006c37
MD5 d91ab20c411d4fd3c0050d3a69c4618c
BLAKE2b-256 33285a6aa026f55ee17a0a429265026453790c1a9a6ab8ad6c626fa4258fcf97

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