A python library to parse ADC64-formatted files
Project description
This is a script and library to help interfact with the ADC64 format.
To install:
pip install adc64format
To dump the contents of a single ADC64 file to an HDF5 format:
adc64_to_hdf5.py <input ADC64 file>.data <output HDF5 file>.h5
To use interactively or within another python codebase:
from adc64format import dtypes, skip_chunks, parse_chunk, ADC64Reader # Option 1: Parse a single event from an ordinary file object with open('<ADC64 file>.data', 'rb') as f: # Load the first event chunk = parse_chunk(f) # Look at chunk data (as numpy arrays) for key in dtypes: print(chunk[key]) # Skip N events n = 100 skip_chunks(f, n) chunk = parse_chunk(f) # Option 2: Parse events from multiple files and align by timestamp with ADC64Reader('<ADC 64 file from ADC 0>.data', '<ADC 64 file from ADC 1>.data', ...) as reader: batch_size = 10 # how many events to load on each iteration events = reader.next(batch_size) # get matched events between multiple files events_file0, events_file1, ... = events # Look at data for key in dtypes: print(events_file0[key])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
adc64format-0.0.3.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for adc64format-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60e7d09cbc95a096cba3a6aea2ab9abfaa6ef5663a69e9d0cf8f116c924cd4e7 |
|
MD5 | 3de75d4af21a7fc4b522798f022c715d |
|
BLAKE2b-256 | ef836c10ea7e239c179c62b7d19c7ba8fce54aa924ca3f8b641f7b9318b39f67 |