Profile Functions
Parameter-profile functions for auxiliary-axis-resolved spectroscopy models.
Function Conventions
Use CamelCase naming (UpperCamelCase) for function names (with p prefix).
Profile functions must be named pFunctionName (starting with p for profile)
to distinguish them from energy- and time-domain functions.
Profile Functions: Signature: func(x, par1, par2, …) - x: Auxiliary axis (e.g. depth, position, fluence) - par1, par2, …: Function-specific parameters - Returns: Profile values as numpy array (same shape as x)
Usage Context:
Profile functions are attached to an energy-model parameter via
File.add_par_profile(...). During evaluation, the profiled parameter is
sampled across the auxiliary axis and the resulting component traces are
uniformly averaged over that axis.
Parameter Naming
Common parameter names: - A: Amplitude - tau: Decay length/constant - m: Slope - b: Intercept - x0: Center position - SD: Standard deviation (width)
Use descriptive names without underscores.
Adding New Functions
To add a new profile function:
Implement a function named
pFunctionName(x, ...)Return an array matching the shape of
xKeep parameters physically meaningful and unit-consistent
- trspecfit.functions.profile.pExpDecay(x: ndarray, A: float, tau: float) ndarray[source]
Exponential decay profile.
- Parameters:
Notes
Primary use cases: IMFP-weighted depth profiles in XPS, Beer-Lambert absorption profiles in pump-probe.