Skip to main content

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 <number of samples> <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


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.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

adc64format-0.0.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file adc64format-0.0.1.tar.gz.

File metadata

  • Download URL: adc64format-0.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.14

File hashes

Hashes for adc64format-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4c25c1674ff66b5a15ccb8fe9540758ac33c7214af2fec4f9c8ed803fb664cd7
MD5 77d1f6c7d81f79b61f5af513f97f9329
BLAKE2b-256 96d685816b12395d12480177077a37c03b2cbfc5579deba811f3b358067e7040

See more details on using hashes here.

File details

Details for the file adc64format-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: adc64format-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.14

File hashes

Hashes for adc64format-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 318887641d6c99fb2c3f7f824acca3149c0f5b0c76e0a1d4ea4197020ac8a864
MD5 ea55ad2d1f3d8f3e917d3f225742aa39
BLAKE2b-256 6a0bd5303ef93b39c76cea325efefd6ed72c713d18df0df79eeaa28cf3130830

See more details on using hashes here.

Supported by

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