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:

  1. Implement a function named pFunctionName(x, ...)

  2. Return an array matching the shape of x

  3. Keep parameters physically meaningful and unit-consistent

trspecfit.functions.profile.pExpDecay(x: ndarray, A: float, tau: float) ndarray[source]

Exponential decay profile.

Parameters:
  • x (ndarray) – Auxiliary axis (e.g. depth, position).

  • A (float) – Amplitude at x=0.

  • tau (float) – Decay constant (same units as x).

Notes

Primary use cases: IMFP-weighted depth profiles in XPS, Beer-Lambert absorption profiles in pump-probe.

trspecfit.functions.profile.pGauss(x: ndarray, A: float, x0: float, SD: float) ndarray[source]

Gaussian profile.

Parameters:
  • x (ndarray) – Auxiliary axis.

  • A (float) – Peak amplitude.

  • x0 (float) – Center position.

  • SD (float) – Standard deviation (width).

Notes

Primary use cases: fluence averaging, inhomogeneous broadening.

trspecfit.functions.profile.pLinear(x: ndarray, m: float, b: float) ndarray[source]

Linear profile.

Parameters:
  • x (ndarray) – Auxiliary axis.

  • m (float) – Slope.

  • b (float) – Intercept.

Notes

Primary use cases: band bending over depth, center offset over position.