Settings & Aesthetics#
Every presentation choice that is not intrinsic to the data lives in a single
Settings object: the Matplotlib style profile, label and unit
conventions, colour scale, axis units, and the parameters of the spectral-diffusion and chirp
analyses. One instance is active at a time; the plotting routines read it, and any call may
override individual values.
import pymorgan as pm
pm.load_settings("settings.toml") # read a file
pm.update_settings(cmap="Seismic", quick_plots=True)
s = pm.get_settings() # the active object
pm.save_settings("settings.toml") # write it back, comments preserved
with pm.use_settings(profile="poster"): # temporary override
data.plot_contour()
Values are coerced to the declared type, so a string from a text field or a TOML file becomes the
right enum, number, path, or pair: pm.update_settings(contour_figsize="9, 5") and
pm.update_settings(x_axis_unit="nm") both work. An unknown name raises TypeError rather
than being silently stored.
The Configuration File & GUI Editor#
settings.tomlis read at start-up (the GUI looks in the working directory first, then next to the package) and written back by Save permanently in the settings dialog. Comments and ordering survive a round trip.In
pymorgan-gui, View → Aesthetics / Settings… (or standalonepymorgan-settings) opens a panel whose widgets are generated from the settings themselves and grouped into four tabs: Common, 1D, 2D, and GUI & Defaults.
Common Settings#
Shared by every plot: style profile, labels, colour scale, and spectral axis units.
Key |
Label in Panel |
Type / Choices |
Default |
|---|---|---|---|
|
Style profile |
|
|
|
Font scale |
|
|
|
Axis-label style |
|
|
|
\(\Delta A\) units |
|
|
|
Colourmap |
|
|
|
White/Zero levels |
|
|
|
arcsinh linear % |
|
|
|
Spectral X-axis unit |
|
|
|
Complementary X axis |
|
|
|
Round trace labels |
|
|
|
Use quick plots (fast redraws) |
|
|
|
Steady-state dash pattern |
|
|
1D Settings#
Delay-axis scaling and the appearance of kinetic / transient-spectra traces.
Key |
Label in Panel |
Type / Choices |
Default |
|---|---|---|---|
|
Time-axis scale |
|
|
|
Time-axis labels |
|
|
|
Kinetics marker size |
|
|
|
Kinetics line width |
|
|
|
Legend entry spacing |
|
|
|
Prune legend |
|
|
|
Max legend entries |
|
|
|
Steady-state abs. colour |
|
|
|
Steady-state em. colour |
|
|
|
Steady-state line width |
|
|
|
Steady-state line alpha |
|
|
|
Steady-state fill alpha |
|
|
|
Cuts inherit plot limits |
|
|
|
Load single scans (1D & 2D) |
|
|
|
Chirp boundary handling |
|
|
|
Chirp parallel fitting |
|
|
|
Per-pixel solvent \(t_0\) offset |
|
|
|
Per-pixel solvent amplitude scale |
|
|
|
Error shading (\(\pm 1\;\text{std}\)) |
|
|
|
Error shading alpha |
|
|
2D Settings#
Map appearance, axis units, and spectral-diffusion / Kubo analysis parameters.
Key |
Label in Panel |
Type / Choices |
Default |
|---|---|---|---|
|
2D frequency labels |
|
|
|
2D pump axis orientation |
|
|
|
2D axis unit |
|
|
|
\(t_2\) delay label format |
|
|
|
CLS colour |
|
|
|
IvCLS colour |
|
|
|
NLS colour |
|
|
|
Overlay draw style |
|
|
|
Overlay linewidth |
|
|
|
Intensity threshold (top x%) |
|
|
|
Peak search range (\(\text{cm}^{-1}\)) |
|
|
|
Target peak type |
|
|
|
Peak interpolation |
|
|
|
Interpolation factor (upsampling) |
|
|
|
Kubo joint fit FTIR vs 2D weight |
|
|
GUI and Defaults Settings#
Application preferences and default selections when the GUI starts.
Key |
Label in Panel |
Type / Choices |
Default |
|---|---|---|---|
|
GUI theme |
|
|
|
Splash-screen duration (s) |
|
|
|
Default data directory |
|
|
|
Default 1D data type |
1D loader token |
|
|
Default 2D data type |
2D loader token |
|
|
Default calibration setup |
|
|
|
Style directory (blank = bundled) |
|
|
|
Contour figure size (w, h in) |
|
|
|
Kinetics figure size (w, h in) |
|
|
|
Spectra figure size (w, h in) |
|
|
Declared Axis Units (axis_units())#
Both Dataset1D and Dataset2D
report the units of their axes through axis_units(), which returns a
DatasetUnits record holding one entry per axis (x, y, z,
and t2):
u = data.axis_units() # 1D: x = probe, y = delay, z = signal
u.x.unit # 'cm-1'
u.x.label() # 'Wavenumber (cm$^{-1}$)'
u.y.quantity # 'Delay'
print(u) # readable summary of all axes
u.as_dict() # plain nested dict for export
v = d2.axis_units(display=True) # 2D: converted to active display units & 10^3 factor
v.t2.unit # 'ps'