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 .h5 slow-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.

🚀 Installation & Cross-Platform Suite

Install via pip / uv, deploy standalone PyMORGAN Suite installers on Windows, macOS, and Linux, or link local Python environments in 1 click.

Installation
📈 1D Pump–Probe Pipeline

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.

One-Dimensional Data (Pump–Probe, TRIR, nsTA & Anisotropy)
🗺️ 2D Spectroscopy (2D-IR, 2D-ES, 2D-EV, 2D-VE)

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.

Two-Dimensional Spectroscopy (2D-IR, 2D-ES, 2D-EV & 2D-VE)
🎯 Wavelength & Shaper Calibration

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.

Spectrometer & Pulse Shaper Wavelength Calibration
⚙️ Steady-State, Aesthetics & Extending

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.

Steady-State Spectra
📚 Full Python API Reference

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.

API Reference
🔁 Workflows, Batch & Interop

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.

Reproducible Workflows, Interoperability & Automation

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#

User Guide

API Reference

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.