Skip to main content

perception-pnrf

Python parser for the PNRF binary measurement format (HBK Perception).

PNRF files (.pnrf) are produced by HBK Perception data acquisition software and contain high-speed analog waveforms, digital events, CAN/fieldbus data, and SPT harmonic analysis results.

Installation

pip install perception-pnrf

Requires Python 3.10+ and NumPy.

Usage

from perception_pnrf import PnrfFile

# Open a PNRF file
with PnrfFile.open("measurement.pnrf") as pnrf:
    # Iterate recorders and channels
    for rec in pnrf.recorders:
        print(f"Recorder: {rec.logical_name}")
        for ch in rec.channels:
            print(f"  {ch.logical_name}: {ch.sample_count} samples, unit={ch.units}")

            # Read sample data into a NumPy buffer
            data = np.empty(min(ch.sample_count, 1000), dtype=np.float64)
            count = ch.read_f64(data)
            print(f"  Read {count} samples")

Key Classes

Class Description
PnrfFile Top-level file handle; provides .recorders, .groups, .metadata
PnrfRecorder A data acquisition module with channels
PnrfChannel A measurement channel with metadata and data access
PnrfGroup Logical grouping of recorders

Reading Data

import numpy as np

# Read a slice of samples into a preallocated buffer
values = np.empty(5000, dtype=np.float64)
count = ch.read_f64(values, start=0)

# Read all samples at once
all_values = np.empty(ch.sample_count, dtype=np.float64)
count = ch.read_f64(all_values)

# Read from a specific segment with a starting offset
segment_values = np.empty(100, dtype=np.float64)
count = ch.read_f64(segment_values, segment_index=0, start=0)

Channel Types

  • Analog waveform — continuous or sweep-triggered time-series data
  • Digital event — binary state channels
  • SPT blob — Signal Processing Toolkit results (harmonics, order tracking)
  • MATD — asynchronous sparse-pair data (CAN bus, fieldbus)

File Metadata

meta = pnrf.metadata
print(meta.title, meta.comment)
if meta.recording_start_utc is not None:
    print(meta.recording_start_utc.isoformat())

Dump Tool

A CLI tool is included for inspecting PNRF files:

pnrf-dump recording.pnrf

Or via module invocation:

python -m perception_pnrf.dump recording.pnrf

Produces a structured text dump showing file metadata, recorder/channel hierarchy, segment boundaries, and sample previews.

Specification

The full reverse-engineered format specification is available in the spec/ directory of the source repository.

License

MIT

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 Distribution

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

perception_pnrf-1.1.3-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file perception_pnrf-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for perception_pnrf-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0e7743b7bfadcdf20fb0fe41d1e1844c699c988c1df284881be94fb0ee2c429d
MD5 a4b7d210d6be0d67e7b4ecbd5932f17e
BLAKE2b-256 e0d901bb4fc1185f4151a668a3839ab607e638b350f1213e65e6ea8eda0ca922

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.1

1 file

1.2.0

1 file

This release

1.1.3 This release

1 file

1.1.2

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

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