check_sweep

plasmapy.analysis.swept_langmuir.helpers.check_sweep(voltage: ndarray, current: ndarray, strip_units: bool = True) tuple[ndarray, ndarray][source]

Function for checking that the voltage and current arrays are properly formatted for analysis by plasmapy.analysis.swept_langmuir.

Parameters:
  • voltage (numpy.ndarray) – 1D numpy.ndarray representing the voltage of the swept Langmuir trace. Voltage should be monotonically increasing. No units are assumed or checked, but values should be in volts.

  • current (numpy.ndarray) – 1D numpy.ndarray representing the current of the swept Langmuir trace. Values should start from a negative ion-saturation current and increase to a positive electron-saturation current. No units are assumed or checked, but values should be in amperes.

  • strip_units (bool) – (Default: True) If True, then the units on voltage and/or current will be stripped if either are passed in as an Astropy Quantity.

Returns:

  • voltage (numpy.ndarray) – Input argument voltage after it goes through all of its checks and conditioning.

  • current (numpy.ndarray) – Input argument current after it goes through all of its checks and conditioning.

Raises:
  • TypeError – If either the voltage or current arrays are not instances of a numpy.ndarray.

  • ValueError – If either the voltage or current arrays are not 1D.

  • ValueError – If the voltage array is not monotonically increasing.

  • ValueError – If the current array never crosses zero (i.e. has no floating potential).

  • ValueError – If the current array does not start form a negative ion-saturation current and increases to a positive electron-saturation current.

  • ValueError – If either the voltage or current array does not have a numpy.dtype of either numpy.integer or numpy.floating.