Repository navigation
Home
rlica edited this page Sep 16, 2026
·
11 revisions
python-cmat (pycmat) is a modern, standalone Python toolkit for nuclear physics data analysis. It enables experimentalists to decompress, inspect, convert, and interactively navigate proprietary .cmat 2D coincidence matrices generated by the GASPware and gsort acquisition and sorting suites.
Explore the full documentation topics below or navigate using the sidebar:
- Interactive Web Viewer Overview of the high-performance browser interface, dual 1D projection engine, multi-matrix differential analysis, remote SSH access, and vector PDF export.
- Keyboard Shortcuts & Controls Complete reference for all mouse gestures, hotkeys, gate limit definitions, peak fitting shortcuts, and viewport navigation.
-
Spectroscopy Commands & Macros
Comprehensive manual for the headless spectroscopy engine, command-line one-liners, interactive REPL shell, and automated batch macro scripts (
*.mac). -
Configuration Guide
Detailed explanation of
python-cmat-config.txtsettings, default discovery rules, per-axis energy calibration parameters, and saving options. -
Python API & CLI Tools
Programmatic usage of
CMATReaderin Python scripts/Jupyter notebooks and thecmat2amat.pycommand-line matrix conversion tool.
- Peak Fitting & Background Models Rigorous mathematical formulations for 1D and 2D photopeak models (Gaussian, RadWare/SAMPO exponential tails, Hypermet EMG), Gamba & Morhác 4-component coincidence background decomposition, CWT continuous wavelet peak search, and the Peak-Aware Continuum baseline engine.
-
Format Reference & Decompression
Detailed reverse-engineered specification of the IVF
.cmatfile container (512-byte records, sub-matrix block grids, asymmetric step sizes) and Modes 0–41 decompression routines. - Scientific References Complete bibliography of foundational papers and citations covering gamma-ray spectroscopy algorithms.
- Pure Python + NumPy Decompression: Fully reverse-engineers all proprietary IVF block compression algorithms (Modes 0–32 bit-packing, Mode 33 16-bit sparse lists, Mode 34 32-bit sparse lists, Mode 37 tagged token bit-streams, and Mode 41 unary run-length shift maps) without requiring legacy 32-bit Fortran binaries or external C libraries.
-
Arbitrary Geometry: Handles symmetric, asymmetric, and arbitrary step sizes (
$32 \times 32$ ,$32 \times 64$ ,$64 \times 128$ ,$128 \times 128$ , etc.). - Interactive Web Interface: Ultra-responsive HTML5 Canvas architecture with pixel-matched data decimation and 2D max-pooling to preserve narrow photopeaks even when viewing the entire 4096×4096 matrix.
- Simultaneous Dual 1D Projections: Stacked top/bottom stepped staircase histograms displaying Det 1 (X projection sliced over visible Y) and Det 2 (Y projection sliced over visible X) with synchronized crosshair tracking and calibrated energy readouts.
-
Advanced 1D Peak Fitting: Fits Standard Symmetric Gaussian, RadWare / SAMPO Left Exponential Tail, and Hypermet Convolved Tail +
$\text{erfc}$ Compton Step models with complete statistical covariance error propagation. -
Multi-Gate Slicing with Background Subtraction: Arbitrary peak gates (
$W$ ) and background windows ($B$ ) with automated channel width normalization ($\text{Scale} = \sum \Delta W / \sum \Delta B$ ). -
True 2D Coincidence Peak Fitting: Gamba & Morhác 4-component decomposition separating net coincidence volume (
$p|p^t$ ), orthogonal cross-ridges ($p|bg$ ,$bg|p$ ), and 2D Compton continuum + randoms ($bg|bg$ ). - Multi-Matrix Comparison: Instant cycling between loaded matrices with locked viewport coordinates, coincidence gates, and auto-refitted peak parameters.
- Automated CWT Peak Search & Multi-Fit: Continuous Wavelet Transform detection combined with Peak-Aware Continuum baseline estimation that handles noise grass in background-subtracted coincidence cuts without clipping bias.
- Vector PDF Publication Engine: Produces vector PDF figures with Times New Roman typography, calibrated axes, stepped histograms, fit curves, and background baselines.
python-cmat © 2026. Released under the MIT License. Return to GitHub Repository
Interactive 2D & 3D Matrix Analysis & Spectroscopy
- Home
- Interactive Web Viewer
- 3D Matrix Analysis & Web Viewer
- Keyboard Shortcuts & Controls
- ROOT Files & Live Histograms
- ENSDF Isotope Identification
- Spectroscopy Commands & Macros
- Configuration Guide
- Python API & CLI Tools