Table of Contents

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

curve Curve

The Curve.

simpleMeasurement SimpleMeasurement

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

true if 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

add SimpleCurve

The 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

add SimpleCurve

The SimpleCurve to add.

from int

The 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

add SimpleCurve

The SimpleCurve to add.

from int

The index to start adding from.

count int

The 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

add double

The 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

minLevelWidth double

Minimum width of the level.

minLevelHeight double

Minimum height of the level.

clearLevels bool

if set to true [clear existing levels].

levelDetectProgress LevelDetectProgress

Returns

Task

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

minPeakWidth double

Minimum width of the peak.

minPeakHeight double

Minimum height of the peak.

clearPeaks bool

if set to true [clear existing peaks].

useHiddenPeakDetectionAlgorithm bool

if set to true [use hidden peak detection algorithm].

mergeOverlappingPeaks bool

if 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

minPeakWidth double

Minimum width of the peak.

minPeakHeight double

Minimum height of the peak.

clearPeaks bool

if set to true [clear existing peaks].

peakType PeakTypes

Type of peak.

peakDetectProgress PeakDetectProgress

Returns

Task

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

power double

The 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

circuitModel CircuitModel

The circuit model.

fitOptions FitOptionsCircuit

The fit options.

fitProgress FitProgress

The 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

cdc string

The circuit descriptor code (CDC) defining the circuit.

initialParameters double[]

The initial parameters.

fitOptions FitOptionsCircuit

The fit options.

fitProgress FitProgress

The 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

from int

The 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

from int

The index to start integrating from.

count int

The number of datapoints in the range.

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

windowSize int

Number of data points in the averaging window.

maxSweeps int

The maximum sweeps.

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

multiply SimpleCurve

The 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

multiply SimpleCurve

The multiply.

from int

The 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

multiply SimpleCurve

The multiply.

from int

The index to start multiplying by.

count int

The 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

multiply double

The 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

smoothLevel SmoothLevel

The 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

windowSize int

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

subtract SimpleCurve

The 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

subtract SimpleCurve

The SimpleCurve to subtract.

from int

The 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

subtract SimpleCurve

The SimpleCurve to subtract.

from int

The index to start subtracting from.

count int

The 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

subtract double

The 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

index int

The index.

Returns

double

YAxisValue(int)

Gets the X-Axis value at a specified index.

public double YAxisValue(int index)

Parameters

index int

The index.

Returns

double

Events

CurveFinished

Occurs when the SimpleCurve is [finished] measuring.

public event EventHandler CurveFinished

Event Type

EventHandler

DetectedPeaks

Occurs when SimpleCurve [detected peaks].

public event EventHandler DetectedPeaks

Event Type

EventHandler

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

Event Type

PropertyChangedEventHandler