A comprehensive, open-source GUI suite for the processing and global target analysis of ultrafast spectroscopy data.
- Overview
- Supported Techniques
- Modules
- Mathematical Background
- Error Estimation
- Installation
- Quick Start
- Screenshots
- Contributing
- Citation
- License
Ultrafast Spectroscopy Analyzer is a full-featured desktop application for the processing, visualization, and global target analysis of ultrafast spectroscopy data. It combines a rigorous mathematical engine — built around Variable Projection (VarPro), Bateman-equation population dynamics, and profile-likelihood confidence intervals — with an interactive graphical interface designed to take raw experimental data all the way to publication-quality figures without requiring any scripting.
The core fitting engine implements a true VarPro algorithm: at each step of the non-linear optimizer, the spectral amplitudes are eliminated analytically via linear least squares, so the optimizer only ever searches over the physically meaningful non-linear parameters (
| Technique | Description |
|---|---|
| TAS | Transient Absorption Spectroscopy |
| FLUPS | Fluorescence Up-Conversion Spectroscopy |
| TCSPC | Time-Correlated Single Photon Counting |
| XFEL / Time-scans | X-ray Free Electron Laser pump-probe experiments |
Loads raw FLUPS data matrices and provides a fully interactive 2D map with real-time spectral and kinetic cross-sections under the cursor. Chirp (.npy for direct loading into the Global Fit Panel.
Extends the FLUPS workflow for Transient Absorption data. The solvent background is subtracted in real time as the user adjusts the amplitude and temporal shift sliders, with the subtraction computed via bilinear interpolation onto the measurement grid at each slider event. Pump scatter removal, SymLog/Linear axis switching, and discrete-level map rendering are all interactive. A blitting-based rendering engine ensures smooth cursor tracking even on large datasets.
The main analysis engine. Supports simultaneous loading of multiple datasets, pre-processing (baseline subtraction, spectral and temporal cropping, wavelength exclusion zones, binning, normalization), SVD rank diagnosis, and global fitting. After optimization, results include DAS/SAS spectra with error bars, kinetic trace exploration, 2D residual maps, and a full parameter identifiability report. Batch fitting over all loaded datasets is available with a single button, producing individual result folders per dataset.
Assembles 2D pump-probe maps from collections of individual time-scan .npy files — useful for XFEL or any scanning-based experiment where each kinetic trace at a different photon energy or wavelength is stored as a separate file. The assembled matrix is exported in the same .npy format consumed by the Global Fit Panel.
All models convolve the kinetic response with a Gaussian IRF of FWHM
The convolution integral is evaluated analytically using the scaled complementary error function (erfcx), which avoids catastrophic cancellation at large arguments and is numerically stable across the full dynamic range of typical ultrafast experiments (sub-100 fs to nanoseconds):
$$\left\text{IRF} \otimes e^{-t/\tau}\right = \frac{1}{2}\exp!\left(\frac{\sigma^2}{2\tau^2} - \frac{t-t_0}{\tau}\right) \cdot \text{erfc}!\left(\frac{\sigma^2 - \tau(t-t_0)}{\sqrt{2},\sigma\tau}\right)$$
where
The 2D data surface
where
At each evaluation of the residual function,
where numpy.linalg.lstsq. The non-linear optimizer (scipy.optimize.least_squares, TRF method with soft-L1 loss) therefore only ever minimizes over the small vector
Components decay independently:
Each column
Successive population transfer:
Populations governed by the Bateman equations:
The Bateman equations are evaluated via the same vectorized erfcx-based kernel as the parallel model, so all
Superposition of population relaxation and a coherent vibrational wavepacket:
The error function step simulates the convolution of the oscillation onset with the IRF without requiring numerical integration. VarPro still applies:
Arbitrary kinetic schemes are defined interactively through a visual Jablonski/Grotrian diagram builder — states are drawn as draggable boxes and transitions as directed arrows, each labeled with a parameter type (tau for a lifetime, gamma for a branching ratio) and a variable name. The software then:
- Assembles the rate matrix K from the transition graph.
- Diagonalizes K analytically:
$\mathbf{K} = \mathbf{V},\boldsymbol{\Lambda},\mathbf{V}^{-1}$ . - Propagates the initial population
$P_0$ (automatically identified as the state with no incoming arrows) through the eigenbasis. - Constructs the concentration matrix
$\mathbf{C}(t)$ and passes it to the VarPro solver.
The eigenvector decomposition handles schemes of arbitrary topology — branched pathways, parallel channels, and cycles — without requiring the user to derive Bateman-like equations by hand.
When the coherent artifact checkbox is active, three additional basis functions are appended to
These three terms absorb Raman scattering (
Rigorous uncertainty quantification is a central design goal of the fitting engine. The software implements a three-tier framework, each tier adding more information at increasing computational cost.
After convergence, the Jacobian
The parameter covariance is estimated as:
where the noise variance is estimated from the fit residuals, correctly accounting for both the non-linear parameters and the analytically eliminated linear amplitudes in the degrees-of-freedom count:
Standard errors on lifetimes and IRF parameters are the square roots of the diagonal of
Note: The standard errors assume local linearity of the model around the optimum and homoscedastic Gaussian noise. They are most reliable when the residuals are structurally flat (confirmed via the residual map) and the condition number is low.
The same SVD yields two additional diagnostics that are reported automatically alongside the standard errors.
Condition number:
where
| Interpretation | |
|---|---|
| Well-conditioned. Standard errors are reliable. | |
|
|
Moderate correlation between some parameters. Inspect the correlation matrix. |
| At least one parameter combination is poorly determined. Standard errors may be misleading. | |
| Near-singular. Consider fixing a parameter or merging two components. |
Sloppy direction: The right singular vector $\mathbf{v}{n\text{nl}}$ (corresponding to
Full correlation matrix: The normalized covariance
is computed and displayed as a color-coded heatmap. Off-diagonal entries near
When the condition number is high or the model is strongly non-linear (as is the case for K-matrix models with branching ratios), the quadratic approximation underlying Tier 1 may underestimate the true uncertainty — particularly when a parameter is bounded below (e.g., a lifetime cannot be negative) or when two components have similar timescales.
The profile likelihood method makes no linearity assumption. For each target parameter
The confidence interval at level
For
The resulting interval is asymmetric in general: a lifetime bounded by zero will show a longer upper tail than lower tail, which the symmetric Tier-1 interval cannot represent. The profile curve itself is plotted interactively, so the user can immediately see whether the
The computational cost is
Requirements: Python 3.8 or later.
# 1. Clone the repository
git clone https://github.com/AlejandroSerranoCapote/Ultrafast-Spectroscopy-Analyzer.git
cd Ultrafast-Spectroscopy-Analyzer
# 2. Install dependencies
pip install -r requirements.txt
# 3. Launch
python UltrafastSpectroscopyAnalyzer.pypyinstaller --onefile --noconsole --icon=icon.ico \
--exclude-module PyQt6 \
"UltrafastSpectroscopyAnalyzer.py"The .exe will appear in the dist/ folder with no Python installation required on the target machine.
| Package | Purpose |
|---|---|
PyQt5 |
GUI framework |
numpy |
Array operations and linear algebra |
scipy |
Non-linear optimization, interpolation, special functions (erfcx) |
matplotlib |
All plotting and interactive canvases |
pandas |
CSV loading and data cleaning |
- Launch the application and select FLUPS Analyzer or TAS Analyzer.
- Click Load CSV and select your data file (TAS requires measurement + solvent files).
- Use the wavelength sliders to crop the spectral range.
- Apply chirp correction: Auto-Chirp for automated
$t_0$ detection, or Select$t_0$ points → Fit$t_0$ for manual selection. - Click Global Fit to pass the corrected data to the fitting engine.
- In the Global Fit Panel, switch to the 2. Fit tab.
- Select the number of components and model type.
- Optionally run SVD Analysis to determine the number of photo-active species.
- Click Edit Initial Guesses to set starting lifetimes and bounds.
- Click RUN FIT. Results appear in the Fit Result and Residuals tabs.
- Click Show Plots / Results to open the DAS/SAS viewer and kinetic trace explorer.
- After fitting, Show Plots / Results opens the results summary automatically.
- The condition number (green/orange/red) gives an immediate signal of whether the parameters are reliably determined.
- If the condition number is high, the sloppy direction text identifies which parameter combination is problematic.
- Click Analyze Identifiability (Profile Likelihood) to open the interactive profile dialog, select a parameter, and compute its asymmetric confidence interval.
- Select Custom GUI Model and click Open Visual Model Builder.
- Add excited states with Add State (e.g.,
S1*,3CT,S0). - Connect them with Connect States, specifying
tauorgammaand a variable name. - Click Load & compile kinetic model. The K-matrix is assembled and diagonalized automatically.
Contributions are welcome. To propose a change:
- Fork the repository and create a feature branch:
git checkout -b feature/your-feature. - Make your changes and add tests if applicable.
- Open a Pull Request describing the motivation and implementation.
For bug reports or feature requests, please open a GitHub Issue with a minimal reproducible example (data file + settings) where possible.
If you use this software in published work, please cite it as:
@software{SerranoCapote_USA_2025,
author = {Serrano Capote, Alejandro},
title = {{Ultrafast Spectroscopy Analyzer}},
year = {2025},
version = {1.4},
url = {https://github.com/AlejandroSerranoCapote/Ultrafast-Spectroscopy-Analyzer},
license = {GPL-3.0}
}This project is licensed under the GNU General Public License v3.0.
See the LICENSE file for details.





