Graphical Interface & Settings#
Launching the GUI#
Launch with uv run pyrate-ta-gui (or python -m pyrate_ta.gui). The window reuses
PyMORGAN’s WidgetPlot, PlotControlsPanel, and theme so the two applications look
identical side by side.
Window Layout#
Left Column (Scrollable Control Panel):
Data: Load, clear, and two status lamps (one for the dataset, one for per-point noise from a sibling
.pdatnfile or single-scan spread).Model Selection: Parallel / Sequential / Target / ODE-defined.
Components: Lifetime table with initial guesses, lower/upper bounds, fixed checkboxes, and add/remove row controls.
IRF and Time-Zero: IRF mode (
None,Gaussian,Clip), FWHM, \(t_0\), and Fit coherent artefact checkbox.Fit Options: Algorithm (defaults to Trust Region Reflective to honour positivity bounds), restrict-to-display-limits, and noise weighting.
Fit Control: View selector (Data / Fit / Residuals), Preview, FIT DATA, Reset, statistic read-out (SSR or red. chi2), Copy taus, Plot DAS/EAS/SAS, Concentrations, Export DAS/EAS/SAS…, Export Conc…, Export Surfaces…, Export All… (folder or single
.zip), and Steady-State Reference GSB/SE de-bleaching controls (also reachable under File → Export …).
Plot Area (\(3 \times 3\) Synchronised Grid):
Top-left \(2 \times 2\) block: 2D contour map.
Top-right \(2 \times 1\) column: Rotated kinetic traces (sharing the vertical delay axis with the contour map).
Bottom-left \(1 \times 2\) row: Transient spectra (sharing the horizontal probe axis with the contour map).
Bottom-right cell: Additional plots and cuts buttons for multi-cut stand-alone figures.
Bottom Panel: Shared PyMORGAN
PlotControlsPanel(axis limits, colour scale, \(\operatorname{arcsinh}\) toggle, contour levels, time-axis convention, and probe units).
Exporting Fit Results from the GUI#
Once a fit has run (or a .prfit session is loaded via File → Load Fit Session…), the
four export buttons at the bottom of Fit Control (mirrored under File → Export …) become
active:
Export DAS… / Export EAS… / Export SAS…: Writes
<stem>_<DAS|EAS|SAS>_<timestamp>.csvplus<stem>_fit_summary_<timestamp>.txt(automatically appending side-by-side_abscolumns whenever Plot GSB-recovered positive spectra is checked).Export Conc…: Writes
<stem>_concentrations_<timestamp>.csv(including the GaussianIRFcolumn when active) plus<stem>_fit_summary_<timestamp>.txt.Export Surfaces…: Exports all three 2D surfaces (
data,fit,residuals) in.pdatorientation (rows = delays, columns = probe) plus the companion.txtsummary at once — choose CSV, PyMORGAN PDAT (``.pdat``), TSV, or a single ZIP Archive (``.zip``) directly from the file-dialog format filter.Export All…: Exports the complete bundle (DAS/EAS/SAS CSV + concentrations CSV + all three 2D surfaces +
.txtfit summary) either into a folder or packed into a single.zipfile (with CSV or PDAT surfaces selectable in the dialog filter, or directly via File → Export All Fit Results (.zip)…).
The K-Matrix Editor & Scheme Graph#
Define model… opens the interactive reaction-scheme editor: reaction text notation on the left, live horizontal compartment diagram and derived \(\mathbf{K}\) matrix on the right. Clicking Update K graph validates the syntax (reporting line numbers on error) and enables OK once valid.
Show kinetic graph opens a stand-alone compartment diagram of the active model before or after fitting.
The LDA Tab#
The LDA tab provides interactive Lifetime Density Analysis organised into three side-by-side control groups:
Regularisation & Solver: Penalty type (
ridge/d1/d2), alpha selection method (lcurve/gcv/morozov/fixed), and explicit \(\alpha\) value.Lifetime Grid & Options: Number of log-spaced lifetimes, \([\tau_{\min}, \tau_{\max}]\) bounds, SVD rank pre-filtering (\(K\)), non-negative constraint, coherent-artefact suppression, and bootstrap iterations.
Actions & Diagnostics: Run LDA button, diagnostic view toggles (integrated amplitude spectrum \(A(\tau)\), L-curve/GCV curve, 2D heatmap \(S(\tau, \lambda)\), and detected peak centroid table), and Export map… to save as a
.pdatfile.
Analysis & LDA Settings (settings.toml)#
Presentation belongs to pymorgan.settings.Settings; PyRATE-TA’s own
Settings stores analysis-only fields in settings.toml:
Field |
Default |
Group |
Meaning |
|---|---|---|---|
|
|
|
Components proposed for a new fit |
|
|
|
Default model family |
|
|
|
Default fitting window |
|
|
|
|
|
|
|
Fixed IRF width; |
|
|
|
Clip delays below this (mode |
|
|
|
Termination tolerance on the cost |
|
|
|
Termination tolerance on the parameters |
|
|
|
Cap on optimiser iterations |
|
|
|
Solve linear amplitudes in closed form |
|
|
|
Report linearised \(1\sigma\) errors |
|
|
|
Weight residuals by per-point noise \(1/\sigma\) |
|
|
|
Clip \(\sigma\) below this fraction of the median |
|
|
|
Warn when two lifetimes come within this ratio |
|
|
|
Default directory offered by the file dialog |
Field |
Default |
Meaning |
|---|---|---|
|
|
Grid points in the lifetime axis |
|
|
Grid lower bound ( |
|
|
Grid upper bound ( |
|
|
Alpha selection: |
|
|
Regularisation strength when |
|
|
Constrain lifetime density distribution to \(\ge 0\) |
import pyrate_ta as pr
pr.load_settings("settings.toml")
pr.update_settings(n_components=3, irf_mode="Clip", t_min=0.3)
pr.save_settings("settings.toml")
In the GUI, View → Settings… opens a dual-tab editor containing both Analysis (PyRATE-TA) and Aesthetics (PyMORGAN) so both packages’ settings can be adjusted and saved live from one dialog.