Class SimpleCurve
- Namespace
- PalmSens.Core.Simplified.Data
- Assembly
- PalmSens.Core.Simplified.dll
public class SimpleCurve : IDisposable
- Inheritance
-
SimpleCurve
- Implements
- Inherited Members
Constructors
SimpleCurve(Curve, SimpleMeasurement)
Initializes a new instance of the SimpleCurve class.
public SimpleCurve(Curve curve, SimpleMeasurement simpleMeasurement)
Parameters
curveCurveThe Curve.
simpleMeasurementSimpleMeasurement
Exceptions
- ArgumentNullException
Cannot create an instance of SimpleCurve when curve is null
Fields
Curve
The original curve
public Curve Curve
Field Value
- Curve
Properties
Channel
Gets the channel that the measurement was measured on.
public int Channel { get; }
Property Value
- int
The channel.
FullTitle
Gets the full title, the title of the SimpleMeasurement and SimpleCurve combined.
public string FullTitle { get; }
Property Value
- string
The full title.
IsFinished
Gets a value indicating whether this SimpleCurve is finished measuring.
public bool IsFinished { get; }
Property Value
- bool
trueif SimpleCurve is finished measuring; otherwise,false.
Levels
Gets the list of levels detected in this curve.
public CFALevelList Levels { get; }
Property Value
- CFALevelList
The peaklist.
MuxChannel
Gets the mux channel that the curve was measured on.
public int MuxChannel { get; }
Property Value
- int
The mux channel.
NDataPoints
Gets the amount of data points in the SimpleCurve.
public int NDataPoints { get; }
Property Value
- int
The amount of data points.
Peaks
Gets the list of peaks detected in this curve.
public PeakList Peaks { get; }
Property Value
- PeakList
The peaklist.
Title
Gets or sets the title of the SimpleCurve.
public string Title { get; set; }
Property Value
- string
The title.
XAxisDataType
Gets the type data on the X-Axis.
public DataArrayType XAxisDataType { get; }
Property Value
- DataArrayType
The type data on the X-Axis.
XAxisValues
Gets the X-Axis values.
public double[] XAxisValues { get; }
Property Value
- double[]
The X-Axis values.
XUnit
Gets the unit of the X-Axis.
public string XUnit { get; }
Property Value
- string
The unit.
YAxisDataType
Gets the type data on the Y-Axis.
public DataArrayType YAxisDataType { get; }
Property Value
- DataArrayType
The type data on the Y-Axis.
YAxisValues
Gets the Y-Axis values.
public double[] YAxisValues { get; }
Property Value
- double[]
The Y-Axis values.
YUnit
Gets the unit of the Y-Axis.
public string YUnit { get; }
Property Value
- string
The unit.
Methods
Add(SimpleCurve)
Adds the specified SimpleCurve to this SimpleCurve.
public SimpleCurve Add(SimpleCurve add)
Parameters
addSimpleCurveThe SimpleCurve to add.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before adding or SimpleCurves must have the same number of data points
Add(SimpleCurve, int)
Adds the specified SimpleCurve to this SimpleCurve starting from a specified index.
public SimpleCurve Add(SimpleCurve add, int from)
Parameters
addSimpleCurveThe SimpleCurve to add.
fromintThe index to start adding from.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before adding or The index to start adding from exceeds the bounds of the SimpleCurves
Add(SimpleCurve, int, int)
Adds the specified SimpleCurve to this SimpleCurve over a specified range.
public SimpleCurve Add(SimpleCurve add, int from, int count)
Parameters
addSimpleCurveThe SimpleCurve to add.
fromintThe index to start adding from.
countintThe number of datapoints in the range.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before adding or The range to add exceeds the bounds of the SimpleCurves
Add(double)
Adds the specified value to this SimpleCurve.
public SimpleCurve Add(double add)
Parameters
adddoubleThe value to add.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before exponentiating
Average()
The average of this SimpleCurve.
public double Average()
Returns
- double
The average value on the Y axis
Exceptions
- Exception
Wait untill SimpleCurve is finished before determining its average
ClearPeaks()
Clears the peaks.
public void ClearPeaks()
Exceptions
- Exception
Wait untill SimpleCurve is finished before detecting peaks
Clone()
Clones this instance.
public SimpleCurve Clone()
Returns
- SimpleCurve
A copy of this SimpleCurve
Exceptions
- Exception
Wait untill SimpleCurve is finished before cloning
DetectLevelsAsync(double, double, bool, LevelDetectProgress)
Detects the levels asynchronous.
public Task DetectLevelsAsync(double minLevelWidth, double minLevelHeight, bool clearLevels = true, LevelDetectProgress levelDetectProgress = null)
Parameters
minLevelWidthdoubleMinimum width of the level.
minLevelHeightdoubleMinimum height of the level.
clearLevelsboolif set to
true[clear existing levels].levelDetectProgressLevelDetectProgress
Returns
Exceptions
- Exception
Wait untill SimpleCurve is finished before detecting peaks
DetectPeaks(double, double, bool, bool, bool)
Detects peaks.
public void DetectPeaks(double minPeakWidth = 0, double minPeakHeight = 0, bool clearPeaks = true, bool useHiddenPeakDetectionAlgorithm = false, bool mergeOverlappingPeaks = false)
Parameters
minPeakWidthdoubleMinimum width of the peak.
minPeakHeightdoubleMinimum height of the peak.
clearPeaksboolif set to
true[clear existing peaks].useHiddenPeakDetectionAlgorithmboolif set to
true[use hidden peak detection algorithm].mergeOverlappingPeaksboolif set to
true[merge overlapping peaks].
Exceptions
- Exception
Wait untill SimpleCurve is finished before detecting peaks
- Exception
Wait untill SimpleCurve is finished before detecting peaks
DetectPeaksAsync(double, double, bool, PeakTypes, PeakDetectProgress)
Detects the peaks asynchronous.
public Task DetectPeaksAsync(double minPeakWidth = 0, double minPeakHeight = 0, bool clearPeaks = true, PeakTypes peakType = PeakTypes.Default, PeakDetectProgress peakDetectProgress = null)
Parameters
minPeakWidthdoubleMinimum width of the peak.
minPeakHeightdoubleMinimum height of the peak.
clearPeaksboolif set to
true[clear existing peaks].peakTypePeakTypesType of peak.
peakDetectProgressPeakDetectProgress
Returns
Exceptions
- Exception
Wait untill SimpleCurve is finished before detecting peaks
Differentiate()
Differentiates this SimpleCurve.
public SimpleCurve Differentiate()
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before differntiating or At least two datapoints are required for differentiation
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Exponentiate(double)
Exponentiates this SimpleCurve to the specified power.
public SimpleCurve Exponentiate(double power)
Parameters
powerdoubleThe power.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before exponentiating
FitEquivalentCircuit(CircuitModel, FitOptionsCircuit, FitProgress)
Fits the equivalent circuit.
public Task<FitResult> FitEquivalentCircuit(CircuitModel circuitModel, FitOptionsCircuit fitOptions = null, FitProgress fitProgress = null)
Parameters
circuitModelCircuitModelThe circuit model.
fitOptionsFitOptionsCircuitThe fit options.
fitProgressFitProgressThe fit progress.
Returns
- Task<FitResult>
Exceptions
- Exception
Wait untill SimpleCurve is finished before detecting peaks or No impedimetric readings available in parent SimpleMeasurement or The circuit model must be defined
FitEquivalentCircuit(string, double[], FitOptionsCircuit, FitProgress)
Fits the equivalent circuit.
public Task<FitResult> FitEquivalentCircuit(string cdc, double[] initialParameters = null, FitOptionsCircuit fitOptions = null, FitProgress fitProgress = null)
Parameters
cdcstringThe circuit descriptor code (CDC) defining the circuit.
initialParametersdouble[]The initial parameters.
fitOptionsFitOptionsCircuitThe fit options.
fitProgressFitProgressThe fit progress.
Returns
- Task<FitResult>
Exceptions
- Exception
Wait untill SimpleCurve is finished before detecting peaks or No impedimetric readings available in parent SimpleMeasurement
- ArgumentNullException
The circuit descriptor code (cdc) must be specified
- ArgumentException
Invalid circuit descriptor code (cdc) or The amount of parameters in the model does not match the number of parameters specified in the initial parameter array
Integrate()
Integrates this SimpleCurve.
public double Integrate()
Returns
- double
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before integration
Integrate(int)
Integrates this SimpleCurve from a specified index.
public double Integrate(int from)
Parameters
fromintThe index to start integrating from.
Returns
- double
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before integration or The index to start adding from exceeds the bounds of the SimpleCurve
Integrate(int, int)
Integrates this SimpleCurve over a specified range
public double Integrate(int from, int count)
Parameters
Returns
- double
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before integration or The range to add exceeds the bounds of the SimpleCurve
Log10()
Converts this SimpleCurve to 10 base logarithm.
public SimpleCurve Log10()
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before converting it to the 10 base logarithm
Maximum()
The maximum of this SimpleCurve.
public double Maximum()
Returns
- double
The maximum value on the Y axis
Exceptions
- Exception
Wait untill SimpleCurve is finished before determining its maximum
Minimum()
The minimum of this SimpleCurve.
public double Minimum()
Returns
- double
The minimum value on the Y axis
Exceptions
- Exception
Wait untill SimpleCurve is finished before determining its minimum
MovingAverageBaseline(int, int)
Determines the moving average baseline of this SimpleCurve.
public SimpleCurve MovingAverageBaseline(int windowSize = 2, int maxSweeps = 1000)
Parameters
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before determining its moving average baseline or The PalmSens SDK does not support determing the moving average baseline for Cyclic Voltammetry, Impedance and Mixed Mode measurements
Multiply(SimpleCurve)
Multiplies the specified SimpleCurve with this SimpleCurve.
public SimpleCurve Multiply(SimpleCurve multiply)
Parameters
multiplySimpleCurveThe SimpleCurve to multiply by.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before multiplying or SimpleCurves must have the same number of data points
Multiply(SimpleCurve, int)
Multiplies the specified SimpleCurve with this SimpleCurve starting from a specified index.
public SimpleCurve Multiply(SimpleCurve multiply, int from)
Parameters
multiplySimpleCurveThe multiply.
fromintThe index to start multiplying by.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before multiplying or The index to start adding from exceeds the bounds of the SimpleCurves
Multiply(SimpleCurve, int, int)
Multiplies the specified SimpleCurve with this SimpleCurve over a specified range.
public SimpleCurve Multiply(SimpleCurve multiply, int from, int count)
Parameters
multiplySimpleCurveThe multiply.
fromintThe index to start multiplying by.
countintThe number of datapoints in the range.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before multiplying or The range to add exceeds the bounds of the SimpleCurves
Multiply(double)
Multiplies this SimpleCurve by the specified value.
public SimpleCurve Multiply(double multiply)
Parameters
multiplydoubleThe value to multiply by.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before multiplying
Smooth(SmoothLevel)
Smoothes the data on the Y-axis with the Savitzky-Golay filter. Smooth levels are: spike rejection = 0, low = 1, medium = 2, high = 3, very high = 4.
public SimpleCurve Smooth(SmoothLevel smoothLevel)
Parameters
smoothLevelSmoothLevelThe smooth level.
Returns
- SimpleCurve
A smoothed copy of this SimpleCurve
Exceptions
- Exception
Wait untill SimpleCurve is finished before smoothing
Smooth(int)
Smoothes the data on the Y-axis with the Savitzky-Golay filter.
public SimpleCurve Smooth(int windowSize)
Parameters
windowSizeint
Returns
- SimpleCurve
A smoothed copy of this SimpleCurve
Exceptions
- Exception
Wait untill SimpleCurve is finished before smoothing
Subtract(SimpleCurve)
Subtracts the specified SimpleCurve to this SimpleCurve.
public SimpleCurve Subtract(SimpleCurve subtract)
Parameters
subtractSimpleCurveThe SimpleCurve to subtract.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before subtracting or SimpleCurves must have the same number of data points
Subtract(SimpleCurve, int)
Subtracts the specified SimpleCurve from this SimpleCurve starting from a specified index.
public SimpleCurve Subtract(SimpleCurve subtract, int from)
Parameters
subtractSimpleCurveThe SimpleCurve to subtract.
fromintThe index to start subtracting from.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before subtracting or The index to start adding from exceeds the bounds of the SimpleCurves
Subtract(SimpleCurve, int, int)
Subtracts the specified SimpleCurve from this SimpleCurve over a specified range.
public SimpleCurve Subtract(SimpleCurve subtract, int from, int count)
Parameters
subtractSimpleCurveThe SimpleCurve to subtract.
fromintThe index to start subtracting from.
countintThe number of datapoints in the range.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurves are finished before subtracting or The range to add exceeds the bounds of the SimpleCurves
Subtract(double)
Subtracts the specified value from this SimpleCurve.
public SimpleCurve Subtract(double subtract)
Parameters
subtractdoubleThe value to subtract.
Returns
- SimpleCurve
A new SimpleCurve with the result
Exceptions
- Exception
Wait untill SimpleCurve is finished before subtracting
Sum()
The sum of this SimpleCurve.
public double Sum()
Returns
- double
The sum of the values on the Y axis
Exceptions
- Exception
Wait untill SimpleCurve is finished before determining its sum
XAxisValue(int)
Gets the X-Axis value at a specified index.
public double XAxisValue(int index)
Parameters
indexintThe index.
Returns
YAxisValue(int)
Gets the X-Axis value at a specified index.
public double YAxisValue(int index)
Parameters
indexintThe index.
Returns
Events
CurveFinished
Occurs when the SimpleCurve is [finished] measuring.
public event EventHandler CurveFinished
Event Type
DetectedPeaks
Occurs when SimpleCurve [detected peaks].
public event EventHandler DetectedPeaks
Event Type
NewDataAdded
Occurs when [new data is added] to the SimpleCurve.
public event Curve.NewDataAddedEventHandler NewDataAdded
Event Type
- Curve.NewDataAddedEventHandler
PropertyChanged
Occurs when a [property changed].
public event PropertyChangedEventHandler PropertyChanged