find_floating_potential¶

plasmapy.analysis.swept_langmuir.
find_floating_potential
(voltage: numpy.ndarray, current: numpy.ndarray, threshold: int = 1, min_points: Optional[Union[int, float]] = None, fit_type: str = 'exponential')¶ Determines the floating potential (\(V_f\)) for a given currentvoltage (IV) curve obtained from a swept Langmuir probe. The floating potential is the probe bias where the collected current equals zero \(I = 0\). (For additional details see the Notes section below.)
Aliases:
find_vf_
 Parameters
voltage (
numpy.ndarray
) – 1D numpy array of monotonically ascending/descending probe biases (should be in volts)current (
numpy.ndarray
) – 1D numpy array of probe current (should be in amperes) corresponding to thevoltage
arraythreshold (positive, nonzero
int
) – Max allowed index distance between crossingpoints before a new crossingisland is formed. That is, ifthreshold=5
then consecutive crossingpoints are considered to be in the same crossingisland if they are within 5 index steps of each other. (Default: 1)min_points (positive
int
orfloat
) –Minimum number of data points required for the fitting to be applied to. See Notes section below for additional details. The following list specifies the optional values:
min_points = None
(Default) The largest of 5 andfactor * array_size
is taken, wherearray_size
is the size ofvoltage
andfactor = 0.1
forfit_type = "linear"
and0.2
for"exponential"
.min_points = numpy.inf
The entire passed array is fitted.min_points >= 1
Exact minimum number of points.0 < min_points < 0
The minimum number of points is taken asmin_points * array_size
.
fit_type (str) –
The type of curve to be fitted to the Langmuir trace,
"linear"
or"exponential"
(Default). This selects whichFitFunction
class should be applied to the trace.linear
exponential
 Returns
vf (
float
ornumpy.nan
) – The calculated floating potential (same units as thevoltage
array). Returnsnumpy.nan
if the floating potential can not be determined. How \(V_f\) is calculated depends on the fit function. This is described in theroot_solve()
method of the relevant fit function (e.g. theroot_solve()
method ofExponentialPlusOffset
).vf_err (
float
ornumpy.nan
) – The uncertainty associated with the floating potential calculation (units same asvf
). Returnsnumpy.nan
if the floating potential can not be determined. Like \(V_f\):, the calculation depends on the applied fit function. Theroot_solve()
method also describes how this is calculated.rsq (
float
) – The coefficient of determination (rsquared) value of the fit. See the documentation of thersq
property on the associated fit function (e.g. thersq
property ofExponentialPlusOffset
).func (subclass of
AbstractFitFunction
) – The callable function \(f(x)\) representing the fit and its results.islands (
List[slice]
) – List ofslice
objects representing the indices of the identified crossingislands.indices (
slice
) – Aslice
object representing the indices ofvoltage
andcurrent
arrays used for the fit.
Notes
The internal functionality works like:
The current array
current
is scanned for all points equal to zero and point pairs that straddle \(I = 0\). This forms an array of “crossingpoints.”The crossingpoints are then grouped into “crossingislands” in based on the
threshold
keyword.A new island is formed when a successive crossingpoint is more (index) steps away from the previous crossingpoint than allowed by
threshold
.If multiple crossingislands are identified, then the span from the first point in the first island to the last point in the last island is compared to
min_points
. If the span is less than or equal tomin_points
, then that span is taken as one larger crossingisland for the fit; otherwise, the function is incapable of identifying \(V_f\) and will returnnumpy.nan
values.
To calculate the floating potential…
If the crossingisland contains fewer points than
min_points
, then each side of the crossingisland is equally padded with the nearest neighbor points untilmin_points
is satisfied.A fit is then performed using
scipy.stats.linregress
forfit_type="linear"
andscipy.optimize.curve_fit
forfit_type="exponential"
.