Skip to main content

Python module for reading TRACE XTV graphics files

Project description

xtvreader

Python application for reading TRACE XTV graphics files.

This is the Python 3.x version of the application. References in documentation or examples to import xtvreader work out of the box when the package is installed.

Originally written by Josh Whitman.


Installation

We recommend installing xtvreader as a standard package.

1. From a Local Clone

To install the package in your active Python environment, navigate to the repository root and run:

pip install .

2. Editable/Development Mode

If you are developing or modifying the library, install it in editable mode:

pip install -e .

3. Directly from GitHub

You can install xtvreader directly from the repository using pip:

pip install git+https://github.com/NRC-Research/xtvReader.git

Dependencies

The package requires py-xdrlib>=1.0 as a dependency to ensure compatibility with Python 3.11+ and Python 3.13 (where xdrlib was removed from the standard library). This is handled automatically by pip during installation.


Virtual Environment Setup

To keep your system Python clean, we encourage using a virtual environment:

# Create a virtual environment
python3 -m venv .venv

# Activate it
source .venv/bin/activate  # On macOS/Linux
# .venv\Scripts\activate  # On Windows

# Install the package locally
pip install -e .

Usage

In a Python Script

You can import XtvFile directly from the package:

from xtvreader import XtvFile

# Open an XTV file
with open('path/to/file.xtv', 'rb') as f:
    xtv = XtvFile(f)
    
    # Retrieve a data channel value
    data = xtv.getTimeVector('alpn-1A02')
    print(data)

Command Line Tools

Two utility scripts are provided at the root of the repository:

  • xtv2csv.py: Convert XTV graphics files to CSV format.
    python xtv2csv.py file.xtv -var alpn-1A02
    
  • htstrTest.py: Read and extract peak cladding temperature (PCT) data from heat structures.
    python htstrTest.py
    

Original Module Details

xtvreader is a native Python module for retrieving values from a TRACE XTV file. It exposes the XtvFile class which reads header information and spawns component objects dynamically. The header information determines exactly which bytes must be read to extract a specific data point at any edit. If times or axial locations are requested between edits or mesh indices, values are interpolated linearly.

Limitations

It does not contain any of the batch command helper functions that AptPlot and PyPost batch languages provide.

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

xtvreader-1.0.1.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

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

xtvreader-1.0.1-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file xtvreader-1.0.1.tar.gz.

File metadata

  • Download URL: xtvreader-1.0.1.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xtvreader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b7eb379f0dbaca2d2715b95d2533aa75a988f94c9ad3e004e2966290d44bf11b
MD5 a39c71fc229035f538ad9660d1119bdd
BLAKE2b-256 a58140d1d7a53cc358a379e0678af11c31a4fa244f086f022fc251dd851bfae3

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtvreader-1.0.1.tar.gz:

Publisher: pypi-publish.yml on NRC-Research/xtvReader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xtvreader-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: xtvreader-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for xtvreader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fef80b9a7b668c297f31e4c3bb64522da28716cf4009b101406c624cc88b82b4
MD5 310ef95e06ef6a031a8af7ff75c2c94b
BLAKE2b-256 38d861379ba05a8a4112af63c8ac31937e97fe77e56e44b238dcd0398ca1cd29

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtvreader-1.0.1-py3-none-any.whl:

Publisher: pypi-publish.yml on NRC-Research/xtvReader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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