toolbox_scs.base

Subpackages

Submodules

Package Contents

Functions

knife_edge

knife_edge_base(positions, intensities[, axisRange, p0])

The base implementation of the knife-edge scan analysis.

Attributes

__all__

toolbox_scs.base.knife_edge(positions, intensities, axisRange=None, p0=None)

Calculates the beam radius at 1/e^2 from a knife-edge scan by fitting with erfc function: f(a,b,u) = a*erfc(u) + b or where u = sqrt(2)*(x-x0)/w0 with w0 the beam radius at 1/e^2 and x0 the beam center.

Parameters:
  • positions (np.ndarray) – Motor position values, typically 1D

  • intensities (np.ndarray) – Intensity values, could be either 1D or 2D, with the number or rows equivalent with the position size

  • axisRange (sequence of two floats or None) – Edges of the scanning axis between which to apply the fit.

  • p0 (list of floats, numpy 1D array) – Initial parameters used for the fit: x0, w0, a, b. If None, a beam radius of 100 um is assumed.

Returns:

  • width (float) – The beam radius at 1/e^2

  • std (float) – The standard deviation of the width

toolbox_scs.base.knife_edge_base(positions, intensities, axisRange=None, p0=None)[source]

The base implementation of the knife-edge scan analysis.

Calculates the beam radius at 1/e^2 from a knife-edge scan by fitting with erfc function: f(a,b,u) = a*erfc(u) + b or where u = sqrt(2)*(x-x0)/w0 with w0 the beam radius at 1/e^2 and x0 the beam center.

Parameters:
  • positions (np.ndarray) – Motor position values, typically 1D

  • intensities (np.ndarray) – Intensity values, could be either 1D or 2D, with the number or rows equivalent with the position size

  • axisRange (sequence of two floats or None) – Edges of the scanning axis between which to apply the fit.

  • p0 (list of floats, numpy 1D array) – Initial parameters used for the fit: x0, w0, a, b. If None, a beam radius of 100 um is assumed.

Returns:

  • popt (sequence of floats or None) – The parameters of the resulting fit.

  • pcov (sequence of floats) – The covariance matrix of the resulting fit.

toolbox_scs.base.__all__[source]