Class DataArrayGridLess
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
Class for objects that store data in C^N which are arbitrarily distributed (i.e. not on a grid) in ℝ^M.
[Serializable]
public class DataArrayGridLess : DataArrayBase, ISerializable, IDeserializationCallback, IDocument, IEquatable<IObjectBase>, ICloneable
- Inheritance
-
ObjectBaseSerializableObjectBaseManualSerializationDocumentBaseDataArrayGridLess
- Implements
-
IEquatable<IObjectBase>
- Inherited Members
- Extension Methods
Constructors
DataArrayGridLess(List<VectorD>, (PhysicalProperty propX, PhysicalProperty propY), (string descriptionX, string descriptionY), ComplexField1DArray, PhysicalProperty[], string[])
Special constructor for 2D gridless data arrays.
public DataArrayGridLess(List<VectorD> coordinates, (PhysicalProperty propX, PhysicalProperty propY) propertiesOfCoordinates, (string descriptionX, string descriptionY) commentsOfCoordinates, ComplexField1DArray data, PhysicalProperty[] propertiesOfdata, string[] commentsOfdata)
Parameters
coordinatesList<VectorD>2D coordinates.
propertiesOfCoordinates(PhysicalProperty propX, PhysicalProperty propY)Physical property for the coordinates
commentsOfCoordinates(string descriptionX, string descriptionY)Descriptions for the coordinates
dataComplexField1DArrayArray of data in C^N
propertiesOfdataPhysicalProperty[]Physical properties of each data subset.
commentsOfdatastring[]Comments for each data subset.
DataArrayGridLess(ComplexField, MeasuredQuantity[], string[], ComplexField1DArray, MeasuredQuantity[], string[])
Constructor that uses arrays of coordinates and data values.
public DataArrayGridLess(ComplexField coordinates, MeasuredQuantity[] quantitiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, MeasuredQuantity[] quantitiesOfData, string[] commentsOfdata)
Parameters
coordinatesComplexFieldArray of coordinates in ℝ^M
quantitiesOfCoordinatesMeasuredQuantity[]Measured quantities for the coordinates
commentsOfCoordinatesstring[]Comment for the coordinates
dataComplexField1DArrayArray of data in C^N
quantitiesOfDataMeasuredQuantity[]Measured quantities of each data subset.
commentsOfdatastring[]Comments for each data subset.
DataArrayGridLess(ComplexField, MeasuredQuantity[], string[], ComplexField1DArray, MeasuredQuantity[], string[], ComplexField)
Constructor that uses arrays of coordinates and data values
public DataArrayGridLess(ComplexField coordinates, MeasuredQuantity[] propertiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, MeasuredQuantity[] quantitiesOfData, string[] commentsOfdata, ComplexField meshInformation)
Parameters
coordinatesComplexFieldArray of coordinates in ℝ²
propertiesOfCoordinatesMeasuredQuantity[]Measured quantities for the coordinates
commentsOfCoordinatesstring[]Comment for the coordinates
dataComplexField1DArrayArray of data in C^N
quantitiesOfDataMeasuredQuantity[]Measured quantities of each data subset.
commentsOfdatastring[]Comments for each data subset.
meshInformationComplexFieldthe mesh information used within the object
DataArrayGridLess(ComplexField, PhysicalProperty[], string[], ComplexField1DArray, PhysicalProperty[], string[])
Constructor that uses arrays of coordinates and data values
public DataArrayGridLess(ComplexField coordinates, PhysicalProperty[] propertiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, PhysicalProperty[] propertiesOfdata, string[] commentsOfdata)
Parameters
coordinatesComplexFieldArray of coordinates in ℝ^M
propertiesOfCoordinatesPhysicalProperty[]Physical property for the coordinates
commentsOfCoordinatesstring[]Comment for the coordinates
dataComplexField1DArrayArray of data in C^N
propertiesOfdataPhysicalProperty[]Physical properties of each data subset.
commentsOfdatastring[]Comments for each data subset.
DataArrayGridLess(ComplexField, PhysicalProperty[], string[], ComplexField1DArray, PhysicalProperty[], string[], ComplexField)
Constructor that uses arrays of coordinates and data values.
public DataArrayGridLess(ComplexField coordinates, PhysicalProperty[] propertiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, PhysicalProperty[] propertiesOfdata, string[] commentsOfdata, ComplexField meshInformation)
Parameters
coordinatesComplexFieldArray of coordinates in R^2.
propertiesOfCoordinatesPhysicalProperty[]Physical property for the coordinates.
commentsOfCoordinatesstring[]Comment for the coordinates.
dataComplexField1DArrayArray of data in C^N.
propertiesOfdataPhysicalProperty[]Physical properties of each data subset.
commentsOfdatastring[]Comments for each data subset.
meshInformationComplexFieldthe mesh information used within the object.
DataArrayGridLess(DataArrayGridLess)
Copy constructor.
public DataArrayGridLess(DataArrayGridLess dataArray)
Parameters
dataArrayDataArrayGridLessThe data array to copy.
Properties
CommentsOfCoordinates
Gets and sets the comment for each dimension in R^M.
public string[] CommentsOfCoordinates { get; set; }
Property Value
- string[]
CommentsOfDataEntries
Gets and sets the comment for each dimension in C^N.
public override string[] CommentsOfDataEntries { get; set; }
Property Value
- string[]
Coordinates
Get and set the coordinates for the data in R^M. The coordinates for each dimension k (zero based!) are stored in the columns of this ComplexField: [k, *].
public ComplexField Coordinates { get; set; }
Property Value
Data
Gets and sets the data in C^N. Each 1D complexField holds the data for one dimension.
public ComplexField1DArray Data { get; set; }
Property Value
DataArrayType
Gets the data array type of this data array.
public override DataArrayType DataArrayType { get; }
Property Value
- DataArrayType
DescriptionOfDataPointLabels
Gets and sets the caption of the index / label column.
public string DescriptionOfDataPointLabels { get; set; }
Property Value
DimensionalityOfCoordinates
Dimensionality M of the space of independent variables R^M.
public override int DimensionalityOfCoordinates { get; }
Property Value
DimensionalityOfData
Dimensionality N of the space of data values C^N.
public override int DimensionalityOfData { get; }
Property Value
IsComplex
public override bool IsComplex { get; }
Property Value
MeasuredQuantitiesOfCoordinates
Gets and sets the measured quantity for each dimension in R^M.
public MeasuredQuantity[] MeasuredQuantitiesOfCoordinates { get; set; }
Property Value
- MeasuredQuantity[]
MeshInformation
Sets and gets the mesh information of the DataArrayGridLess. If no mesh information is given null will be returned. The ComplexField holds the point indices for each triangle's vertices. So [0,i], [1,i], [2,i] hold the indices of the points which represent the vertices of the i'th triangle.
public ComplexField MeshInformation { get; set; }
Property Value
MeshInformationAvailable
Gets whether mesh information is available.
public bool MeshInformationAvailable { get; }
Property Value
NoOfDataPoints
Gets the number of data values stored.
public int NoOfDataPoints { get; }
Property Value
NoSmoothingInterpolationMethod
Gets a flag indicating whether or not none of the interpolation methods is smoothing (like nearest neighbor or constant interval) -> TRUE But if one of the methods does (like all other methods) -> the flag is set to FALSE
public override bool NoSmoothingInterpolationMethod { get; }
Property Value
Methods
Clone()
Deep copy
public override object Clone()
Returns
- object
Copy of data array
CoordinatesByDataPointIndex(int)
Gets the coordinates for a given data point index.
public PhysicalValue[] CoordinatesByDataPointIndex(int index)
Parameters
indexintIndex to get the located data for.
Returns
- PhysicalValue[]
Coordinate vector for the index.
CreateDataArrayGridless2D_fromComplexArray(Complex[,], bool, bool, MeasuredQuantity[], string[], MeasuredQuantity, string, MeasuredQuantity, string)
Method which converts complex data (double precision, usually read from a text file) into a gridless 2D data array.
public static DataArrayGridLess CreateDataArrayGridless2D_fromComplexArray(Complex[,] dataMatrix, bool createRealValuedResult, bool dataInColumns, MeasuredQuantity[] quantitiesOfData, string[] commentsOfData, MeasuredQuantity quantityOfXCoordinates, string commentOfXCoordinates, MeasuredQuantity quantityOfYCoordinates, string commentOfYCoordinates)
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 first and second column (first running index in dataMatrix) will be read as coordinates while the third (, fourth, fifth, ...) column will be interpreted as subset(s). 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.
quantityOfXCoordinatesMeasuredQuantityThe measured quantity to be set to the x-coordinates.
commentOfXCoordinatesstringThe comment to be set to the x-coordinates.
quantityOfYCoordinatesMeasuredQuantityThe measured quantity to be set to the y-coordinates.
commentOfYCoordinatesstringThe comment to be set to the y-coordinates.
Returns
- DataArrayGridLess
A gridless 2D data array, imported from text file.
Equals(object, EqualityIntent)
Determines whether the specified object is equal to this instance.
public override bool Equals(object otherObject, EqualityIntent equalityIntent)
Parameters
otherObjectobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or just physical equality.
Returns
Extract1DDataAlongLine(Line_forGUI_physicalUnits, double, double, out string, out bool)
Method which extracts a non-equidistant 1D data array along a given line.
public DataArray1D Extract1DDataAlongLine(Line_forGUI_physicalUnits extractionLine, double relativeEpsilon, double startCoordinate, out string errorMessage, out bool invertedOrder)
Parameters
extractionLineLine_forGUI_physicalUnitsLine to extract along.
relativeEpsilondoubleEpsilon for identifying coordinates as lying "on" the line.
startCoordinatedoubleThe coordinate the 1D data array shall start with.
errorMessagestringError message string.
invertedOrderboolIf
true, the order of the points in the data array is inverted to the order of the points on the line selection.
Returns
- DataArray1D
1D data along the given line.
FindGrid2D(out double[], out double[])
Finds a 2D grid for gridless 2D data. Two data points get into the same cell only if AreEqual(double, double) gives true for the coordinates of these data points.
public List<int>[,] FindGrid2D(out double[] xCellsCoords, out double[] yCellsCoords)
Parameters
xCellsCoordsdouble[]Sorted array of unique x-coordinates for all grid cells.
yCellsCoordsdouble[]Sorted array of unique y coordinates for all grid cells.
Returns
- List<int>[,]
A 2D array of int lists, where the not empty cells hold a list of indices. These indices refer to the indices the data got in this DataArrayGridLess object.
GetCoordinateRangeForDimension(int)
Support method to get the coordinate range for a specific dimension the user need to specify the dimension which shall be evaluated.
public virtual PhysicalValueRange GetCoordinateRangeForDimension(int dimension)
Parameters
dimensionintThe dimension to investigate. Important: It is zero-based.
Returns
- PhysicalValueRange
The min/max value 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.
GetMinMaxRangeForValues(int, FieldQuantity, bool, out double, out double)
Method to get the min max value range for the selected values within the data array.
public void GetMinMaxRangeForValues(int indexSubsetToCheck, FieldQuantity quantityToCheck, bool evaluateForTriangles, out double minValue, out double maxValue)
Parameters
indexSubsetToCheckintThe subset index which shall be evaluated.
quantityToCheckFieldQuantityThe field quantity to evaluate.
evaluateForTrianglesboolFlag whether to evaluate for triangles.
minValuedoubleOut parameter for minimum value.
maxValuedoubleOut parameter for maximum value.
GetNewDocumentWindow(Form, string)
Gets a new document window containing this document.
public override FormDocument GetNewDocumentWindow(Form formMain, string fileName)
Parameters
formMainFormReference to the main form (= MDI parent). Can be
nullif this form will not be shown (e.g. if it is generated just to get the view settings.fileNamestringFile name from which the document was opened for inserting into window caption. If this string is empty, the default document name is used.
Returns
- FormDocument
A VirtualLabAPI.UI.BasicUI.FormDocument containing this document.
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.
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 DataArrayGridLess Load(string fileName)
Parameters
fileNamestringName of the file.
Returns
- DataArrayGridLess
The specified document.
SetDataWithPropertiesAndCommentsAtOnce(ComplexField1DArray, MeasuredQuantity[], string[])
Sets the members Data, MeasuredQuantitiesOfCoordinates, and CommentsOfDataEntries at once to ensure consistency.
public void SetDataWithPropertiesAndCommentsAtOnce(ComplexField1DArray data, MeasuredQuantity[] quantities, string[] comments)
Parameters
dataComplexField1DArrayData to set.
quantitiesMeasuredQuantity[]MeasuredQuantitiesOfDataEntries to set.
commentsstring[]CommentsOfDataEntries to set.
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.