Data I/O Guide¶
Learning Objectives
After completing this section, you will be able to:
Load data from multiple instrument formats (TRIOS, Anton Paar, CSV, Excel)
Use auto-detection for unknown file formats
Save results in HDF5 and Excel formats
Handle chunked reading for large files (>1GB)
Prerequisites
Basic Python file I/O
Getting Started with Model Fitting — Model fitting workflow
Quick Reference¶
Auto-detection (recommended):
from rheojax.io.readers import auto_read
data = auto_read('experiment.txt') # Detects format automatically
Specific readers:
from rheojax.io.readers import read_trios, read_csv, read_excel, read_anton_paar
data = read_trios('stress_relaxation.txt')
data = read_csv('data.csv', x_column='Time', y_column='Stress')
data = read_excel('results.xlsx', sheet_name='SAOS')
Writers:
from rheojax.io.writers import write_hdf5, write_excel
write_hdf5(data, 'results.h5') # Full fidelity
write_excel(data, 'results.xlsx', sheet_name='Analysis')
Supported Formats¶
Format |
Reader Function |
Notes |
|---|---|---|
TA Instruments TRIOS |
|
Auto-detects test mode, auto-chunks large files. See TA Instruments TRIOS Format |
Anton Paar |
|
RheoCompass export |
CSV |
|
Specify column names |
Excel |
|
.xlsx, .xls supported |
HDF5 |
|
RheoJAX native format |
Chunked Reading (Large Files)¶
For TRIOS files > 5 MB, auto-chunking is enabled by default (v0.4.0+):
from rheojax.io.readers import load_trios
from rheojax.io.readers.trios import load_trios_chunked
# Auto-chunking for files > 5 MB (default behavior)
data = load_trios('large_file.txt')
# Explicit chunked generator for memory-constrained processing
for chunk in load_trios_chunked('large_file.txt', chunk_size=10000):
process(chunk)
See TA Instruments TRIOS Format for detailed chunked reading documentation.
Summary¶
RheoJAX supports multiple instrument formats with auto-detection. Use auto_read() for convenience,
or specific readers for fine control. Save in HDF5 for full fidelity or Excel for sharing.
Further Reading¶
TA Instruments TRIOS Format — Detailed TRIOS file format documentation
Data Format Reference — Data format requirements for all analyses
I/O Module (rheojax.io) — I/O API reference