Skip to main content

This is a script and library to help interfact with the ADC64 format.

To install:

pip install adc64format

## mpd format (new) To use interactively or within another python codebase:

from adc64format import mpd_parse_chunk, mpd_parse_run_start, MPDReader

input_file = adc64format.MPDReader(input_filename,n_adcs)
input_file.open()

# Read run info
_, nbytes_runinfo, runinfo = adc64format.mpd_parse_run_start(input_file.stream)
# use the first file for the event reference
_, chunk_size, test_event = adc64format.mpd_parse_chunk(input_file.stream)

events = input_file.next(batch_size)
print(events.keys())

## adc64 format (old)

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])

Metadata

Release files for adc64format 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adc64format 0.1.2
File Size Uploaded
adc64format-0.1.2.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adc64format 0.1.2
File Interpreter ABI Platform
adc64format-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 21.5 kB

Release files / adc64format-0.1.2.tar.gz

Download URL adc64format-0.1.2.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1323c59b8ca291047c7a6a27a4f361dd12fb828706087b038a70b107e97813be
BLAKE2b-256 checksum
How to use checksums
fcc6e342ccd7c6c414b4974c9d69b0747c5e67c158def30b70068a6cf904b844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7

Release files / adc64format-0.1.2-py3-none-any.whl

Download URL adc64format-0.1.2-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4697f5922ce87ce60eb24bf5afcee4f47646a459f470a1690a1f65ab2f2a5a3e
BLAKE2b-256 checksum
How to use checksums
7403129b2dc35743eff345b1919ceed1a1c74f113a799f75bd362620db5ecb5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page