Class DataArray1D
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
Class for objects that store data in C^N which are equidistantly or non-equidistantly distributed in R^1.
[Serializable]
public class DataArray1D : DataArrayGridded, ISerializable, IDeserializationCallback, IDocument, IEquatable<IObjectBase>, ICloneable, IDisposable
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationDocumentBaseDataArray1D
- Implements
-
IEquatable<IObjectBase>
- Inherited Members
- Extension Methods
Constructors
DataArray1D(double[,], PhysicalProperty, string, PhysicalProperty, string, double, ExtrapolationInfo, InterpolationMethodForNonequidistantData)
Special constructor for non-equidistant data, that are stored in a double[,] array. Only one subset is used, i.e. N = 1.
public DataArray1D(double[,] coordinatesAndData, PhysicalProperty physicalPropertyOfData, string commentOfData, PhysicalProperty physicalPropertyOfCoordinates, string commentOfCoordinates, double coordinateOfLastIntervalsUpperLimit, ExtrapolationInfo extrapolation = null, InterpolationMethodForNonequidistantData interpolation = InterpolationMethodForNonequidistantData.ConstantInterval)
Parameters
coordinatesAndDatadouble[,]The coordinates and the real valued data. The method determines automatically whether the array is organized as [2,n] or [n,2], with n = number of data points. The coordinates have to be stored in [0,n] or [n,0] and the data have to be stored in [1,n] or [n,1].
physicalPropertyOfDataPhysicalPropertyPhysical properties of each data subset.
commentOfDatastringComments for each data subset.
physicalPropertyOfCoordinatesPhysicalPropertyPhysical property for the coordinates
commentOfCoordinatesstringComment for the coordinates
coordinateOfLastIntervalsUpperLimitdoubleCoordinate of the last interval's upper limit.
extrapolationExtrapolationInfoOptional information about how extrapolation of the data shall be done. By default border value continuation is done.
interpolationInterpolationMethodForNonequidistantDataThe interpolation method to be used.
DataArray1D(double[], PhysicalProperty, string, double, double, PhysicalProperty, string, ExtrapolationInfo, InterpolationMethod)
Special constructor for equidistant data, that are stored in a double[] array. Only one subset is used, i.e. N = 1.
public DataArray1D(double[] data, PhysicalProperty physicalPropertyOfData, string commentOfData, double samplingDistance, double coordinateOfFirstDataPoint, PhysicalProperty physicalPropertyOfCoordinates, string commentOfCoordinates, ExtrapolationInfo extrapolation = null, InterpolationMethod interpolation = InterpolationMethod.Nearest)
Parameters
datadouble[]The data in C^1. The double values will be filled into one real valued subset.
physicalPropertyOfDataPhysicalPropertyPhysical properties of each data subset.
commentOfDatastringComments for each data subset.
samplingDistancedoubleSampling distance for (and only for) equidistantly sampled data.
coordinateOfFirstDataPointdoubleCoordinate of the first data point Data[0] for (and only for) equidistantly sampled data.
physicalPropertyOfCoordinatesPhysicalPropertyPhysical property for the coordinates
commentOfCoordinatesstringComment for the coordinates
extrapolationExtrapolationInfoOptional information about how extrapolation of the data shall be done. By default border value continuation is done.
interpolationInterpolationMethodThe interpolation method to be used.
DataArray1D(ComplexField1DArray, MeasuredQuantity[], string[], double, double, MeasuredQuantity, string, ExtrapolationInfo, InterpolationMethod)
Constructor for equidistant data.
public DataArray1D(ComplexField1DArray data, MeasuredQuantity[] measuredQuantitiesOfData, string[] commentsOfData, double samplingDistance, double coordinateOfFirstDataPoint, MeasuredQuantity measuredQuantityOfCoordinates, string commentOfCoordinates, ExtrapolationInfo extrapolation = null, InterpolationMethod interpolation = InterpolationMethod.Nearest)
Parameters
dataComplexField1DArrayThe data in C^N. Each single 1D ComplexField in this array holds one data subset, i.e. the complete set of data for one data dimension \(i\) (\(1 \leq i \leq N\)).
measuredQuantitiesOfDataMeasuredQuantity[]Measured quantities of each data subset.
commentsOfDatastring[]Comments for each data subset.
samplingDistancedoubleSampling distance for (and only for) equidistantly sampled data.
coordinateOfFirstDataPointdoubleCoordinate of the first data point Data[0] for (and only for) equidistantly sampled data.
measuredQuantityOfCoordinatesMeasuredQuantityMeasured quantity for the coordinates
commentOfCoordinatesstringComment for the coordinates
extrapolationExtrapolationInfoOptional information about how extrapolation of the data shall be done. By default border value continuation is done.
interpolationInterpolationMethodThe interpolation method to be used.
Exceptions
- ArgumentException
Empty data. or Sampling Distance has to be greater than zero.
DataArray1D(ComplexField1DArray, MeasuredQuantity[], string[], CFieldDerivative1DReal, MeasuredQuantity, string, double, ExtrapolationInfo, InterpolationMethodForNonequidistantData)
Constructor for non-equidistant data.
public DataArray1D(ComplexField1DArray data, MeasuredQuantity[] measuredQuantitiesOfData, string[] commentsOfData, CFieldDerivative1DReal coordinates, MeasuredQuantity measuredQuantityOfCoordinates, string commentOfCoordinates, double coordinateOfLastIntervalsUpperLimit, ExtrapolationInfo extrapolation = null, InterpolationMethodForNonequidistantData interpolation = InterpolationMethodForNonequidistantData.ConstantInterval)
Parameters
dataComplexField1DArrayThe data in C^N. Each single 1D ComplexField in this array holds one data subset, i.e. the complete set of data for one data dimension \(i\) (\(1 \leq i \leq N\)).
measuredQuantitiesOfDataMeasuredQuantity[]Measured quantities of each data subset.
commentsOfDatastring[]Comments for each data subset.
coordinatesCFieldDerivative1DRealNon-equidistant coordinates for the data in R^1.
measuredQuantityOfCoordinatesMeasuredQuantityMeasured quantity for the coordinates
commentOfCoordinatesstringComment for the coordinates
coordinateOfLastIntervalsUpperLimitdoubleCoordinate of the last interval's upper limit.
extrapolationExtrapolationInfoOptional information about how extrapolation of the data shall be done. By default border value continuation is done.
interpolationInterpolationMethodForNonequidistantDataThe interpolation method to be used.
DataArray1D(ComplexField1DArray, PhysicalProperty[], string[], double, double, PhysicalProperty, string, ExtrapolationInfo, InterpolationMethod)
Constructor for equidistant data
public DataArray1D(ComplexField1DArray data, PhysicalProperty[] physicalPropertiesOfData, string[] commentsOfData, double samplingDistance, double coordinateOfFirstDataPoint, PhysicalProperty physicalPropertyOfCoordinates, string commentOfCoordinates, ExtrapolationInfo extrapolation = null, InterpolationMethod interpolation = InterpolationMethod.Nearest)
Parameters
dataComplexField1DArrayThe data in C^N. Each single 1D ComplexField in this array holds one data subset, i.e. the complete set of data for one data dimension \(i\) (\(1 \leq i \leq N\)).
physicalPropertiesOfDataPhysicalProperty[]Physical properties of each data subset.
commentsOfDatastring[]Comments for each data subset.
samplingDistancedoubleSampling distance for (and only for) equidistantly sampled data.
coordinateOfFirstDataPointdoubleCoordinate of the first data point Data[0] for (and only for) equidistantly sampled data.
physicalPropertyOfCoordinatesPhysicalPropertyPhysical property for the coordinates
commentOfCoordinatesstringComment for the coordinates
extrapolationExtrapolationInfoOptional information about how extrapolation of the data shall be done. By default border value continuation is done.
interpolationInterpolationMethodThe interpolation method to be used.
Exceptions
- ArgumentException
Empty data. or Sampling Distance has to be greater than zero.
DataArray1D(ComplexField1DArray, PhysicalProperty[], string[], CFieldDerivative1DReal, PhysicalProperty, string, double, ExtrapolationInfo, InterpolationMethodForNonequidistantData)
Constructor for non-equidistant data.
public DataArray1D(ComplexField1DArray data, PhysicalProperty[] physicalPropertiesOfData, string[] commentsOfData, CFieldDerivative1DReal coordinates, PhysicalProperty physicalPropertyOfCoordinates, string commentOfCoordinates, double coordinateOfLastIntervalsUpperLimit, ExtrapolationInfo extrapolation = null, InterpolationMethodForNonequidistantData interpolation = InterpolationMethodForNonequidistantData.ConstantInterval)
Parameters
dataComplexField1DArrayThe data in C^N. Each single 1D ComplexField in this array holds one data subset, i.e. the complete set of data for one data dimension \(i\) (\(1 \leq i \leq N\)).
physicalPropertiesOfDataPhysicalProperty[]Physical properties of each data subset.
commentsOfDatastring[]Comments for each data subset.
coordinatesCFieldDerivative1DRealNon-equidistant coordinates for the data in R^1.
physicalPropertyOfCoordinatesPhysicalPropertyPhysical property for the coordinates
commentOfCoordinatesstringComment for the coordinates
coordinateOfLastIntervalsUpperLimitdoubleCoordinate of the last interval's upper limit.
extrapolationExtrapolationInfoOptional information about how extrapolation of the data shall be done. By default border value continuation is done.
interpolationInterpolationMethodForNonequidistantDataThe interpolation method to be used.
DataArray1D(DataArray1D)
Copy constructor.
public DataArray1D(DataArray1D dataArray)
Parameters
dataArrayDataArray1DData array to copy
Fields
_measuredQuantityOfCoordinates
protected MeasuredQuantity _measuredQuantityOfCoordinates
Field Value
- MeasuredQuantity
Properties
BiggestCoordinateStep
Gets the biggest occurring distance between two neighbored coordinates. (So in the equidistant case, this is identical to SamplingDistance.)
public double BiggestCoordinateStep { get; }
Property Value
CommentOfCoordinates
Gets and sets the comment for the coordinates.
public virtual string CommentOfCoordinates { get; set; }
Property Value
CommentsOfDataEntries
Gets and sets the comments for each data subset.
public override string[] CommentsOfDataEntries { get; set; }
Property Value
- string[]
CoordinateOfFirstDataPoint
Gets and sets the coordinate of the first data point.
public virtual double CoordinateOfFirstDataPoint { get; set; }
Property Value
CoordinateOfLastDataPoint
Gets the coordinate of the last data point.
public double CoordinateOfLastDataPoint { get; }
Property Value
CoordinateOfLastIntervalsUpperLimit
Gets and sets the coordinate of the last interval's upper limit. This is needed if non equidistantly sampled data shall be interpolated with the method 'ConstantInterval'. For this method the data are assumed to be constant in each interval which is given by [coordinate(i), coordinate(i+1)[, where i is the data point index. So the width of the last interval has to be defined separately by [coordinate(NoOfDataPoints-1), CoordinateOfLastIntervalsUpperLimit[.
public double CoordinateOfLastIntervalsUpperLimit { get; set; }
Property Value
Data
Gets and sets the data in C^N. Each single 1D ComplexField in this array holds one data subset, i.e. the complete set of data for one data dimension \(i\) (\(1 \leq i \leq N\)).
public ComplexField1DArray Data { get; set; }
Property Value
DataArrayType
Gets the data array type of the current data array.
public override DataArrayType DataArrayType { get; }
Property Value
- DataArrayType
DimensionalityOfCoordinates
Dimensionality M of the space of independent variables R^M, which is always 1 for DataArray1D.
public override int DimensionalityOfCoordinates { get; }
Property Value
DimensionalityOfData
Dimensionality of the space of data values C^N, i.e. the number of subsets N.
public override int DimensionalityOfData { get; }
Property Value
ExtrapolationHandling
The extrapolation handling.
public override ExtrapolationInfo ExtrapolationHandling { get; set; }
Property Value
InterpolationMethodForEquidistantSampling
Gets and sets the method used for interpolation in case of equidistant sampling.
public virtual InterpolationMethod InterpolationMethodForEquidistantSampling { get; set; }
Property Value
InterpolationMethodForNonequidistantSampling
Gets and sets the method used for interpolation in case of non-equidistant sampling. For the method 'ConstantInterval' the data are assumed to be constant in each interval which is given by [coordinate(i), coordinate(i+1)[, where i is the data point index. So the width of the last interval has to be defined separately by [coordinate(NoOfDataPoints-1), CoordinateOfLastIntervalsUpperLimit[.
public InterpolationMethodForNonequidistantData InterpolationMethodForNonequidistantSampling { get; set; }
Property Value
IsComplex
Are the values defined in C^N (true) or in the subset of real numbers R^N (false)? Returns true if any of the data entries is complex.
public override bool IsComplex { get; }
Property Value
IsEquidistant
Gets and sets whether the data are sampled equidistantly.
public virtual bool IsEquidistant { get; set; }
Property Value
MeasuredQuantityOfCoordinates
Gets and sets the measured quantity of the coordinates.
public virtual MeasuredQuantity MeasuredQuantityOfCoordinates { get; set; }
Property Value
- MeasuredQuantity
NoOfDataPoints
Gets the number of data values stored.
public int NoOfDataPoints { get; }
Property Value
NoSmoothingInterpolationMethod
Gets a flag indicating whether or not the interpolation method isn't smoothing (like nearest neighbor or constant interval; true) or if it does (like all other methods; false).
public override bool NoSmoothingInterpolationMethod { get; }
Property Value
NonequidistantCoordinates
Get and set the coordinates for the data in R^1. IMPORTANT: This property applies for non equidistant data only! If you need to get the coordinate for one index for equidistant as well as for non equidistant data, use the method CoordinateOfDataPointIndex(long index) instead! For setting pay attention to the following restrictions: value must not be complex and value.SamplingPointsOneD has to be equal to NoOfDataPoints.
public CFieldDerivative1DReal NonequidistantCoordinates { get; set; }
Property Value
PhysicalPropertyOfCoordinates
Gets the physical property for the coordinates.
public PhysicalProperty PhysicalPropertyOfCoordinates { get; set; }
Property Value
SamplingDistance
Gets and sets the sampling distance for (and only for) equidistantly sampled data.
public virtual double SamplingDistance { get; set; }
Property Value
SmallestCoordinateStep
Gets the smallest occurring distance between two neighbored coordinates. (So in the equidistant case, this is identical to SamplingDistance.)
public double SmallestCoordinateStep { get; }
Property Value
SuffixForPhysicalMeaning
Property which gives the suffix which is used in FormPhysicalObjectBase.SetTypeOfPhysicalObject.
public override string SuffixForPhysicalMeaning { get; }
Property Value
Methods
AppendDataArray1D(DataArray1D, bool)
Appends a given data array to this.
public void AppendDataArray1D(DataArray1D arrayToAppend, bool coordinateOfLastIntervalsUpperLimitDeterminesPosition)
Parameters
arrayToAppendDataArray1DArray to append to this one.
coordinateOfLastIntervalsUpperLimitDeterminesPositionboolShall this.CoordinateOfLastIntervalsUpperLimit determine the position of the appended data array?
Clone()
Deep copy
public override object Clone()
Returns
- object
Copy of data array.
CoordinateOfDataPointIndex(long)
Gives the coordinate of a certain data point as double.
public double CoordinateOfDataPointIndex(long index)
Parameters
indexlongIndex of the data point to get the coordinate for.
Returns
- double
Coordinate of the data point as double
CoordinateOfDataPointIndex_asPValue(long)
Gives the coordinate of a certain data point as PhysicalValue.
public PhysicalValue CoordinateOfDataPointIndex_asPValue(long index)
Parameters
indexlongIndex of the data point to get the coordinate for.
Returns
- PhysicalValue
Coordinate of the data point as PhysicalValue
CreateDataArray1D_fromComplexArray(Complex[,], bool, bool, MeasuredQuantity[], string[], MeasuredQuantity, string, ExtrapolationInfo, ref (double samplingDistance, double startCoordinate, InterpolationMethod interpolation)?, (double coordOfLastIntUpperLimit, InterpolationMethodForNonequidistantData nonEquidistantInterpolation)?)
Method which converts complex data (double precision, usually read from a text file) into a 1D data array.
public static DataArray1D CreateDataArray1D_fromComplexArray(Complex[,] dataMatrix, bool createRealValuedResult, bool dataInColumns, MeasuredQuantity[] quantitiesOfData, string[] commentsOfData, MeasuredQuantity quantityOfCoordinates, string commentOfCoordinates, ExtrapolationInfo extrapolation, ref (double samplingDistance, double startCoordinate, InterpolationMethod interpolation)? sampling_equidist, (double coordOfLastIntUpperLimit, InterpolationMethodForNonequidistantData nonEquidistantInterpolation)? sampling_nonEquidist)
Parameters
dataMatrixComplex[,]An array of data which holds the raw values, usually read from a text file.
createRealValuedResultboolIf
true, the result will be real-valued, no matter if there are imaginary parts given or not.dataInColumnsboolIf
true, the columns (first running index in dataMatrix) will be interpreted as subsets (and coordinate column if no samplingDistance given). Otherwise, the rows (second running index in dataMatrix) will be interpreted the same way.quantitiesOfDataMeasuredQuantity[]The measured quantities to be set to the subsets which are read from the file.
commentsOfDatastring[]The comments to be set to the subsets which are read from the file.
quantityOfCoordinatesMeasuredQuantityThe measured quantity to be set to the coordinates.
commentOfCoordinatesstringThe comment to be set to the coordinates.
extrapolationExtrapolationInfoThe extrapolation info.
sampling_equidist(double samplingDistance, double startCoordinate, InterpolationMethod interpolation)?If not null, an equidistantly sampled data array will be created with the given sampling distance and start coordinate. If
null, a non-equidistantly sampled data array will be created. The coordinates will be read from first row or column (depending on dataInColumns parameter), then.sampling_nonEquidist(double coordOfLastIntUpperLimit, InterpolationMethodForNonequidistantData nonEquidistantInterpolation)?In case no sampling_equidist parameter is given, this parameter is needed for specific settings of a non-equidistant data array.
Returns
- DataArray1D
A 1D data array, created from an array of double values.
EmbedExtract(int)
Method to embed or extract a given data point range from this.
public DataArray1D EmbedExtract(int numberOfDataPoints)
Parameters
numberOfDataPointsintThe number of the data points to be used for the embed/extract operation. If it is greater than NoOfDataPoints, the data array will be embedded, otherwise the given number of data points will be extracted.
Returns
- DataArray1D
The modified Data Array
Exceptions
- ArgumentException
Embed Extract is only available for equidistant data arrays. or The extraction size has to be larger than zero.
EmbedExtract(int, int)
Method to embed or extract a given data point range from this.
public DataArray1D EmbedExtract(int startPoint, int extractSize)
Parameters
startPointintData point index to start the extraction with (zero based!).
extractSizeintNumber of data point to be extracted.
Returns
- DataArray1D
A data array with the extracted data.
Exceptions
- Exception
Embed Extract is only available for equidistant data arrays.
- ArgumentException
Embed Extract is only available for equidistant data arrays. or The extraction size has to be larger than zero.
Equals(object?, EqualityIntent)
Checks whether two DataArray1D objects are equal.
public override bool Equals(object? obj, EqualityIntent equalityIntent)
Parameters
objobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
EquidistantToNonEquidistant(bool)
If this data array is equidistant, this conversion method makes it non-equidistant. This is done by calculating the member NonequidistantCoordinates from CoordinateOfFirstDataPoint, SamplingDistance and the respective index.
public virtual void EquidistantToNonEquidistant(bool forNN_convertCenterCoordinateInsteadOfIntervalBorder)
Parameters
forNN_convertCenterCoordinateInsteadOfIntervalBorderboolIn case an equidistant data array is given, it is to be converted into a non-equidistant one. This will take the interpolation method into account, which means that for Nearest-Neighbor interpolation the interval boundaries are converted instead of the original coordinates. This flag will prevent this if set to
trueand will ensure that the original coordinates are converted. This is usually needed for subsequent coordinate transformations only.
GetArraySize()
Method which calculates the array size. Definition: "Coordinate Extent" is the range within which interpolation is possible. It may be different from "Array Size" which is the distance between first and last data point.
public double GetArraySize()
Returns
- double
The array size, i.e. the distance between last and first coordinate.
GetCoordinateExtent()
Method which calculates the coordinate extent. Definition: "Coordinate Extent" is the range within which interpolation is possible. It may be different from "Array Size" which is the distance between first and last data point.
public double GetCoordinateExtent()
Returns
- double
The Coordinate Extent which is the range within which interpolation is possible.
GetCoordinateRange(bool)
Gets the whole range of coordinates, either coordinate extent or array size. Definition: "Coordinate Extent" is the range within which interpolation is possible. It is different from "Array Size" which is the range between first and last data point.
public PhysicalValueRange GetCoordinateRange(bool extentInsteadOfArraySize)
Parameters
extentInsteadOfArraySizeboolIf set, the method returns the coordinate extent instead of the array size.
Returns
- PhysicalValueRange
The coordinate range.
GetDataForSubset(int)
Gets the data for the given subset index.
public override ComplexField GetDataForSubset(int subsetIndex)
Parameters
subsetIndexintThe index of the subset.
Returns
- ComplexField
The ComplexField with the data for the given subset.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
HeaderInformation(int, TextExportImportSettings, FieldQuantity?)
Public method to get the export header (data meaning and sampling parameters) for a specific data array.
public override string HeaderInformation(int subSetID, TextExportImportSettings exportSettings, FieldQuantity? quantityForInformation = null)
Parameters
subSetIDintThe ID of the subset for which the header information shall be extracted.
exportSettingsTextExportImportSettingsThe text export settings (header indicator, decimal separator and so on).
quantityForInformationFieldQuantity?Optional FieldQuantity for which the header information shall be generated.
Returns
- string
The export header string for the subset within the DataArray which has the subSetID.
IndexOfDataPointAtCoordinate(double, bool, out bool)
Method to get the index of that data point which corresponds to a given coordinate.
public long IndexOfDataPointAtCoordinate(double coord, bool enforceSteppedInterpolation, out bool coordinatesOutsideGivenIndexRange)
Parameters
coorddoublecoordinate to get the corresponding data point's index for
enforceSteppedInterpolationboolIf
true, a stepped interpolation (i.e. Nearest Neighbor or Constant Interval) will be used, no matter what the DataArrays own interpolation method is. Important: This flag does not affect the returned index but only the out flag which indicates whether or not the given coordinate is outside the valid coordinate range!coordinatesOutsideGivenIndexRangeboolflag indicating whether the given coordinate lies outside the valid range (defined by the number of data points)
Returns
- long
the index of that data point which corresponds to the given coordinate
IndexOfDataPointAtCoordinate(double, long, long, bool, out bool)
Method to get the index of that data point which corresponds to a given coordinate.
public long IndexOfDataPointAtCoordinate(double coord, long startIndex, long endIndex, bool enforceSteppedInterpolation, out bool coordinatesOutsideGivenIndexRange)
Parameters
coorddoublecoordinate to get the corresponding data point's index for
startIndexlongindex to begin the search at
endIndexlongindex to stop the search at
enforceSteppedInterpolationboolIf
true, a stepped interpolation (i.e. Nearest Neighbor or Constant Interval) will be used, no matter what the DataArrays own interpolation method is. Important: This flag does not affect the returned index but only the out flag which indicates whether or not the given coordinate is outside the valid coordinate range!coordinatesOutsideGivenIndexRangeboolflag indicating whether the given coordinate lies outside the valid range (defined by startIndex and endIndex)
Returns
- long
the index of that data point which corresponds to the given coordinate
Load(string)
Loads the specified file name. Works independently from whether the document has been saved without view settings (as prior to VirtualLab 6.0) or with view settings.
public static DataArray1D Load(string fileName)
Parameters
fileNamestringName of the file.
Returns
- DataArray1D
The specified document.
MultiplyFactorOnData(double)
Public method to multiply a factor onto all data subsets.
public void MultiplyFactorOnData(double factor)
Parameters
factordoubleThe factor which shall be used for multiplication
PointInterpolation(double, bool, long, long, out long, out bool)
Gives the interpolated complex value for a given coordinate.
public virtual Complex[] PointInterpolation(double coord, bool enforceSteppedInterpolation, long startIndex, long endIndex, out long correspondingDataPointIndex, out bool coordinateOutsideCoordinateRange)
Parameters
coorddoublecoordinate to interpolate the value for
enforceSteppedInterpolationboolIf
true, a stepped interpolation (i.e. Nearest Neighbor or Constant Interval) will be used, no matter what the DataArrays own interpolation method is.startIndexlongStart index for search
endIndexlongEnd index for search
correspondingDataPointIndexlongGives the index of the corresponding data point.
coordinateOutsideCoordinateRangeboolFlag indicating whether or not the given coordinate lies outside the coordinate range of this data array.
Returns
- Complex[]
interpolated complex value for the given coordinate
PointInterpolation(double, bool, out long, out bool)
Gives the interpolated complex value for a given coordinate.
public virtual Complex[] PointInterpolation(double coord, bool enforceSteppedInterpolation, out long correspondingDataPointIndex, out bool coordinateOutsideCoordinateRange)
Parameters
coorddoublecoordinate to interpolate the value for
enforceSteppedInterpolationboolIf
true, a stepped interpolation (i.e. Nearest Neighbor or Constant Interval) will be used, no matter what the DataArrays own interpolation method is.correspondingDataPointIndexlongGives the index of the corresponding data point.
coordinateOutsideCoordinateRangeboolFlag indicating whether or not the given coordinate lies outside the coordinate range of this data array.
Returns
- Complex[]
interpolated complex value for the given coordinate
SetDataWithPropertiesAndCommentsAtOnce(ComplexField1DArray, MeasuredQuantity[], string[], string[])
Sets the members Data, PhysicalPropertiesOfDataEntries and CommentsOfDataEntries at once to ensure consistency.
public void SetDataWithPropertiesAndCommentsAtOnce(ComplexField1DArray data, MeasuredQuantity[] properties, string[] comments, string[] dataPointLabels)
Parameters
dataComplexField1DArrayData to set.
propertiesMeasuredQuantity[]PhysicalPropertiesOfDataEntries to set.
commentsstring[]CommentsOfDataEntries to set.
dataPointLabelsstring[]Data point labels. May be null.
SetDataWithPropertiesAndCommentsAtOnce(ComplexField[], MeasuredQuantity[], string[])
Sets the members Data, MeasuredQuantitiesOfDataEntries and CommentsOfDataEntries at once to ensure consistency.
public override void SetDataWithPropertiesAndCommentsAtOnce(ComplexField[] data, MeasuredQuantity[] measuredQuantitiesOfDataEntries, string[] commentsOfDataEntries)
Parameters
dataComplexField[]Data to set.
measuredQuantitiesOfDataEntriesMeasuredQuantity[]MeasuredQuantitiesOfDataEntries to set.
commentsOfDataEntriesstring[]CommentsOfDataEntries to set.
ShiftCoordinates(double)
Public method to perform a shift on the coordinates of the data array.
public virtual void ShiftCoordinates(double coordinateShift)
Parameters
coordinateShiftdoubleThe value of the shift to be performed.
Operators
operator +(DataArray1D, DataArray1D)
Implements the operator + for addition of two one-dimensional data arrays.
public static DataArray1D operator +(DataArray1D dataArray1, DataArray1D dataArray2)
Parameters
dataArray1DataArray1DThe first summand.
dataArray2DataArray1DThe second summand.
Returns
- DataArray1D
The result of the addition.
operator /(DataArray1D, DataArray1D)
Implements the operator / for division of two one-dimensional data arrays.
public static DataArray1D operator /(DataArray1D dataArray1, DataArray1D dataArray2)
Parameters
dataArray1DataArray1DThe dividend.
dataArray2DataArray1DThe divisor.
Returns
- DataArray1D
The result of the division.
operator ==(DataArray1D, DataArray1D)
Checks whether two DataArray1D objects are equal.
public static bool operator ==(DataArray1D da1, DataArray1D da2)
Parameters
da1DataArray1DThe first data array.
da2DataArray1DThe second data array.
Returns
- bool
Trueif the two data arrays represent exactly the same data.
operator !=(DataArray1D, DataArray1D)
Checks whether two DataArray1D objects are unequal.
public static bool operator !=(DataArray1D da1, DataArray1D da2)
Parameters
da1DataArray1DThe first data array.
da2DataArray1DThe second data array.
Returns
- bool
Trueif the two data arrays differ in at least one property or variable.
operator *(DataArray1D, DataArray1D)
Implements the operator * for multiplication of two one-dimensional data arrays.
public static DataArray1D operator *(DataArray1D dataArray1, DataArray1D dataArray2)
Parameters
dataArray1DataArray1DThe first factor.
dataArray2DataArray1DThe second factor.
Returns
- DataArray1D
The result of the multiplication.
operator -(DataArray1D, DataArray1D)
Implements the operator - for subtraction of two one-dimensional data arrays.
public static DataArray1D operator -(DataArray1D dataArray1, DataArray1D dataArray2)
Parameters
dataArray1DataArray1DThe minuend.
dataArray2DataArray1DThe subtrahend.
Returns
- DataArray1D
The result of the subtraction.