Usage

Fitting a function to data

To plot a power saturation curve, you can use the fitting_functions.power_saturation() function:

fitting_functions.power_saturation(x, p0)

A hyperbolic saturation function.

Parameters:
  • x (list[float] or np.array([float])) – 1D array of power values

  • p0 (list[I_inf, P_sat]) – Parameters for hyperbolic function

Returns:

1D array of intensity values

Return type:

type(x)

This is a hyperbolic function modeling the saturation of SPE emission under increasing excitation laser power. The function has the form

\[I(P) = \frac{I_{inf} P} {P + P_{sat}}\]

where \(I_{inf}\) is the asymptotic emission intensity, and \(P_{sat}\) is the power at which \(I(P) = \frac{1}{2} I_{inf}\).

Here is a simple example of its use:

>>> from fitting_functions import power_saturation
>>> intensities = power_saturation(powers, p0=[I_inf, P_sat])
[0.1, 1.4, ..., 5.7]