PyMORGAN Documentation#
Multidimensional Optical Spectroscopy Graphical Analysis Interface (1D & 2D)
PyMORGAN provides a unified Python interface and PyQt6 graphical application to load, calibrate, process, and plot ultrafast time-resolved spectroscopy data. The package is organised by dimensionality:
One-Dimensional Spectroscopy (
pymorgan.oneD): Transient absorption (fs-TA, ns-TA / flash photolysis), time-resolved infrared (TRIR), fluorescence up-conversion, and polarisation anisotropy / magic-angle spectroscopy — including PyMESS.h5slow-modulation states with per-state single scans and multi-signal fast modulation.Two-Dimensional Spectroscopy (
pymorgan.twoD): General two-dimensional optical correlation spectroscopy across homonuclear and cross-regime modalities — 2D-IR (vibrational–vibrational), 2D-ES (electronic–electronic), 2D-EV (electronic–vibrational), and 2D-VE (vibrational–electronic) — from raw interferograms through closed-form bin-zero detection, apodisation, IRLS phasing, Fourier transformation, and interactive 2D single-scan contour array exploration / scan recombination to spectral-diffusion (CLS / IvCLS / NLS), 2D Gaussian peak fitting, ROI volume integration, and generalized multi-FFCF Kubo lineshape response-function fitting with Variable Projection (VarPro).Wavelength & Pulse-Shaper Calibration (
pymorgan.cal): Non-linear least-squares dispersion fitting (linear grating, 2nd/3rd-order polynomial grating, and SF10 glass Sellmeier prism models) across 12 pre-configured spectrograph and pulse-shaper setups.Steady-State Reference Spectra (
pymorgan.steadyState): Absorption, emission, excitation, and stimulated-emission cross-section (\(\tilde{\nu}^4\)) overlays.
Install via pip / uv, deploy standalone PyMORGAN Suite installers on
Windows, macOS, and Linux, or link local Python environments in 1 click.
Load 13+ instrument formats (including PyMESS .h5 slow-modulation & multi-signal schemas,
HARPIA, Helios, QuickControl, TRIR), remove dynamic multi-band pump scatter, correct
background, solvent, shockwaves & Cauchy chirp dispersion, stitch wavelength/time windows,
compute time derivatives, perform SVD, and calculate polarisation anisotropy.
Closed-form Fourier Shift Theorem bin-zero detection, apodisation, IRLS phasing, interactive 2D single-scan contour array explorer & scan recombination, spectral diffusion (CLS / IvCLS / NLS), generalized multi-FFCF Kubo lineshape fitting (VarPro), 2D Gaussian peak fitting, ROI volume integration, and 2D difference maps.
Calibrate spectrometer probe arrays and pulse-shaper pump masks across 12 hardware
setups (including HARPIA UV/Vis presets and auto-routed PyMESS .h5 regimes) in a
unified 3-column inspector GUI.
Overlay steady-state FTIR/UV-Vis/emission spectra, customize publication-ready
Matplotlib profiles via settings.toml, edit the Qt Designer GUI, or register custom
instrument loaders.
Auto-generated API documentation for pymorgan.oneD, pymorgan.twoD,
pymorgan.cal, pymorgan.steadyState, pymorgan.detect,
pymorgan.provenance, pymorgan.recipe, pymorgan.batch,
pymorgan.project, and pymorgan.settings.
Undo/Redo, processing history & Python script export, .pmrecipe.toml recipes,
CLI/GUI batch processing, .pmproj workspace sessions, Glotaran/FAIR HDF5 interop,
and universal format auto-detection.
Download Complete LaTeX Manual (PDF)
In addition to this interactive web documentation, the complete typeset manual is compiled
from docs/*.tex and available as a standalone PDF:
Download PyMORGAN Manual (main.pdf).
Quick Example#
import pymorgan as pm
# 1. Load & apply publication style profile
pm.load_settings("settings.toml")
pm.apply_style()
# 2. Load 1D transient absorption dataset & subtract pre-zero background
data = pm.load_1D("testData/testTRIR.pdat", data_type="PDAT")
data.background_correct(tmin=-20, tmax=-5)
# 3. Fit and apply Cauchy chirp dispersion correction
chirp_fit = data.fit_chirp_automatic(deriv_mask=(True, True), use_exp=True)
data.apply_chirp_correction(chirp_fit, boundary_handling="crop")
# 4. Plot contour map, transient spectra, and kinetic traces
data.plot_contour(Zscale=20, Asinh=True)
data.plot_spectra([0.5, 1, 5, 20, 100], secondary_axis=True)
ax, t, Y = data.plot_kinetics([1980, 2030], plotStyle="-")
pm.show_plots()
Contents#
Getting Started
User Guide
- User Guide
- One-Dimensional Data (Pump–Probe, TRIR, nsTA & Anisotropy)
- Pipeline Overview
- Data Model
- Loading and the Loader Registry
- Background Correction
- Advanced Scatter & Dynamic Background Removal
- Solvent Subtraction
- Shockwave Subtraction
- Chirp (Dispersion) Correction
- Plotting and \(\operatorname{arcsinh}\) Colour Scaling
- Composing Multi-Panel Figures and Displaying
- Kinetic Analysis Seam & Noise Propagation
- Graphical Interface — 1D Analysis & Processing Dialogs
- Two-Dimensional Spectroscopy (2D-IR, 2D-ES, 2D-EV & 2D-VE)
- Pipeline Overview & Supported 2D Modalities
- Data Model
- Loading and the Loader Registry
- Interferogram Processing, Phasing, and Fourier Transformation
- 2D Single-Scan Contour Array Explorer & Scan Recombination
- Plotting, Cross-Regime Diagonal Handling & Unit Conversions
- Spectral Diffusion Analysis (CLS, IvCLS, NLS)
- Advanced 2D Analysis Dialogs & Tools
- Graphical Interface Sub-Tabs & Movie Export
- Spectrometer & Pulse Shaper Wavelength Calibration
- Pipeline Overview
- Data Model & Data Structures
- Mathematical Optical Dispersion Models
- Forward Model, Baseline Correction & Derivative Cost Function
- Axis Inversion & Gaussian Pump Diagnostics
- Supported Hardware Setup Configurations
- Graphical User Interface (3-Column Inspector Layout)
- Programmatic Usage Example
- Steady-State Spectra
- Reproducible Workflows, Interoperability & Automation
- Settings & Aesthetics
- Extending PyMORGAN
API Reference
- API Reference
- 1D Pipeline API (
pymorgan.oneD)- Dataset1D (
pymorgan.oneD.dataset) - Loaders & Registry (
pymorgan.oneD.load,pymorgan.oneD.registry) - Processing & Chirp Correction (
pymorgan.oneD.process,pymorgan.oneD.chirp) - Advanced Scatter Removal (
pymorgan.oneD.scatter) - Stitching & SVD (
pymorgan.oneD.stitch,pymorgan.oneD.svd) - 1D Plotters (
pymorgan.oneD.plot)
- Dataset1D (
- 2D Pipeline API (
pymorgan.twoD) - Calibration Engine API (
pymorgan.cal)- Package Overview (
pymorgan.cal) - Data Structures & Optical Dispersion Models (
pymorgan.cal.models) - Reference & Experimental Spectrum Loaders (
pymorgan.cal.load) - Wavelength Axis Fitting & Routing (
pymorgan.cal.fit) - Gaussian Spectrum Diagnostics & Utilities (
pymorgan.cal.spectrum_fit,pymorgan.cal.utils)
- Package Overview (
- Steady-State Spectra API (
pymorgan.steadyState) - Workflows, Interoperability & Provenance API
- Auto-Detection (
pymorgan.detect) - Glotaran / pyglotaran Interoperability (
pymorgan.oneD.interop) - FAIR HDF5 Metadata Helpers (
pymorgan.hdf5_meta) - Processing Provenance & Script Export (
pymorgan.provenance) - Processing Recipes (
pymorgan.recipe) - Batch Processing Engine (
pymorgan.batch) - Project Sessions (
pymorgan.project)
- Auto-Detection (
- Settings, Display & Helpers API
Acknowledgements & Verification#
Development of PyMORGAN is assisted by Google Antigravity. All algorithms, numerical calculations, and analysis outputs have been manually reviewed and validated to ensure scientific accuracy, and the entire repository is continuously tested and verified against an automated unit and regression test suite.
Trademarks & Third-Party Notice#
All third-party product, instrument, and software names mentioned in PyMORGAN and its documentation are trademarks or registered trademarks of their respective owners — including QuickControl (PhaseTech Spectroscopy, Inc.), HARPIA (Light Conversion), Helios (Ultrafast Systems, LLC), and OPUS (Bruker Corporation) — and are used solely for identification and scientific data-interoperability purposes. PyMORGAN is an independent academic open-source project and is not affiliated with, endorsed by, or sponsored by any of these vendors.