merge_voltage_clustersο
- plasmapy.analysis.swept_langmuir.helpers.merge_voltage_clusters(
- voltage: ndarray,
- current: ndarray,
- voltage_step_size: float | None = None,
- filter_nan: bool = False,
Search the
voltagearray for closely spaced voltage clusters based on thevoltage_step_sizeparameter and merge those clusters, and associatedcurrentvalues, into a single point.This function is intended to merge together identical, or close, voltage points to remove small step sizes in the swept langmuir trace before differentiation.
- Parameters:
voltage (
numpy.ndarray) β 1Dnumpy.ndarrayrepresenting the voltage of the swept Langmuir trace. Voltage needs to be monotonically ascending. No units are assumed or checked, but values should be in volts.current (
numpy.ndarray) β 1Dnumpy.ndarrayrepresenting 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.voltage_step_size (
float|None, default:None) β A non-zero, positive step size for thevoltagearray cluster identification. A value of0will merge only duplicate voltage values. A value ofNonewill default to 95% of the average step size of thevoltagearray (only counting duplicate voltages once).filter_nan (
bool, default:False) β SetTrueto automatically filternanvalues from thevoltageandcurrentarrays.
- Returns:
voltage (
numpy.ndarray) β The newvoltagearray.current (
numpy.ndarray) β The newcurrentarray.
Notes
An identified voltage cluster can span a voltage range larger than
voltage_step_sizeand still have every voltage step being smaller thanvoltage_step_size. In this scenario, the voltage cluster will be divided up into \(N\)-sections for averaging, where \(N\) is given by\[N = \texttt{floor}\left( \frac{V_{cluster,max} - V_{cluster,min}}{\texttt{voltage_step_size}} \right)\]