One-Dimensional Data (Pump–Probe, TRIR, nsTA & Anisotropy)#
Pipeline Overview#
The one-dimensional branch is organised as a load → process → plot → analyse pipeline.
Each stage is a module under pymorgan.oneD, and the Dataset1D
object ties them together: it holds the raw arrays and exposes one set of methods per stage.
The stage functions take the dataset as their first argument, so they remain reusable on their
own and new routines integrate with the whole pipeline.
Stage |
Module |
Entry Point(s) |
|---|---|---|
load |
|
|
process |
|
|
plot |
|
|
analyse |
PyRATE-TA |
Companion package (PyRATE-TA) via |
Data Model#
A one-dimensional measurement is represented by a Dataset1D
object, which bundles the arrays produced by a loader. The signal is stored as a
three-dimensional array to generalise over multiple detectors:
indexed by delay \(\tau\), probe coordinate \(\lambda\) (wavelength, wavenumber, energy, or frequency), and detector \(d\). The accompanying axes are the delay vector \(\tau \in \mathbb{R}^{N_\tau}\) and the probe vector \(\lambda \in \mathbb{R}^{N_\lambda}\).
Field |
Symbol / Shape |
Meaning |
|---|---|---|
|
\(N_\tau \times N_\lambda \times N_d\) |
Averaged signal |
|
\(N_\tau\) |
Delay axis |
|
\(N_\lambda\) |
Probe (spectral) axis |
|
|
Unit labels dictionary (see Settings & Aesthetics) |
|
scalar |
Number of scans ( |
|
\(N_\tau \times N_\lambda \times N_d \times N_s\) |
Single-scan signal tensor |
|
\(N_\tau \times N_\lambda\) |
Per-point standard deviation |
The most-processed signal is exposed through the Z property, which returns the
background-corrected array once a correction has been applied and falls back to the raw array
otherwise.
Loading and the Loader Registry#
Data formats are decoupled from the dataset through a loader registry
(pymorgan.oneD.load). A loader is any callable that maps a file path to the seven fields
listed above. Loaders are registered under one or more data-type names and resolved at load time:
import pymorgan as pm
data = pm.load_1D("scan.pdat", data_type="PDAT")
print(pm.available_loaders())
Format Token |
Instrument / Origin |
Description |
|---|---|---|
|
PyMORGAN standard |
Comma-separated averaged data ( |
|
PyMORGAN FAIR HDF5 |
Gzip-compressed FAIR/NeXus HDF5 archive ( |
|
UniGE fs-TA |
Step-scan femtosecond TA ( |
|
UniGE ns-TA |
Nanosecond TA ( |
|
Univ. of Sheffield |
Transient IR ( |
|
STFC / Central Laser Facility |
RAL LIFEtime 1D IR pump–probe CSV datasets (alias |
|
MESS TRIR |
State-modulated TRIR directories with inverse-variance scan averaging |
|
MESS TRUVIS |
State-modulated transient UV–Vis directories |
|
Light Conversion |
HARPIA ultrafast transient absorption files ( |
|
Ultrafast Systems |
Helios TA files ( |
|
Ultrafast Systems |
Surface Xplorer binary datasets ( |
|
PhaseTech Spectroscopy |
QuickControl 1D pump–probe ASCII files ( |
|
PyMESS HDF5 |
Broadband pump–probe HDF5 datasets ( |
|
PyMESS HDF5 |
Slow-modulation polarisation anisotropy HDF5 datasets ( |
|
PyMESS HDF5 |
2D-IR population waiting-time (\(t_2\)) scan HDF5 datasets ( |
|
Glotaran / TIMP |
Time-explicit or wavelength-explicit ASCII exchange files ( |
|
Glotaran / pyglotaran |
CF-1.8 compliant NetCDF4/HDF5 datasets ( |
|
Generic exports |
Wavelength-vs-delay tabular text files ( |
A new format is added by decorating a reader with @pm.register_loader("MyInstrument"):
@pm.register_loader("MyInstrument")
def read_my_instrument(path):
...
return Zavg_R, delays, probe, Units, Nscans, Zss_R, Zstdv
High-Performance File Parsing#
Large experimental files (such as UniGE fsTA and Helios TA scans spanning tens of thousands of
lines) are parsed using high-throughput C-accelerated engines (pandas.read_csv with
engine="c") with automated fallbacks for non-standard whitespace or formatting anomalies.
Probe wavelength calibration is automatically resolved from local directory structures (e.g.
CalibratedProbe.csv or pix2lam.mat).
The PDAT Format#
A .pdat file is comma-separated. The first line carries the time and probe units separated by
an asterisk (e.g. ps*cm^{-1}). The first data row holds the probe axis (with a leading 0),
and each subsequent row begins with a delay value followed by the signal at every probe
coordinate. PDAT files store averaged data already in \(\text{mOD}\), so no rescaling is
applied on read. Per-point standard deviations are optionally stored in a sibling .pdatn file
with an identical layout.
Surface Xplorer (.ufs), Glotaran & FAIR HDF5 Interoperability#
Surface Xplorer (
Helios_UFS): Directly parses binary.ufsfiles (IEEE-754 big-endian v1/v2 streams), preserves metadata blocks (sample, solvent, excitation wavelength), convertsDAvalues to \(\text{mOD}\), sanitises non-finite values, and discovers sibling_scan*.ufssingle-scan files automatically.Glotaran / pyglotaran (
Glotaran_ASCII,Glotaran_NC): Reads and writes both legacy Glotaran/TIMP time-/wavelength-explicit.asciifiles and CF-1.8 NetCDF4.ncfiles viaDataset1D.to_glotaran_ascii()andDataset1D.to_glotaran_nc()(built directly onh5pydimension scales without externalnetCDF4orxarraydependencies).FAIR HDF5 v2.0 (
HDF5):Dataset1D.to_hdf5()andpymorgan.oneD.load.load_1D_hdf5()store raw/corrected arrays, chirp fits, masks, scatter parameters, units, and full JSON processing provenance (history_json), which is restored automatically on reload viapymorgan.load_auto()orpm.load_1D(..., data_type="HDF5").
PyMESS HDF5 Slow-Modulation & Multi-Signal Schemas#
The PyMESS HDF5 loaders (PyMESS_PP, PyMESS_Aniso, and PyMESS_t2scan) automatically
classify and load both standard single-state pump–probe datasets and multi-state acquisition
layouts:
Slow modulation (
/data/slow_modulation/state_XX_<name>): State datasets are enumerated while ignoring their*_individual_scanscompanion datasets. Per-state single scans (state_XX_<name>_individual_scans) are loaded intoZss_R(shape \(N_\tau \times N_\lambda \times N_{\text{states}} \times N_{\text{scans}}\)) and used to compute a true empirical per-point standard deviationZstdv. For polarisation anisotropy datasets (PyMESS_Aniso), the isotropic Magic Angle (\(\Delta A_{\mathrm{iso}} = (\Delta A_\parallel + 2G\,\Delta A_\perp)/3\)) and Anisotropy (\(r = (\Delta A_\parallel - G\,\Delta A_\perp)/(\Delta A_\parallel + 2G\,\Delta A_\perp)\)) channels are appended automatically alongside the parallel and perpendicular states, including their derived per-scan tensors.Multi-signal fast modulation (
/data/signals/signal_XX_*): Multi-beam or multi-phase chop/modulation schemes stored under/data/signals(such as pump-only, push-only, and pump+push difference channels) are exposed as named detector/modulation states inUnits["detectors"], with companion*_noisedatasets mapped directly toZstdv.Shaper population-time scans (
PyMESS_t2scan): 2D-IR waiting-time (\(t_2\)) scans acquired at a fixed or zero coherence time (\(t_1 = 0\)) are supported whether raw interferograms are stored under/data/interferograms_rawor pre-demodulated state matrices are stored under/data/slow_modulation.
Background Correction#
The pre-time-zero background is estimated by averaging the signal over a delay window \([\tau_{\mathrm{min}}, \tau_{\mathrm{max}}]\) and subtracting it from every delay:
where the average is taken with nan-aware statistics (pymorgan.oneD.process). The
operation is applied through:
data.background_correct(tmin=-20, tmax=-5) # apply
data.background_correct(tmin=-20, tmax=-5, do_correct=False) # passthrough
With do_correct=False the raw signal is copied unchanged into the corrected fields, so
downstream code can always read Z uniformly. The method returns self, allowing calls to
be chained. When time-varying pump scatter or drifting broadband backgrounds defeat static
pre-zero subtraction, use Advanced Scatter & Dynamic Background Removal.
Advanced Scatter & Dynamic Background Removal#
Standard static pre-zero subtraction removes one fixed spectrum averaged over \([\tau_{\mathrm{min}}, \tau_{\mathrm{max}}]\). In real ultrafast transient absorption measurements, pump scatter and broadband pre-zero backgrounds often evolve with delay and across scans for four physical reasons:
Delay-stage scatter dimming: Translation of the mechanical delay stage subtly steers or clips scatter on the sample cell, causing a fixed static subtraction to oversubtract at positive delays and produce phantom positive structure across the pump core.
Delay-dependent spectral walk: Small centroid shifts or width changes of the scatter peak turn static residuals into bipolar derivative-like dispersive artefacts.
Delay-to-delay speckle jitter & scan-to-scan drift: Shot-to-shot fluctuations and scan-level scatter drift leave noisy vertical stripes in the averaged map and sharply inflate
Zstdvaround the scatter wavelength, distorting weighted global analysis in PyRATE-TA.Broadband fluorescence & far-wing dimming: Slow delay evolution of broadband luminescence or scatter tails introduces baseline tilt across all probe channels when subtracted statically.
PyMORGAN addresses all four failure modes in pymorgan.oneD.scatter while keeping genuine
transient absorption spectra, excited-state absorption, and coherent \(t_0\) artefacts intact.
Two-Tier Automatic Band Detection#
detect_scatter_bands() (also wrapped by
Dataset1D.detect_scatter_bands)
locates scatter bands from the pre-zero average \(B_{\mathrm{pre}}(\lambda)\) in two passes:
Pass 1 (primary bands): Applies median-filter detrending (odd window size \(k = \max(21, \lfloor 0.08\,N_\lambda \rceil_{\mathrm{odd}})\)) and robust MAD noise estimation (\(\sigma = 1.4826\,\mathrm{MAD}\)) to threshold sharp pre-zero dips above \(\max(6\sigma, \text{floor})\) (floor \(0.5\,\mathrm{mOD}\) or \(5\times 10^{-4}\,\mathrm{OD}\); negative dips by default, or signed when
allow_positive=True). Contiguous runs of \(\ge 3\) pixels (bridging 1–2 pixel gaps) are expanded outward until below \(\max(2\sigma, 1\%\,\text{peak})\), merged if overlapping, and sorted by descending amplitude so Band 0 is the strongest primary scatter band.Pass 2 (2nd-order grating harmonics): When the probe axis is calibrated in wavelength (\(\mathrm{nm}\)), a \(\pm 12\,\mathrm{nm}\) window around \(2\lambda_{\mathrm{pump}}\) (resolved from
pymess_metadata["pump_wl_nm"]or Band 0’s peak) is inspected for second-order diffraction dips. Candidates with \(\mathrm{SNR} \ge 5\sigma\) are added enabled withrank=1, couple_to=0, while \(3\sigma\text{--}5\sigma\) candidates are added disabled as optional suggestions.
Mathematical Formulation & Basis Methods#
Each ScatterBand specifies a core
\([\lambda_{\min,m}, \lambda_{\max,m}]\), side-wing margin \(w_{\mathrm{wing},m}\)
(default \(\max(3\Delta\lambda, 0.5\,\Delta\lambda_{\mathrm{band}})\)), and raised-cosine
taper width \(w_{\mathrm{taper},m}\) (default
\(\min(w_{\mathrm{wing},m}, \max(2\Delta\lambda, 0.25\,\Delta\lambda_{\mathrm{band}}))\)):
Touching or overlapping uncoupled fit windows
\([\lambda_{\min,m} - w_{\mathrm{wing},m}, \lambda_{\max,m} + w_{\mathrm{wing},m}]\) are merged
into joint groups. Subtracting a linear wing-estimated baseline
\(b_{\mathrm{wing}}(\lambda)\) yields the localised pre-zero template
\(P_0(\lambda) = (B_{\mathrm{pre}}(\lambda) - b_{\mathrm{wing}}(\lambda))\,T(\lambda)\) and
complementary broadband component
\(B_{\mathrm{broad}}(\lambda) = B_{\mathrm{pre}}(\lambda) - \sum_m P_{0,m}(\lambda)\).
When scale_broadband=True (default), a Savitzky–Golay-smoothed slow envelope
\(a_{\mathrm{smooth}}(\tau)\) of the dominant primary band (re-normalised to \(1.0\) at
pre-zero) scales \(B_{\mathrm{broad}}\) across delays,
\(Y_{\mathrm{nb}}(\tau, \lambda) = Y(\tau, \lambda) - a_{\mathrm{smooth}}(\tau)\,B_{\mathrm{broad}}(\lambda)\),
eliminating fluorescence and far-wing dimming without injecting high-frequency speckle jitter.
Within each group’s extended fit window, compute_scatter_removal()
solves a joint least-squares system at every delay \(\tau\) separating a tapered scatter basis
\(\{\phi_r(\lambda)\}_{r=1}^R\) from a low-degree local TA polynomial
(\(p = \text{poly\_deg}\), default 2):
Only the scatter component \(\sum_r c_r(\tau)\,\phi_r(\lambda)\) is subtracted; the smooth physical TA polynomial \(\sum_j \beta_j(\tau)\,\tilde{\lambda}^j\) is preserved intact.
Method |
Mathematical Model |
Strengths & Typical Use |
|---|---|---|
|
Wing-detrended, tapered SVD learned on delays outside |
Tracks amplitude dimming, centroid walk, width morphing, and higher-order slit structure while shielding \(t_0\) coherent artefacts. |
|
Strictly pre-zero cubic-spline template and tapered spectral derivatives \([P_0,\, P_0'T,\, P_0''T,\, \dots]\). |
Deterministic purely pre-zero basis absorbing small spectral walks and broadening without inspecting positive delays. |
|
Per-delay nonlinear VARPRO solving shift \(\delta\lambda(\tau)\) and optional stretch \(\gamma(\tau)\) (when |
Handles larger centroid walks relative to peak width using a strictly pre-zero template while solving amplitudes linearly. |
Harmonic Coupling, Per-Scan Processing & Optical Options#
Harmonic coupling (``couple_to``): Coupled harmonic bands scale the target band’s smooth envelope with a single global scalar \(\alpha \in [0, 2.5]\) fitted outside
t0_exclude, \(\alpha\,a_{\mathrm{smooth}}^{\mathrm{target}}(\tau)\,P_{0,c}(\lambda)\), avoiding overfitting weak harmonic peaks.Per-scan cleaning & noise propagation (``per_scan=True``, ``update_noise=True``): When single-scan tensors (
Zss_R) are present, each scan is cleaned before recomputingZavg_CandZstdv(ddof=1), removing inter-scan scatter drift from uncertainty arrays used by PyRATE-TA. Callingclear_scatter_removal()restores the originalZstdv.Exact transmittance space & saturation masking:
transmittance_space=Truetransforms \(\Delta A\) into linear transmittance modulation \(Y = 10^{-\Delta A / s} - 1\) (\(s = 1000\) for mOD, \(1\) for OD) prior to separation;mask_saturated=Truemasks raw core pixels with \(|Z_{\mathrm{raw}}| > \text{saturation\_threshold}\) (default500.0) toNaN.
Important
Apply advanced scatter removal before chirp correction (Chirp (Dispersion) Correction), because pump scatter is physically tied to the delay-stage position and is unchirped, whereas chirp interpolation mixes delays across neighbouring pixels.
from pymorgan.oneD.scatter import ScatterBand, compute_scatter_removal
# Inspect auto-detected bands (in native probe units, e.g. nm)
bands = data.detect_scatter_bands(tmin=-20, tmax=-2)
# Apply dynamic multi-band removal in place (per-scan + Zstdv update)
data.remove_scatter(method="local_svd", rank=3, per_scan=True, update_noise=True)
# Or evaluate explicitly to inspect quality metrics and diagnostics
res = compute_scatter_removal(
data,
bands=[
ScatterBand(348.2, 362.4, label="Primary"),
ScatterBand(704.5, 715.3, rank=1, couple_to=0, label="2nd order"),
],
method="local_svd",
)
print(res.metrics)
data.apply_scatter_removal(res)
# data.clear_scatter_removal() # restores original Zstdv
Solvent Subtraction#
For measurements in solution, the pure-solvent response often has to be subtracted. Two modes are available:
Manual subtraction: A scaled, time-shifted solvent trace is removed from the sample signal:
data.subtract_solvent(solvent, dt=0.0, scale=1.0)
dtshifts the solvent delay axis before interpolation (accounting for a timing offset between the two measurements) andscalemultiplies the solvent signal before subtraction.Automatic solvent fitting:
fit_solvent_auto()models the solvent contribution pixel by pixel using the solvent trace convolved with the Instrument Response Function (IRF) and removes it:fit = data.fit_solvent_auto(solvent) data.subtract_solvent_fit(fit)
Optional per-pixel fits for the time-zero offset and amplitude scale are controlled via the
solvent_per_pixel_dt(defaultFalse) andsolvent_per_pixel_scale(defaultTrue) settings.
Shockwave Subtraction#
In transient IR / UV–Vis measurements using flowing samples, acoustic shockwaves generated by the pump beam can appear as a time-dependent artefact that is correlated across all probe wavelengths. The artefact is removed by averaging a selected subset of detector pixels (or a probe-axis range) into a 1D shockwave reference trace and subtracting it from every pixel:
from pymorgan.oneD.process import subtract_shockwave
Z_corrected = subtract_shockwave(Z, pixels=[0, 1, 2]) # pixel indices (0-based)
The GUI exposes this through the Subtract Shockwave… button in the 1D tab, which opens
ShockwaveSubtractionDialog with pixel-index or probe-axis-value selection and a live preview.
Chirp (Dispersion) Correction#
Ultrafast time-resolved spectroscopy measurements often suffer from Group Delay Dispersion (GDD), commonly referred to as “chirp”. As the probe pulse passes through dispersive optical elements (white-light generation crystals, lenses, sample cell windows, and the solvent itself), different spectral components are temporally stretched so that the effective time-zero \(t_0(\lambda)\) varies across the probe wavelength range \(\lambda\).
PyMORGAN models the time-zero profile \(t_0(\lambda)\) using a generalised Cauchy dispersion equation:
where \(c_0, \dots, c_{N_C-1}\) are the dispersion coefficients,
\(\lambda_{\mathrm{ref}}\) is a reference wavelength (defaulting to the mean of the fitted
range to make the coefficients dimensionless and well-scaled), and \(N_C\) is the number of
terms (typically 6).
Three chirp determination modes are implemented in pymorgan.oneD.chirp:
Automatic: Fits the coherent artefact and early dynamics at every pixel independently. The model consists of a Gaussian Instrument Response Function (IRF), its optional first and second derivatives, a constant offset, and an optional erf-broadened exponential decay. PyMORGAN uses Variable Projection (VARPRO) to eliminate the linear amplitudes in closed form, optimising only the non-linear parameters \((t_0, \mathrm{FWHM}, \tau_{\mathrm{exp}})\) per pixel. A second pass uses smoothed parameters from the first pass as initial guesses to improve stability.
Step function: Jointly fits a Gaussian IRF (+ derivatives) and a Heaviside step convolved with the same Gaussian over a narrow early-time window — robust when early-time exponential decay is not needed or is ill-conditioned.
Manual: Fits the Cauchy dispersion equation directly to a set of user-picked \((\lambda, t_0)\) points clicked interactively on the contour map in the GUI.
Once \(t_0(\lambda)\) is obtained, the Cauchy dispersion equation is fitted using bound-constrained, iteratively reweighted linear least-squares (IRLS with Tukey’s bisquare weights) to reject outlier pixel fits.
To apply the correction, the dataset’s delay axes are interpolated onto a common chirp-free delay grid using one of two boundary-handling strategies:
crop: Slices the delay axis to keep only the delay region where all wavelength channels are defined, discarding out-of-bounds regions that becomeNaNafter shifting.extrapolate: Fills out-of-bounds values with the nearest valid boundary endpoint value, keeping the original delay range.
fit = data.fit_chirp_automatic(deriv_mask=(True, True), use_exp=True)
data.plot_chirp_diagnostics(fit)
data.apply_chirp_correction(fit, boundary_handling="crop")
Plotting and \(\operatorname{arcsinh}\) Colour Scaling#
Five plotters live in pymorgan.oneD.plot; each is exposed both as a
Dataset1D method and as a stage-level function that takes the
dataset as its first argument:
Method / Function |
View |
|---|---|
|
Delay-vs-probe contour map |
|
Filled delay-vs-probe surface |
|
Transient spectra at selected delays |
|
Kinetic traces at selected probe positions (also returns extracted |
|
DAS / EAS / SAS from a global or target analysis fit |
data.plot_contour(Zscale=20) # method form
data.plot_spectra([0.5, 1, 5, 20, 100], doSmooth=1)
ax, t, Y = data.plot_kinetics([2132, 2218], plotStyle="-")
from pymorgan.oneD import plot # stage-function form
plot.plot_contour(data, label_style="/", cmap_ID="Rd/Wh/Bu v2")
For datasets with high dynamic range where weak features would otherwise be washed out by
dominant bleach or ESA peaks, plot_contour provides non-linear \(\operatorname{arcsinh}\)
colour scaling via Asinh=True (also toggled in the GUI plot controls). PyMORGAN applies an
inverse hyperbolic sine colour normalisation (matplotlib.colors.AsinhNorm) paired with
non-linear \(\sinh\)-spaced contour levels:
where \(s = \frac{p}{100} \cdot \max(|Z_{\min}|, |Z_{\max}|)\) is the linear crossover
threshold set by asinh_pct (\(p\), default 5.0%). Signals within \(\pm s\) behave
linearly, while larger amplitudes are compressed logarithmically. Because the underlying data
array is not mutated, coordinates and hover values retain their physical units (\(\mathrm{mOD}\)),
and colorbar ticks remain linear and centred at zero.
Composing Multi-Panel Figures and Displaying#
By default every plotter creates its own figure and axis. Passing an existing axis through
ax= draws into it instead, allowing multi-panel layouts or dataset overlays on a single axis:
Keyword |
Default |
Plotters |
|---|---|---|
|
|
All |
|
|
All |
|
|
|
|
|
|
import matplotlib.pyplot as plt
import pymorgan as pm
fig, (axL, axR) = plt.subplots(1, 2)
# Two maps side by side; suppress duplicated colorbar / y-axis label
dataA.plot_contour(ax=axL, show_colorbar=False)
dataB.plot_contour(ax=axR, show_ylabel=False)
pm.show_plots() # wrapper around plt.show(); pm.show is an alias
pm.close_plots() # close all open figures
Kinetic Analysis Seam & Noise Propagation#
Kinetic analysis (multi-exponential decays, global and target analysis with rate-matrix models, and Lifetime Density Analysis) lives in the companion project PyRATE-TA. PyMORGAN provides the two ends of that seam plus the per-point noise:
Trace extraction:
ax, t, Y = data.plot_kinetics([1950, 2000], plotStyle="-")returns the extracted tracesYof shape[Ndelays x Ncuts].Species spectra rendering:
data.plot_species_spectra(Sfit, Taus, TauErr, isFixTau, modelType)accepts plain arrays directly via*fit.as_species_args().Noise propagation:
Dataset1D.noise_array()returns[Ndelays x Npixels x Ndetectors]fromZstdv(sibling.pdatnfile) or the spread across single scans (Zss_R), enabling true reduced-\(\chi^2\) weighting in PyRATE-TA.One-click GUI handoff: In
pymorgan-gui, Action → Launch PyRATE-TA sends the currently active (background-, solvent-, and chirp-corrected) dataset directly into PyRATE-TA.
Graphical Interface — 1D Analysis & Processing Dialogs#
Advanced Scatter Removal Dialog#
Accessed via Pre-processing → Advanced Scatter Removal… or the compact Adv… button
beside the pre-zero background window controls, ScatterRemovalDialog
(src/pymorgan/gui/scatter_dialog.py) provides a live split-pane interface around
compute_scatter_removal():
Left controls sidebar: Pre-zero delay bounds, per-scan processing and
Zstdvnoise-update toggles, multi-band configuration table (enable toggle, editable label and bounds in the active spectral display unit, per-row Mode selectorAuto/Rank 1–Rank 4/Linked → #1, Auto-Detect, interactive Pick on Plot, + / −, shared Wing / Taper width overrides, positive-artefact toggle), algorithm selector (Adaptive Local SVD, Pre-Zero Template + Deriv., Warped Pre-Zero Template),Rank,TA poly,Exclude t0, slow-envelope broadband scaling, exact transmittance space, and saturation masking.Right 4-tab preview dashboard: Shares Zoom preset (Full Range or focused band), Asinh, and Zscale % controls across four interactive tabs:
2D Maps: Side-by-side maps comparing Static Pre-Zero, Advanced Clean, and Removed Scatter (Diff) with dashed band bounds and scroll-wheel zoom.
Spectral Slices: Stacked before-vs-after transient spectra at user-chosen delays.
Kinetics: Before-vs-after kinetic traces across side-wing and core probe channels (auto-populated via From Focused Band).
Scatter Diagnostics: Pre-zero spectrum equipped with an interactive Matplotlib
SpanSelector(activated by Pick on Plot), normalised basis shapes compared with template \(P_0\), and delay-dependent amplitude envelopes \(a(t)\) / \(a_{\mathrm{smooth}}(t)\) and centroid shift \(\delta\lambda(t)\).
Live metrics & state persistence: A footer readout summarises before/after pre-zero RMS, positive-delay spectral second-difference roughness relative to the wing reference, and inter-scan STD. Clicking Apply to Workspace commits the cleaned dataset and highlights the Adv… button; re-clicking Subtract bkg. preserves the active scatter result while checked, Reset to Static Bkg. restores static subtraction and original
Zstdv, and geometric or scan edits (crop,mask_probe_regions,shift_t0,recalc_average) clear it automatically.
Dataset Stitching: Wavelength and Timescale#
Accessed via Pre-Processing → Stitch Datasets:
Wavelength Stitching (
Stitch Wavelength Windows...): Automatically detects the shared probe interval \([\lambda_{\mathrm{min}}^{\mathrm{ovl}}, \lambda_{\mathrm{max}}^{\mathrm{ovl}}]\) between Dataset 1 and Dataset 2, evaluates the optimal least-squares amplitude scaling factor\[\alpha = \frac{\sum_{\tau, \lambda} Z_1(\tau, \lambda)\, Z_2(\tau, \lambda)}{\sum_{\tau, \lambda} Z_2(\tau, \lambda)^2}\]and blends the transition window using a raised-cosine taper weight:
\[w(\lambda) = \frac{1}{2} \left[ 1 + \cos\!\left( \pi \frac{\lambda - \lambda_{\mathrm{min}}^{\mathrm{ovl}}}{\lambda_{\mathrm{max}}^{\mathrm{ovl}} - \lambda_{\mathrm{min}}^{\mathrm{ovl}}} \right) \right], \qquad Z_{\mathrm{stitched}}(\tau, \lambda) = w(\lambda)\, Z_1(\tau, \lambda) + \big(1 - w(\lambda)\big)\, \alpha Z_2(\tau, \lambda)\]Timescale Stitching (
Stitch Timescales...): Calibrates delay offsets \(\Delta \tau_0\) and cross-scales overlapping femtosecond/picosecond optical delay scans with nanosecond/microsecond electronic delay measurements onto a unified temporal grid.
Singular Value Decomposition (SVD)#
Accessed via Analysis → Singular Value Decomposition (SVD)… (pymorgan.oneD.svd),
this tool performs model-free factorisation of the transient matrix
\(Z \in \mathbb{R}^{N_\tau \times N_\lambda}\):
The dialog displays a diagnostic scree plot (singular values \(\sigma_k\) and cumulative variance explained) and allows interactive rank-\(K\) noise filtering:
with real-time contour previews of the raw data, rank-\(K\) reconstruction, and residual map \(Z - Z_{\mathrm{filtered}}\).
Polarisation Anisotropy and Magic Angle#
Accessed via the top-level Anisotropy menu, supporting PyMESS slow-modulation .h5
datasets, multi-detector channels, paired parallel/perpendicular files, and legacy MESS folders.
With G-factor correction \(G = \Delta A_\parallel(\tau_{\mathrm{iso}}, \lambda) / \Delta A_\perp(\tau_{\mathrm{iso}}, \lambda)\),
PyMORGAN computes the time-resolved anisotropy \(r(\tau, \lambda)\), isotropic (magic-angle
\(54.7^\circ\)) absorbance change \(\Delta A_{\mathrm{iso}}(\tau, \lambda)\), and
polarisation difference \(\Delta I(\tau, \lambda)\):
Time Derivative of Spectra (\(\mathrm{d}(\Delta A)/\mathrm{d}t\))#
Accessed via Pre-Processing → Time Derivative of Spectra… (time_derivative_dialog.py /
time_derivative()), this dialog computes the numerical derivative
\(\partial \Delta A(\tau, \lambda) / \partial \tau\) along the delay axis with:
Early-delay cutoff: Trims delays \(\tau < \tau_{\min}\) prior to differentiation so the coherent artefact around \(t = 0\) does not dominate the derivative scale.
Time-domain interpolation: Resamples onto a denser temporal grid (\(N_{\text{interp}}\) points) prior to differentiation.
Pre-smoothing: Savitzky–Golay polynomial filtering or moving-average smoothing with live kinetic trace preview.