Commands Reference

rustpix process

Process TPX3 files to extract neutron events.

rustpix process [OPTIONS] -o <OUTPUT> <INPUT>...

Arguments

ArgumentDescription
<INPUT>...Input TPX3 file(s)

Options

OptionDefaultDescription
-o, --output <PATH>RequiredOutput file path
-f, --format <FMT>AutoOutput format override (csv, binary, hdf5, sns-hdf5, tiff)
-a, --algorithm <ALGO>absClustering algorithm (abs, dbscan, grid)
--radius <FLOAT>5.0Spatial radius for clustering (pixels)
--temporal-window-ns <FLOAT>75.0Temporal window for clustering (nanoseconds)
--min-cluster-size <INT>1Minimum cluster size
--out-of-core <BOOL>trueEnable out-of-core processing
--memory-fraction <FLOAT>0.5Fraction of available memory to use
--memory-budget-bytes <INT>AutoExplicit memory budget in bytes
--parallelism <INT>AutoWorker threads for processing
--queue-depth <INT>2Pipeline queue depth
--async-io <BOOL>falseEnable async I/O pipeline
--run-number <INT>0Run number for SNS HDF5 export
--ipts <STRING>""Experiment identifier for SNS HDF5 (e.g., IPTS-35004)
--instrument <NAME>venusInstrument preset for SNS HDF5 (venus)
--tof-bins <INT>200Number of TOF bins for TIFF output
--tof-max <INT>AutoMaximum TOF in 25ns ticks for TIFF (auto-detect if omitted)
--bit-depth <INT>16Bit depth for TIFF output (16 or 32)
-v, --verboseOffVerbose output

Examples

# Basic CSV export
rustpix process input.tpx3 -o output.csv

# Process multiple files
rustpix process file1.tpx3 file2.tpx3 -o combined.csv

# Generic NeXus HDF5 export
rustpix process input.tpx3 -o output.h5

# ORNL SNS NXsnsevent HDF5 export
rustpix process input.tpx3 -o output.nxs.h5 \
    --run-number 12345 \
    --ipts IPTS-35004

# TIFF stack with custom TOF binning
rustpix process input.tpx3 -o output.tiff \
    --tof-bins 500 \
    --tof-max 40000 \
    --bit-depth 32

# Override format (ignore file extension)
rustpix process input.tpx3 -o output.dat -f sns-hdf5 \
    --run-number 12345

# Use DBSCAN with custom parameters
rustpix process input.tpx3 -o output.csv \
    --algorithm dbscan \
    --radius 3.0 \
    --temporal-window-ns 50.0

# Verbose output with parallel processing
rustpix process input.tpx3 -o output.bin \
    --verbose \
    --parallelism 8 \
    --async-io true

# Memory-constrained processing
rustpix process huge_file.tpx3 -o output.csv \
    --memory-fraction 0.3 \
    --out-of-core true

rustpix info

Display information about a TPX3 file.

rustpix info <INPUT>

Example

$ rustpix info data.tpx3
File: data.tpx3
Size: 104857600 bytes (104.86 MB)
Packets: 6553600
Hits: 5242880
TOF range: 0 - 16666666
X range: 0 - 511
Y range: 0 - 511

rustpix benchmark

Benchmark clustering algorithms on a TPX3 file.

rustpix benchmark [OPTIONS] <INPUT>

Options

OptionDefaultDescription
-i, --iterations <INT>3Number of benchmark iterations

Example

$ rustpix benchmark data.tpx3 --iterations 5
Benchmarking with 5242880 hits, 5 iterations
Algorithm  | Mean Time (ms)  | Min Time (ms)   | Max Time (ms)
-----------------------------------------------------------------
ABS        | 245.32          | 238.45          | 256.78
DBSCAN     | 1234.56         | 1198.23         | 1287.34
Grid       | 312.45          | 298.12          | 334.56

rustpix out-of-core-benchmark

Benchmark out-of-core processing modes.

rustpix out-of-core-benchmark [OPTIONS] <INPUT>

Options

OptionDefaultDescription
-a, --algorithm <ALGO>absClustering algorithm
--radius <FLOAT>5.0Spatial radius (pixels)
--temporal-window-ns <FLOAT>75.0Temporal window (ns)
--min-cluster-size <INT>1Minimum cluster size
-i, --iterations <INT>3Number of iterations
--memory-fraction <FLOAT>0.5Memory fraction
--parallelism <INT>AutoWorker threads
--queue-depth <INT>2Queue depth
--async-io <BOOL>falseEnable async I/O

Example

$ rustpix out-of-core-benchmark data.tpx3 --parallelism 4 --async-io true
Out-of-core benchmark (3 iterations)
Single-thread avg: 12.345s
Multi-thread avg: 4.567s (threads: 4, async: true)
Speedup: 2.70x

Environment Variables

The CLI respects standard environment variables:

VariableDescription
RAYON_NUM_THREADSOverride default thread count for parallel processing