Startup State Restored from template.pxp

This page documents the non-code Igor objects that were present in Template_kly_2025_06_08/template.pxp and are now recreated by the source release.

Why This Exists

The GitHub release is source based: the panel is loaded from src/*.ipf files and the color tables are loaded from KP_NewColorTables.itx. A clean Igor experiment does not automatically contain root-level globals that were previously saved as experiment objects inside template.pxp.

Some older 𝐊𝐎𝐍𝐆 𝐏𝐚𝐧𝐞𝐥 display, graph-color, popup, and modeling workflows assume these globals already exist. To keep the source release compatible with those workflows, src/KP_GlobalState.ipf recreates the required root-level variables and strings when the main panel starts.

Startup Entry Point

KP_EnsureNewColorTables()
KP_EnsureStartupGlobals()
NewPanel ...

KP_EnsureStartupGlobals() runs KP_EnsurePhysicalConstants() and KP_EnsureTemplateRootGlobals(). Template root globals are created only when missing, so existing analysis state in an active experiment is not reset.

Physical Constants

VariableDefault valueMeaning
q01.602176634e-19Elementary charge, \(q_0\), in \(\mathrm{C}\).
h6.62607015e-34Planck constant, \(h\), in \(\mathrm{J\,s}\).
G03.87404586493e-5Conductance quantum, \(G_0=e^2/h\), in \(\mathrm{S}\).
muB9.2740100783e-24Bohr magneton, \(\mu_B\), in \(\mathrm{J/T}\).
kB1.380649e-23Boltzmann constant, \(k_B\), in \(\mathrm{J/K}\).
eV1.602176634e-19Electron-volt conversion, \(1\,\mathrm{eV}\), in \(\mathrm{J}\).
meV1.602176634e-22Millielectron-volt conversion, \(1\,\mathrm{meV}\), in \(\mathrm{J}\).
m09.1093837015e-31Electron rest mass, \(m_0\), in \(\mathrm{kg}\).
epslon08.8541878128e-12Vacuum permittivity, \(\epsilon_0\), in \(\mathrm{F/m}\). The historical spelling is preserved.

Template Numeric Globals

VariableDefault valueTypical use
topgraphnum0Active graph/image index used by display helper controls.
topimagemin3.39009e-35Stored lower color-scale bound for top image display.
topimagemax4747.39Stored upper color-scale bound for top image display.
topimageminratio2.38308e-44Stored lower color-scale ratio for top image display.
topimagemaxratio0.0432301Stored upper color-scale ratio for top image display.
colorsetedc5Color-table popup/index state for EDC or graph coloring workflows.
colorsetedc26Secondary color-table popup/index state.
colorinverseedc1Inverted-color flag for EDC or graph coloring workflows.
topgraphnum10Secondary active graph/image index used by related display helpers.
topimagemin10.0234619Secondary lower image color-scale bound.
topimagemax10.120291Secondary upper image color-scale bound.
topimageminratio10Secondary lower color-scale ratio.
topimagemaxratio11Secondary upper color-scale ratio.
colorindexuser1User color-index selector state.
colorsetedc347Custom color-table selector state; matches the 47 KP color tables.
typeofdata4Data-type selector state used by panel and loader branches.
minsetvar0Stored minimum value from display/format controls.
maxsetvar0Stored maximum value from display/format controls.
zn_cons23D matrix Z/energy-plane selector used by smart display and graph controls.
V_Flag0Branch flag retained for compatibility with older procedures.

Template String Globals

StringDefault valueTypical use
topgraphimageZslice_g2_padFFT_ModulaStored image-wave name for active graph display workflows.
topgraphnameGraph11Stored graph/window name used by graph helper routines.
topgraphcolorroot:Packages:NewColortable:dvg_bwr_20_95_c54Stored color table path for the active image.
topgraphcolorinv0Stored inverse-color flag as a string.
topgraphimage1Secondary stored image-wave name.
topgraphname1Secondary stored graph/window name.
topgraphcolor1Rainbow256Secondary stored color-table name.
topgraphcolorinv10Secondary inverse-color flag as a string.
S_infoProcGlobal#KMFileOpenHook;Preserved Igor hook information string from the template experiment.

Validation Commands

print ItemsInList(WaveList("*",";","",root:Packages:NewColortable:))
// Expected: 47

print topgraphnum, colorsetedc3, G0, epslon0
// Expected: 0  47  3.87405e-05  8.85419e-12

print topgraphcolor, S_info
// Expected: root:Packages:NewColortable:dvg_bwr_20_95_c54  ProcGlobal#KMFileOpenHook;

The current source release was validated in a clean Igor Pro 9 experiment with these checks.