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.1.0.tar.gz (36.9 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.1.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xtvreader-1.1.0.tar.gz
Algorithm Hash digest
SHA256 946691296bdfbf0ad09999af0a511a845b51d14cfdf9c41f2aa9a8dc26bfe837
MD5 0944fdca6e49d1402f185833e68f9ace
BLAKE2b-256 07495be6ebaeaa2ca0bcaa4221b6b54468f469b880d72728f7aa039c7f3c16c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtvreader-1.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: xtvreader-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b720ba9c997dc6911117c32a60a9ab14bc38afbd404ae22dabf80c14e448308b
MD5 6e5618cedb67c98e622f155aa43fd392
BLAKE2b-256 680cd8579ee74483eae2676370cecf080a10c6af3e46812a2d6ff98a643abc36

See more details on using hashes here.

Provenance

The following attestation bundles were made for xtvreader-1.1.0-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