Programming Reference for VirtualLab Fusion  2026.1
Loading...
Searching...
No Matches
DataArrayManipulations Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Support class containing the manipulations for numerical data arrays. More...

Static Public Member Functions

static DataArrayBase AddConstant_Complex (DataArrayBase dataArray, Complex constant, int[] subsetIndices)
 Add a constant to certain subsets. The operation will be a complex addition.
 
static DataArrayBase AddConstant_Separately (DataArrayBase dataArray, double realPartOrAmplitude, double imaginaryPartOrPhase, bool amplitudePhaseRepresentation, int[] subsetIndices)
 Add a constant to certain subsets. The operation will consist of two independent real valued operations for the complex parts respectively.
 
static DataArrayBase AppendSubsetsFromAnotherDataArray (DataArrayBase targetDataArrayBase, DataArrayBase sourceDataArrayBase, int[] indicesToAppend, out string warnings)
 Method that appends the subsets of one data array to another. The data arrays have to have the same number of sampling points (for 2D: in each direction).
 
static DataArray1D AppendSubsetsFromAnotherDataArrayWithInterpolationToTargetCoordinates (DataArray1D targetDataArray1D, DataArray1D sourceDataArray1D, int[] indicesToAppend, out string warnings)
 Method that appends subsets from a source data array to another one (the target data array). The source will be interpolated to the coordinates of the target.
 
static DataArray2D AppendSubsetsFromAnotherDataArrayWithInterpolationToTargetCoordinates (DataArray2D targetDataArray2D, DataArray2D sourceDataArray2D, int[] indicesToAppend, out string warnings)
 Method that appends subsets from a source data array to another one (the target data array). The source will be interpolated to the coordinates of the target.
 
static DataArray1D AppendSubsetsFromAnotherDataArrayWithMerging (DataArray1D targetDataArray1D, DataArray1D sourceDataArray1D, int[] indicesToAppend, out string warnings)
 Method that appends subsets from a source data array to another one (the target data array). The result will have merged coordinates.
 
static DataArray2D AppendSubsetsFromAnotherDataArrayWithMerging (DataArray2D targetDataArray2D, DataArray2D sourceDataArray2D, int[] indicesToAppend, out string warnings)
 Method that appends subsets from a source data array to another one (the target data array). The result will have merged coordinates.
 
static DataArrayBase ArrayArrayOperation (ArrayArrayOperationType operationType, DataArrayBase da1, DataArrayBase da2, List< Tuple< int, int > > indicesOfOperandSubsets, out string warnings, bool addHintForCommonNonequidistantCoordinatesOfCFSs=false)
 Array-array-operation of two data arrays. Does not work for convolution! For convolution of two data arrays please use DataArrayManipulations.Convolution(...).
 
static double CalculateIntegralFor1DDataByTrapezoidRule (DataArray1D daToIntegrate, int subsetIndex=0)
 support method to calculate the integral under a 1D data array by trapezoid rule
 
static ChromaticFieldsSetBase CalculateSumOfDataArraysPerWavelength (List< DataArrayBase > inputDataArrays, List< double > listAssociatedWavelengths, string prefixForCommentsOfSubsets, InterpolationMethod interpolationMethodToUseForAllDataArrays, double oversamplingFactor)
 public support method to calculate the sum of all data array per wavelength (the wavelength information is provided by the input variable "listAssociatedWavelengths")
 
static DataArray1D CenterDataArray_CoordinateBased (DataArray1D dataArray)
 Method for centering a 1D data array.
 
static DataArray2D CenterDataArray_CoordinateBased (DataArray2D dataArray)
 Method for centering a 2D data array.
 
static void ChangeInterpolationMethodEquidistant (ref DataArrayBase dataArrayBase, InterpolationMethod interpolationMethod)
 Method to change the interpolation method of a data array.
 
static bool CheckForIdenticalCoordinateParametersOfTwoDataArrays (DataArrayBase da1, DataArrayBase da2, bool checkNonSamplingParameters, out List< string > warnings, out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences, bool checkWithTolerance)
 Method that compares the coordinate and interpolation parameters of two given data arrays.
 
static bool CheckForIdenticalCoordinateParametersOfTwoDataArrays (DataArrayBase da1, DataArrayBase da2, bool checkNonSamplingParameters, out string warnings, out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences, bool checkWithTolerance=true)
 Method that compares the coordinate and interpolation parameters of two given data arrays.
 
static DataArrayBase ClipValues (DataArrayBase dataArray, double amplitudeThreshold, int[] subsetIndices)
 Clips the amplitude (or real part for real valued data) at a given threshold.
 
static DataArrayBase ConjugatePhase (DataArrayBase dataArray, int[] subsetIndices)
 Conjugates the phase.
 
static DataArray1D Convolution (DataArray1D da1, DataArray1D da2, List< Tuple< int, int > > indicesOfOperandSubsets, bool addHintForCommonNonequidistantCoordinatesOfCFSs, out string warnings)
 Does a convolution of two data arrays.
 
static DataArray2D Convolution (DataArray2D da1, DataArray2D da2, List< Tuple< int, int > > indicesOfOperandSubsets, bool addHintForCommonNonequidistantCoordinatesOfCFSs, out string warnings)
 Does a convolution of two data arrays.
 
static T CreatePointCloudAddOn< T > (T dataArray2receivePointCloud, DataArrayGridLess dataArrayGridLessWithPointCloud, string nameOfAddon, int[] selectedSubsetIndices, out int noOfOutlyingPoints)
 Creates a point cloud add-on from a DataArrayGridLess and adds it to a given gridless 2D data array.
 
static T CreatePointCloudAddOn< T > (T dataArray2receivePointCloud, Propagation.RayDistribution rayDistribution, string nameOfDistribution, int[] selectedSubsetIndices, out int noOfOutlyingPoints)
 Creates a point cloud add-on from a RayDistribution and adds it to a given gridless 2D data array.
 
static DataArray1D CreateRegionAddOn (DataArray1D dataArray2receiveRegion, Numerics.Region1D.IntervalRegion region, int[] selectedSubsetIndices, out bool notCompletelyInDomain)
 Creates a region add-on from an interval region and adds it to a given 1D data array.
 
static DataArray2D CreateRegionAddOn (DataArray2D dataArray2receiveRegion, Numerics.Region2D.ElementaryRegion2D region, int[] selectedSubsetIndices, out bool notCompletelyInDomain)
 Creates a region add-on from an elementary region and adds it to a given gridded 2D data array.
 
static DataArrayGridLess CreateRegionAddOn (DataArrayGridLess dataArray2receiveRegion, Numerics.Region2D.ElementaryRegion2D region, int[] selectedSubsetIndices, out bool notCompletelyInDomain)
 Creates a region add-on from an elementary region and adds it to a given gridless 2D data array.
 
static DataArrayBase DeletePhaseArtifacts (DataArrayBase dataArrayBase, double artifactsThreshold, bool cloneDataArray, int[] subsetIndices)
 Delete numerical phase artifacts, i.e. set all amplitude below the given threshold 𝑡 to zero, and set imaginary parts less than 𝑡 times the real part also to zero.
 
static DataArrayBase DiscreteOversampling (DataArrayBase dataArray, int factor)
 Method for oversampling an equidistant data array in way that new sampling points are set to zero.
 
static DataArrayBase DivideByConstant_Complex (DataArrayBase dataArray, Complex constant, int[] subsetIndices)
 Divide certain subsets by a constant. The operation will be a complex division.
 
static DataArrayBase DivideByConstant_Separately (DataArrayBase dataArray, double realPartOrAmplitude, double imaginaryPartOrPhase, bool amplitudePhaseRepresentation, int[] subsetIndices)
 Divide certain subsets by a constant. The operation will consist of two independent real valued operations for the complex parts respectively.
 
static DataArrayBase DoFieldQuantityOperationOnDataArray (DataArrayBase dataArrayBase, ComplexPart operation)
 Method that does a field quantity operation on a data array.
 
static DataArrayBase EquidistantResamplingOfDataArray (DataArrayBase dataArrayBase, Vector samplingPoints, VectorD samplingDistance, InterpolationMethod interpolationMethod, bool keepInterpolationMethodsUnchanged, bool keepFirstCoordinateOfExtent)
 Method to resample a data array.
 
static ComplexField ExtractEllipticalDataFromNonequidistantDataArray (DataArray2D da, EllipticRegion ellipticRegion, Complex outsideValueForEllipse, int subsetIndex, out(long, long) offset, RectangleOfPixels pixelBox=null)
 Extracts that part of a subset which is covered by a given ellipse. The result will contain only as much points as are covered by the ellipse's bounding box. Point inside the box but outside the ellipse will be set to NaN.
 
static DataArray1D ExtractEquidistant1DDataArrayFrom2DDataArray (DataArray2D dataArray2D, VectorD startPoint, VectorD endPoint, bool enforceSteppedInterpolation, int noOfPointsToExtract, double newStartCoordinate, string commentOfCoordinates, MeasuredQuantity quantityOfCoordinate, bool enforceNonNegativeValues, out double[] maximumAmplitudes)
 Method for extracting an equidistantly sampled 1D data array from any 2D data array. This will be done along a line which has to be specified.
 
static DataArray1D ExtractRangeSelection (DataArray1D inputDataArray, RectangleOfPixels rangeMarker, double rangeEndPoint)
 Extracts the given range of a one-dimensional data array.
 
static DataArray2D ExtractRectangularOrEllipticalSelection (DataArray2D inputDataArray, RectangleOfPixels rectangleMarker, bool elliptical, Complex outsideValueForEllipse, VectorD? rectEndPoint=null)
 Extracts the selected rectangular region of a two-dimensional data array.
 
static DataArray1D ExtractSubsetDataAtOnePoint (DataArray1D dataArray1D, double extractionCoordinate, bool enforceSteppedInterpolation, string newCommentOfData, double newStartCoordinate, double newSamplingDistance, string commentOfNewCoordinate, MeasuredQuantity physicalPropertyOfNewCoordinate, out PhysicalValueComplex singleValueForSingleSubset)
 Extracts the subset data at one point.
 
static DataArray1D ExtractSubsetDataAtOnePoint (DataArray2D dataArray2D, VectorD extractionCoordinates, bool enforceSteppedInterpolation, string newCommentOfData, double newStartCoordinate, double newSamplingDistance, string commentOfNewCoordinate, MeasuredQuantity physicalPropertyOfNewCoordinate, out PhysicalValueComplex singleValueForSingleSubset)
 Extracts the subset data at one point.
 
static ChromaticFieldsSetBase ExtractSubsetsFromDataArray (ChromaticFieldsSetBase cfsBase, int[] indicesToBeKept)
 Method that extracts subsets from a data array.
 
static DataArrayBase ExtractSubsetsFromDataArray (DataArrayBase dataArrayBase, int[] indicesToBeKept)
 Method that extracts subsets from a data array.
 
static DataArrayBase FillSelection (DataArrayBase dataArray, Complex fillValue, RectangleOfPixels regionMarker, bool elliptical, bool useInverseSelection, int[] subsetIndices)
 Fills the selected region of the data array with the specified value.
 
static DataArrayBase FourierTransformationOfDataArray (DataArrayBase dataArray, bool useNumericalFT, bool useInverseFT)
 Applies a FFT to a data array.
 
static DataArrayBase GeneralUnaryPointManipulation (DataArrayBase inputDataArray, Func< List< PhysicalValueComplex >, List< PhysicalValueBase > > manipulation, CancellationToken? cancellationToken=null)
 A general point-wise manipulation for data arrays. For each data point one or more physical values are calculated from the values of the input data array at this point (one per subset). Whether the resulting data array is complex-valued is determined by whether PhysicalValue or PhysicalValueComplex are calculated from the results of the actual manipulation for the first data point. Amount, measured quantities and comments of the subsets are also determined from the results for the first data point.
 
static void GetDifferentCoordinateParametersOfTwoDataArrays (DataArray1D dataArray_1, DataArray1D dataArray_2, bool checkWithTolerance, out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences)
 Gets all data array differences related to the coordinates.
 
static void GetDifferentCoordinateParametersOfTwoDataArrays (DataArray2D dataArray_1, DataArray2D dataArray_2, bool checkWithTolerance, out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences_X, out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences_Y)
 Gets all data array differences related to the coordinates.
 
static void GetDifferentCoordinateParametersOfTwoDataArrays (DataArrayGridLess dataArray_1, DataArrayGridLess dataArray_2, bool checkWithTolerance, out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences)
 Gets all data array differences related to the coordinates.
 
static DataArrayBase GetTemporalSamplingOfRealPart (DataArrayBase numericalDataArray, int numberOfFrames, bool treatAsElectricField)
 Get temporal sampling of real part of first data subset over one period. The real part of the given data array is multiplied with exp(i*omega*t) [=exp(i*2PI*[t/T])].
 
static DataArrayBase IntegrateDataArrayAlongWavelengths (DataArrayBase daInput, double[] wavelengths, string subsetDescription, MeasuredQuantity quantityOfIntegratedData)
 public support function to integrate the subsets of a given data array along the subset index The coordinate for the subset index are interpreted as wavelengths here (used for photometry evaluation within detector add-ons)
 
static DataArrayBase IntegrateDataArrayAlongWavelengths (DataArrayBase daInput, double[] wavelengths, string subsetDescription, PhysicalProperty propertyOfIntegratedData)
 public support function to integrate the subsets of a given data array along the subset index The coordinate for the subset index are interpreted as wavelengths here (used for photometry evaluation within detector add-ons)
 
static DataArrayBase LiftPositive (DataArrayBase dataArray, int[] subsetIndices)
 Lifts the values of a data array in a way no negative values occur in the real part anymore.
 
static DataArray1D MirrorDataArray1D_Horizontally (DataArray1D dataArray, int[] subsetIndices)
 Method which performs a horizontal mirror operation on a DataArray1D.
 
static DataArray2D MirrorDataArray2D_Horizontally (DataArray2D dataArray, int[] subsetIndices)
 Method which performs a horizontal mirror operation on a DataArray2D.
 
static DataArray2D MirrorDataArray2D_Vertically (DataArray2D dataArray, int[] subsetIndices)
 Method which performs a vertical mirror operation on a DataArray2D.
 
static DataArrayBase ModifyPhase (DataArrayBase dataArrayBase, PhaseModifyOperation operation, double wavelength, bool useQuantization, int numberOfLevels, double doubleParameter, bool hermitian, bool superimpose, int[] subsetIndices)
 Static method which modifies the phase in various ways.
 
static DataArrayBase MultiplyConstant_Complex (DataArrayBase dataArray, Complex constant, int[] subsetIndices)
 Multiply a constant with certain subsets. The operation will be a complex multiplication.
 
static DataArrayBase MultiplyConstant_Separately (DataArrayBase dataArray, double realPartOrAmplitude, double imaginaryPartOrPhase, bool amplitudePhaseRepresentation, int[] subsetIndices)
 Multiply a constant with certain subsets. The operation will consist of two independent real valued operations for the complex parts respectively.
 
static DataArrayBase Normalize (DataArrayBase dataArray, RectangleOfPixels regionMarker=null, bool elliptical=false, int[] subsetIndices)
 Normalizes a data array, i.e. brings the amplitude into the range 0 ... +1 and the real part into the range -1 ... +1.
 
static DataArrayBase PeriodicReplicationOfDataArray (DataArrayBase dataArrayBase, VectorD replicationFactors, bool keepOriginalInCenter)
 Method for periodic replication of data arrays.
 
static DataArrayBase Quantize (DataArrayBase dataArray, QuantizationType quantizationType, int noOfAmplitudeLevels, int noOfPhaseLevels, double softQuantizationFactor)
 Does a quantization of all subsets of a data array.
 
static DataArrayBase RaiseToPowerOfConstant_Complex (DataArrayBase dataArray, Complex constant, int[] subsetIndices)
 Raise to the power of a constant with certain subsets. The operation will be a complex exponentiation.
 
static DataArrayBase RaiseToPowerOfConstant_Separately (DataArrayBase dataArray, double realPartOrAmplitude, double imaginaryPartOrPhase, bool amplitudePhaseRepresentation, int[] subsetIndices)
 Raise to the power of a constant with certain subsets. The operation will consist of two independent real valued operations for the complex parts respectively.
 
static DataArray2D RemovePhaseDislocationsInsideSelection (DataArray2D dataArray, RectangleOfPixels regionMarker, bool elliptical, int[] subsetIndices)
 Static function to remove all phase dislocations within a 2D selection.
 
static DataArray2D RemoveRedundantData (DataArray2D inputDataArray)
 Removes redundant data in a two-dimensional non-equidistant data array with Constant Interval interpolation and one subset. First all columns are scanned whether two consecutive columns have the same data. Then the same is done for all rows.
 
static ChromaticFieldsSetBase RemoveSubsetsFromDataArray (ChromaticFieldsSetBase cfsBase, int[] removeIndices)
 Method that removes subsets from a data array.
 
static DataArrayBase RemoveSubsetsFromDataArray (DataArrayBase dataArrayBase, int[] removeIndices)
 Method that removes subsets from a data array.
 
static DataArrayBase SavitzkyGolayFilter (DataArrayBase dataArray, int windowSize, int order)
 Applies the Savitzky-Golay-Filter on the given data array. This filter is a special low-pass filter, well adapted for data smoothing.
 
static DataArrayBase ScaleToValueRange (DataArrayBase dataArray, double minimum, double maximum, bool cloneDataArray, int[] subsetIndices)
 Normalizes a data array, i.e. brings the amplitude into the range 0 ... +1 and the real part into the range -1 ... +1.
 
static DataArrayBase SetToConstant (DataArrayBase dataArray, Complex constant, int[] subsetIndices)
 Set certain subsets to a constant.
 
static DataArrayBase SumOfAllSubsets (DataArrayBase dataArrayBase, bool complexAddition, ComplexPart partToSumInComplexCase)
 Method which allows a complex-valued or real-valued summation of all subsets of a data array.
 
static DataArrayBase SumOfAllSubsets (DataArrayBase dataArrayBase, bool complexAddition, FieldQuantity fieldQuantityToSum)
 Method which allows a complex-valued or real-valued summation of all subsets of a data array.
 
static ChromaticFieldsSetBase TransformCFSFromKDomainIntoSDomain (ChromaticFieldsSetBase cfsInK, HomogeneousMedium mediumAssociatedWithCFS)
 public support function to convert a chromatic fields set (given in k-domain) to direction space For the conversion we use the common area of the domains!
 
static ChromaticFieldsSetBase TransformCFSFromSToAlphaBeta (ChromaticFieldsSetBase cfsInS)
 static support function to convert a chromatic fields set from S-domain into alpha beta domain
 
static DataArray2D TransposeDataArray2D (DataArray2D dataArray)
 Method which transposes a DataArray2D, which swaps all x and y properties.
 
static DataArrayGridLess TransposeDataArray2D (DataArrayGridLess dataArray)
 Method which transposes a DataArrayGridLess, which swaps all x and y properties.
 
static DataArrayBase UnifiedMergingOfDataArrays (DataArrayBase[] dataArrays, bool cloneArrays)
 Merges the given data array into one. If all data arrays have the same sampling the subsets are just appended. Else they are interpolated to the common sampling, which can be equidistant or non-equidistant.
 
static DataArrayBase UnwrapPhase (DataArrayBase dataArray, int[] subsetIndices)
 Unwraps the phase, i.e. removes the 2 \(\pi\) jumps.
 

Static Public Attributes

static long newNoOfSamplingPoints
 Method for determining the parameters needed for centering a 1D DA.
 
static bool xCentered
 Method for checking whether the coordinates are centered (as needed for FFT) or not.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Support class containing the manipulations for numerical data arrays.

Member Function Documentation

◆ AddConstant_Complex()

static DataArrayBase AddConstant_Complex ( DataArrayBase dataArray,
Complex constant,
int[] subsetIndices )
static

Add a constant to certain subsets. The operation will be a complex addition.

Parameters
dataArrayThe data array to manipulate.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
constantThe complex constant to be used for the operation.
Returns
The result of the addition.

◆ AddConstant_Separately()

static DataArrayBase AddConstant_Separately ( DataArrayBase dataArray,
double realPartOrAmplitude,
double imaginaryPartOrPhase,
bool amplitudePhaseRepresentation,
int[] subsetIndices )
static

Add a constant to certain subsets. The operation will consist of two independent real valued operations for the complex parts respectively.

Parameters
dataArrayThe data array to manipulate.
realPartOrAmplitudeThe value added to the real part or the amplitude.
imaginaryPartOrPhaseThe value added to the imaginary part or the phase.
amplitudePhaseRepresentationIf set to true amplitude and phase are given. Otherwise real and imaginary part are given.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the addition.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ AppendSubsetsFromAnotherDataArray()

static DataArrayBase AppendSubsetsFromAnotherDataArray ( DataArrayBase targetDataArrayBase,
DataArrayBase sourceDataArrayBase,
int[] indicesToAppend,
out string warnings )
static

Method that appends the subsets of one data array to another. The data arrays have to have the same number of sampling points (for 2D: in each direction).

Parameters
targetDataArrayBaseData array to append the subsets to
sourceDataArrayBaseData array to get the subsets from.
indicesToAppendThe indices of the subsets to append.
warningsOut parameter containing possible warnings.
Returns
A data array with copied subsets appended.
Exceptions
System.ArgumentExceptionThe data arrays have to be of the same type. or No valid index array given. or Method works for DataArray1D and DataArray2D only.

◆ AppendSubsetsFromAnotherDataArrayWithInterpolationToTargetCoordinates() [1/2]

static DataArray1D AppendSubsetsFromAnotherDataArrayWithInterpolationToTargetCoordinates ( DataArray1D targetDataArray1D,
DataArray1D sourceDataArray1D,
int[] indicesToAppend,
out string warnings )
static

Method that appends subsets from a source data array to another one (the target data array). The source will be interpolated to the coordinates of the target.

Parameters
targetDataArray1DThe data array new subsets will be appended to.
sourceDataArray1DThe data array the subsets to be appended are get from.
indicesToAppendThe subset indices of the subsets from the source to be appended.
warningsWarning which occurred if some parameters are not fitting.
Returns
A new data array with merged coordinates which holds all subsets of the target (which have been interpolated of the merged coordinates) as well as the selected subsets of the source (which have been interpolated too).
Exceptions
System.ArgumentExceptionNo valid index array given.
System.IndexOutOfRangeExceptionInvalid subset index found.

◆ AppendSubsetsFromAnotherDataArrayWithInterpolationToTargetCoordinates() [2/2]

static DataArray2D AppendSubsetsFromAnotherDataArrayWithInterpolationToTargetCoordinates ( DataArray2D targetDataArray2D,
DataArray2D sourceDataArray2D,
int[] indicesToAppend,
out string warnings )
static

Method that appends subsets from a source data array to another one (the target data array). The source will be interpolated to the coordinates of the target.

Parameters
targetDataArray2DThe data array new subsets will be appended to.
sourceDataArray2DThe data array the subsets to be appended are get from.
indicesToAppendThe subset indices of the subsets from the source to be appended.
warningsWarning which occurred if some parameters are not fitting.
Returns
A new data array with merged coordinates which holds all subsets of the target (which have been interpolated of the merged coordinates) as well as the selected subsets of the source (which have been interpolated too).
Exceptions
System.ArgumentExceptionNo valid index array given.
System.IndexOutOfRangeExceptionInvalid subset index found.

◆ AppendSubsetsFromAnotherDataArrayWithMerging() [1/2]

static DataArray1D AppendSubsetsFromAnotherDataArrayWithMerging ( DataArray1D targetDataArray1D,
DataArray1D sourceDataArray1D,
int[] indicesToAppend,
out string warnings )
static

Method that appends subsets from a source data array to another one (the target data array). The result will have merged coordinates.

Parameters
targetDataArray1DThe data array new subsets will be appended to.
sourceDataArray1DThe data array the subsets to be appended are get from.
indicesToAppendThe subset indices of the subsets from the source to be appended.
warningsWarning which occurred if some parameters are not fitting.
Returns
A new data array with merged coordinates which holds all subsets of the target (which have been interpolated of the merged coordinates) as well as the selected subsets of the source (which have been interpolated too).
Exceptions
System.IndexOutOfRangeExceptionInvalid subset index found.

◆ AppendSubsetsFromAnotherDataArrayWithMerging() [2/2]

static DataArray2D AppendSubsetsFromAnotherDataArrayWithMerging ( DataArray2D targetDataArray2D,
DataArray2D sourceDataArray2D,
int[] indicesToAppend,
out string warnings )
static

Method that appends subsets from a source data array to another one (the target data array). The result will have merged coordinates.

Parameters
targetDataArray2DThe data array new subsets will be appended to.
sourceDataArray2DThe data array the subsets to be appended are get from.
indicesToAppendThe subset indices of the subsets from the source to be appended. If this array is null or empty, all subsets of the source array will be appended.
warningsWarning which occurred if some parameters are not fitting.
Returns
A new data array with merged coordinates which holds all subsets of the target (which have been interpolated of the merged coordinates) as well as the selected subsets of the source (which have been interpolated too).
Exceptions
System.IndexOutOfRangeExceptionInvalid subset index found.

◆ ArrayArrayOperation()

static DataArrayBase ArrayArrayOperation ( ArrayArrayOperationType operationType,
DataArrayBase da1,
DataArrayBase da2,
List< Tuple< int, int > > indicesOfOperandSubsets,
out string warnings,
bool addHintForCommonNonequidistantCoordinatesOfCFSs = false )
static

Array-array-operation of two data arrays. Does not work for convolution! For convolution of two data arrays please use DataArrayManipulations.Convolution(...).

Parameters
operationTypeType of operation to be done.
da1First operand.
da2Second operand.
indicesOfOperandSubsetsList of those index pairs which correspond to the subsets that have to be used for the subset operations.
warningsWarnings in case the coordinate parameters don't match .
addHintForCommonNonequidistantCoordinatesOfCFSsShall the radio button for 'Calculate Common Coordinates' in FormSelectionOfSubsetMergeAlgorithm warn that CFS may turn into DA?
Returns
The result of the array-array-operation.
Exceptions
System.ArgumentExceptionThe data arrays have to have identical coordinate dimensionalities. or operationType not supported (e.g. convolution). or Operation supports 1D and gridded 2D data arrays only.
System.IndexOutOfRangeExceptionInvalid subset index found.

◆ CalculateIntegralFor1DDataByTrapezoidRule()

static double CalculateIntegralFor1DDataByTrapezoidRule ( DataArray1D daToIntegrate,
int subsetIndex = 0 )
static

support method to calculate the integral under a 1D data array by trapezoid rule

Parameters
daToIntegratethe data array for which the integral shall be calculated.
subsetIndexoptional parameter for definition of the subset that shall be evaluated
Returns
the integral under the 1D graph

◆ CalculateSumOfDataArraysPerWavelength()

static ChromaticFieldsSetBase CalculateSumOfDataArraysPerWavelength ( List< DataArrayBase > inputDataArrays,
List< double > listAssociatedWavelengths,
string prefixForCommentsOfSubsets,
InterpolationMethod interpolationMethodToUseForAllDataArrays,
double oversamplingFactor )
static

public support method to calculate the sum of all data array per wavelength (the wavelength information is provided by the input variable "listAssociatedWavelengths")

Parameters
inputDataArraysthe list of data arrays that shall be summed up
listAssociatedWavelengthslist of associated wavelengths (number of entries should be the same as number of input data arrays)
prefixForCommentsOfSubsetsprefix that shall be used for description of subsets per wavelength. Must end with a space.
interpolationMethodToUseForAllDataArraysin case "useInterpolationMethodOfDataArrayForInterpolation" is false => we use this interpolation method for resampling
oversamplingFactorthe user can define an additional oversampling factor, which is used for resampling of data
Returns
the summed up data as chromatic fields set (only 1D and 2D [equidistant] gridded data arrays are supported. If the input is not valid the routine will throw and exception with additional information

◆ CenterDataArray_CoordinateBased() [1/2]

static DataArray1D CenterDataArray_CoordinateBased ( DataArray1D dataArray)
static

Method for centering a 1D data array.

Parameters
dataArrayData array to be centered.
Returns
Centered data array.

◆ CenterDataArray_CoordinateBased() [2/2]

static DataArray2D CenterDataArray_CoordinateBased ( DataArray2D dataArray)
static

Method for centering a 2D data array.

Parameters
dataArrayData array to be centered.
Returns
Centered data array.

◆ ChangeInterpolationMethodEquidistant()

static void ChangeInterpolationMethodEquidistant ( ref DataArrayBase dataArrayBase,
InterpolationMethod interpolationMethod )
static

Method to change the interpolation method of a data array.

Parameters
dataArrayBaseReference to the data array whose interpolation method shall be changed.
interpolationMethodInterpolation method that shall be used for resampling in both directions
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ CheckForIdenticalCoordinateParametersOfTwoDataArrays() [1/2]

static bool CheckForIdenticalCoordinateParametersOfTwoDataArrays ( DataArrayBase da1,
DataArrayBase da2,
bool checkNonSamplingParameters,
out List< string > warnings,
out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences,
bool checkWithTolerance )
static

Method that compares the coordinate and interpolation parameters of two given data arrays.

Parameters
da1First data array to be compared with second.
da2Second data array to be compared with first.
checkNonSamplingParametersIf TRUE, the return value will be 'false' even if only those properties which are not directly related to sampling (e.g. interpolation, physical meaning) are not equal. Otherwise, all sampling related parameters being equal will be sufficient for the return value to be 'true'.
warningsList of warnings that result from differing parameters. null if there are no warnings.
differencesOut parameter describing the found differences in detail.
checkWithToleranceIf this optional parameter is set to false the coordinate parameters must match exactly without even an irrelevant difference.
Returns
TRUE if the parameters are identical.
Exceptions
System.ArgumentExceptionThe data arrays have to be of the same type.
System.NotImplementedExceptionMethod does not work for this type of data array.

◆ CheckForIdenticalCoordinateParametersOfTwoDataArrays() [2/2]

static bool CheckForIdenticalCoordinateParametersOfTwoDataArrays ( DataArrayBase da1,
DataArrayBase da2,
bool checkNonSamplingParameters,
out string warnings,
out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences,
bool checkWithTolerance = true )
static

Method that compares the coordinate and interpolation parameters of two given data arrays.

Parameters
da1First data array to be compared with second.
da2Second data array to be compared with first.
checkNonSamplingParametersIf TRUE, the return value will be 'false' even if only those properties which are not directly related to sampling (e.g. interpolation, physical meaning) are not equal. Otherwise, all sampling related parameters being equal will be sufficient for the return value to be 'true'.
warningsString of warnings that result from differing parameters. An empty string if there are no warnings.
differencesOut parameter describing the found differences in detail.
checkWithToleranceIf this optional parameter is set to false the coordinate parameters must match exactly without even an irrelevant difference.
Returns
TRUE if the parameters are identical.
Exceptions
System.ArgumentExceptionThe data arrays have to be of the same type.
System.NotImplementedExceptionMethod does not work for this type of data array.

◆ ClipValues()

static DataArrayBase ClipValues ( DataArrayBase dataArray,
double amplitudeThreshold,
int[] subsetIndices )
static

Clips the amplitude (or real part for real valued data) at a given threshold.

Parameters
dataArrayThe data array which shall be clipped.
amplitudeThresholdThe amplitude / real part threshold to clip at.
subsetIndicesOne or more subset indices which shall be manipulated. If none is specified, then all subsets are manipulated.
Returns
The clipped data array.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ ConjugatePhase()

static DataArrayBase ConjugatePhase ( DataArrayBase dataArray,
int[] subsetIndices )
static

Conjugates the phase.

Parameters
dataArrayThe data array whose phase shall be conjugated.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The data array with the conjugated phase.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ Convolution() [1/2]

static DataArray1D Convolution ( DataArray1D da1,
DataArray1D da2,
List< Tuple< int, int > > indicesOfOperandSubsets,
bool addHintForCommonNonequidistantCoordinatesOfCFSs,
out string warnings )
static

Does a convolution of two data arrays.

Parameters
da1First operand.
da2Second operand.
indicesOfOperandSubsetsList of those index pairs which correspond to the subsets that have to be used for the subset operations.
warningsWarnings in case the coordinate parameters don't match.
addHintForCommonNonequidistantCoordinatesOfCFSsShall the radiobutton for 'Calculate Common Coordinates' in FormSelectionOfSubsetMergeAlgorithm warn that CFS may turn into DA?
Returns
The result of the array-array-operation.
Exceptions
System.ArgumentExceptionOperands have to be equidistant.

◆ Convolution() [2/2]

static DataArray2D Convolution ( DataArray2D da1,
DataArray2D da2,
List< Tuple< int, int > > indicesOfOperandSubsets,
bool addHintForCommonNonequidistantCoordinatesOfCFSs,
out string warnings )
static

Does a convolution of two data arrays.

Parameters
da1First operand.
da2Second operand.
indicesOfOperandSubsetsList of those index pairs which correspond to the subsets that have to be used for the subset operations.
warningsWarnings in case the coordinate parameters don't match.
Returns
The result of the array-array-operation.
Exceptions
System.ArgumentExceptionOperands have to be completely equidistantly sampled.

◆ CreatePointCloudAddOn< T >() [1/2]

static T CreatePointCloudAddOn< T > ( T dataArray2receivePointCloud,
DataArrayGridLess dataArrayGridLessWithPointCloud,
string nameOfAddon,
int[] selectedSubsetIndices,
out int noOfOutlyingPoints )
static

Creates a point cloud add-on from a DataArrayGridLess and adds it to a given gridless 2D data array.

Template Parameters
TA DataArrayBase or a derived type.
Parameters
dataArray2receivePointCloudData array to add the point cloud add-on.
dataArrayGridLessWithPointCloudDataArrayGridLess to create the point cloud from.
nameOfAddonThe name of the new add-on.
selectedSubsetIndicesArray of subset indices to apply the point cloud on.
noOfOutlyingPointsThe number of that point cloud points which lie outside the domain of the gridded 2D DA.
Returns
The modified data array with added point cloud.
Exceptions
System.ArgumentExceptionGiven Data Array must be two-dimensional.
Type Constraints
T :DataArrayBase 

◆ CreatePointCloudAddOn< T >() [2/2]

static T CreatePointCloudAddOn< T > ( T dataArray2receivePointCloud,
Propagation.RayDistribution rayDistribution,
string nameOfDistribution,
int[] selectedSubsetIndices,
out int noOfOutlyingPoints )
static

Creates a point cloud add-on from a RayDistribution and adds it to a given gridless 2D data array.

Template Parameters
TA DataArrayBase or a derived type.
Parameters
dataArray2receivePointCloudData array to add the point cloud add-on.
rayDistributionRay distribution to create the point cloud from.
nameOfDistributionThe distribution's name, to be used in the add-ons.
selectedSubsetIndicesArray of subset indices to apply the point cloud on.
noOfOutlyingPointsThe number of that point cloud points which lie outside the domain of the gridded 2D DA.
Returns
The modified data array with added point cloud.
Exceptions
System.ArgumentExceptionGiven Data Array must be two-dimensional.
Type Constraints
T :DataArrayBase 

◆ CreateRegionAddOn() [1/3]

static DataArray1D CreateRegionAddOn ( DataArray1D dataArray2receiveRegion,
Numerics.Region1D.IntervalRegion region,
int[] selectedSubsetIndices,
out bool notCompletelyInDomain )
static

Creates a region add-on from an interval region and adds it to a given 1D data array.

Parameters
dataArray2receiveRegionData array to add the region add-on.
regionRegion to use as add-on.
selectedSubsetIndicesArray of subset indices to apply the point cloud on.
notCompletelyInDomainIf true, the given region may not lie completely inside the data arrays domain.
Returns
The modified data array with a region added as graphics add-on.

◆ CreateRegionAddOn() [2/3]

static DataArray2D CreateRegionAddOn ( DataArray2D dataArray2receiveRegion,
Numerics.Region2D.ElementaryRegion2D region,
int[] selectedSubsetIndices,
out bool notCompletelyInDomain )
static

Creates a region add-on from an elementary region and adds it to a given gridded 2D data array.

Parameters
dataArray2receiveRegionData array to add the region add-on.
regionRegion to use as add-on.
selectedSubsetIndicesArray of subset indices to apply the point cloud on.
notCompletelyInDomainIf true, the given region may not lie completely inside the data arrays domain.
Returns
The modified data array with a region added as graphics add-on.

◆ CreateRegionAddOn() [3/3]

static DataArrayGridLess CreateRegionAddOn ( DataArrayGridLess dataArray2receiveRegion,
Numerics.Region2D.ElementaryRegion2D region,
int[] selectedSubsetIndices,
out bool notCompletelyInDomain )
static

Creates a region add-on from an elementary region and adds it to a given gridless 2D data array.

Parameters
dataArray2receiveRegionData array to add the region add-on.
regionRegion to use as add-on.
selectedSubsetIndicesArray of subset indices to apply the point cloud on.
notCompletelyInDomainIf true, the given region may not lie completely inside the data arrays domain.
Returns
The modified data array with a region added as graphics add-on.

◆ DeletePhaseArtifacts()

static DataArrayBase DeletePhaseArtifacts ( DataArrayBase dataArrayBase,
double artifactsThreshold,
bool cloneDataArray,
int[] subsetIndices )
static

Delete numerical phase artifacts, i.e. set all amplitude below the given threshold 𝑡 to zero, and set imaginary parts less than 𝑡 times the real part also to zero.

Parameters
dataArrayBaseThe data array where phase artifacts shall be deleted.
artifactsThresholdThe artifacts threshold 𝑡.
cloneDataArrayIf set to true the data array is cloned. Otherwise the original data array is manipulated which is faster.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The data array with removed phase artifacts.
Exceptions
ArgumentExceptionOperation only supported for complex-valued data.
NotImplementedExceptionMethod does not work for this type of data array.

◆ DiscreteOversampling()

static DataArrayBase DiscreteOversampling ( DataArrayBase dataArray,
int factor )
static

Method for oversampling an equidistant data array in way that new sampling points are set to zero.

Parameters
dataArrayData array to be oversampled.
factorOversampling factor.
Returns
The resampled data array.
Exceptions
System.ArgumentOutOfRangeExceptionThe oversampling factor has to be greater or equal 1.
System.ArgumentExceptionThe method works for equidistant arrays only. or Method works for DataArray1D and DataArray2D only.

◆ DivideByConstant_Complex()

static DataArrayBase DivideByConstant_Complex ( DataArrayBase dataArray,
Complex constant,
int[] subsetIndices )
static

Divide certain subsets by a constant. The operation will be a complex division.

Parameters
dataArrayThe data array to manipulate.
constantThe complex constant to be used for the operation.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the division.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ DivideByConstant_Separately()

static DataArrayBase DivideByConstant_Separately ( DataArrayBase dataArray,
double realPartOrAmplitude,
double imaginaryPartOrPhase,
bool amplitudePhaseRepresentation,
int[] subsetIndices )
static

Divide certain subsets by a constant. The operation will consist of two independent real valued operations for the complex parts respectively.

Parameters
dataArrayThe data array to manipulate.
realPartOrAmplitudeThe value by which the real part or the amplitude is divided.
imaginaryPartOrPhaseThe value by which the imaginary part or the phase is divided.
amplitudePhaseRepresentationIf set to true amplitude and phase are given. Otherwise real and imaginary part are given.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the division.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ DoFieldQuantityOperationOnDataArray()

static DataArrayBase DoFieldQuantityOperationOnDataArray ( DataArrayBase dataArrayBase,
ComplexPart operation )
static

Method that does a field quantity operation on a data array.

Parameters
dataArrayBaseData array to operate on
operationField quantity operation to do.
Returns
A data array that results from the given operation.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ EquidistantResamplingOfDataArray()

static DataArrayBase EquidistantResamplingOfDataArray ( DataArrayBase dataArrayBase,
Vector samplingPoints,
VectorD samplingDistance,
InterpolationMethod interpolationMethod,
bool keepInterpolationMethodsUnchanged,
bool keepFirstCoordinateOfExtent )
static

Method to resample a data array.

Parameters
dataArrayBaseData array to be resampled.
samplingPointsNew number of sampling points.
samplingDistanceNew sampling distances.
interpolationMethodInterpolation method that shall be used for resampling in both directions
keepInterpolationMethodsUnchangedIf TRUE, the interpolation methods for the data array are kept unchanged, no matter what methods have been used for resampling. If FALSE, the methods for resampling are set as the data array's new interpolation methods.
keepFirstCoordinateOfExtentIn case of Nearest Neighbor Interpolation, there is a difference between Array Size and Coordinate Extent. If this method is used for resmapling such data array in a way which preserves the coordinate extent (by providing a correctly calculated new samplingDistance!!!), we have to adapt the first coordinate as well. This will be done if this flag is set to true.
Returns
Resampled data array.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ ExtractEllipticalDataFromNonequidistantDataArray()

static ComplexField ExtractEllipticalDataFromNonequidistantDataArray ( DataArray2D da,
EllipticRegion ellipticRegion,
Complex outsideValueForEllipse,
int subsetIndex,
out(long, long) offset,
RectangleOfPixels pixelBox = null )
static

Extracts that part of a subset which is covered by a given ellipse. The result will contain only as much points as are covered by the ellipse's bounding box. Point inside the box but outside the ellipse will be set to NaN.

Parameters
daData array to extract from. It should be non-equidistant in one dimension at least. (Otherwise this method is not needed.)
ellipticRegionEllipse to extract.
outsideValueForEllipseIf an ellipse is to be extracted, this value is used for the pixels which are outside the ellipse but inside the ellipse's bounding box.
subsetIndexSubset to extract.
offsetThe pixel offset of the extracted data's lower left corner to the original's (0,0) pixel.
pixelBoxRectangle in pixel coordinates specifying the extension of the resulting field. If this optional parameter is not set, the axis aligned bounding box of the ellipse is used to this end.
Returns
That part of a subset which is covered by a given ellipse. The result will contain only as much points as are covered by the ellipse's bounding box. Point inside the pixel box but outside the ellipse will be set to NaN.

◆ ExtractEquidistant1DDataArrayFrom2DDataArray()

static DataArray1D ExtractEquidistant1DDataArrayFrom2DDataArray ( DataArray2D dataArray2D,
VectorD startPoint,
VectorD endPoint,
bool enforceSteppedInterpolation,
int noOfPointsToExtract,
double newStartCoordinate,
string commentOfCoordinates,
MeasuredQuantity quantityOfCoordinate,
bool enforceNonNegativeValues,
out double[] maximumAmplitudes )
static

Method for extracting an equidistantly sampled 1D data array from any 2D data array. This will be done along a line which has to be specified.

Parameters
dataArray2DDataArray2D to extract the 1D data from.
startPointStart coordinates of extraction.
endPointEnd coordinates of extraction.
enforceSteppedInterpolationIf true, the extraction will be done from stepped data instead of using the data array's own interpolation method.
noOfPointsToExtractThe number of points to be extracted.
newStartCoordinateCoordinate which will be set as new start coordinate in the resulting 1D data array.
commentOfCoordinatesThe description for the new coordinate axis.
quantityOfCoordinateThe measured quantity to be used for the result.
maximumAmplitudesThe maximum amplitude values of all subsets in the extracted 1D array.
enforceNonNegativeValuesIf true, all values with negative real part will be set to zero. Needed for extracting 1D CFSs.
Returns
Result of an equidistant 1D extraction in a 2D data array.
Exceptions
ArgumentOutOfRangeExceptionLess than two data points to extract.
ArgumentExceptionStart point and end point of extraction must not be identical.
System.ArgumentExceptionStart point and end point of extraction must not be identical.

◆ ExtractRangeSelection()

static DataArray1D ExtractRangeSelection ( DataArray1D inputDataArray,
RectangleOfPixels rangeMarker,
double rangeEndPoint )
static

Extracts the given range of a one-dimensional data array.

Parameters
inputDataArrayThe data array from which the selected range shall be extracted.
rangeMarkerThe range marker indicating the region to extract.
rangeEndPointThe physical coordinate of the range's end point.
Returns
The extracted data array.
Exceptions
System.ArgumentExceptionThe range selection contains only one sampling point. From this selection a one-dimensional data array cannot be extracted.

◆ ExtractRectangularOrEllipticalSelection()

static DataArray2D ExtractRectangularOrEllipticalSelection ( DataArray2D inputDataArray,
RectangleOfPixels rectangleMarker,
bool elliptical,
Complex outsideValueForEllipse,
VectorD? rectEndPoint = null )
static

Extracts the selected rectangular region of a two-dimensional data array.

Parameters
inputDataArrayThe data array from which the selected rectangle marker shall be extracted.
rectangleMarkerThe rectangle marker indicating the selected region of the field.
ellipticalExtract an elliptical instead of an rectangular selection?
rectEndPointThe physical coordinates of the rectangle's upper right point. Needed only in some cases of non-equidistant arrays.
outsideValueForEllipseIf an ellipse is to be extracted, this value is used for the pixels which are outside the ellipse but inside the ellipse's bounding box.
Returns
The extracted data array.
Exceptions
System.ArgumentExceptionThe selection contains only one sampling point in x- or y-direction. From this selection a two-dimensional data array cannot be extracted.

◆ ExtractSubsetDataAtOnePoint() [1/2]

static DataArray1D ExtractSubsetDataAtOnePoint ( DataArray1D dataArray1D,
double extractionCoordinate,
bool enforceSteppedInterpolation,
string newCommentOfData,
double newStartCoordinate,
double newSamplingDistance,
string commentOfNewCoordinate,
MeasuredQuantity physicalPropertyOfNewCoordinate,
out PhysicalValueComplex singleValueForSingleSubset )
static

Extracts the subset data at one point.

Parameters
dataArray1DThe data array from which the data is extracted.
extractionCoordinateThe extraction coordinate.
enforceSteppedInterpolationIf true, a stepped interpolation (i.e. Nearest Neighbor or Constant Interval) will be used, no matter what the DataArrays own interpolation method is.
newCommentOfDataThe new comment of data.
newStartCoordinateThe new start coordinate.
newSamplingDistanceThe new sampling distance.
commentOfNewCoordinateThe new comment of the coordinate axis.
physicalPropertyOfNewCoordinateThe new physical property of the coordinate axis.
singleValueForSingleSubsetOut parameter returning the single value in case the given data array has only one subset.
Returns
A DataArray1D with the extracted data.
Exceptions
System.ArgumentExceptionThe given coordinate lies outside the coordinate range of the Numerical Data Array. or The subsets have different physical properties.

◆ ExtractSubsetDataAtOnePoint() [2/2]

static DataArray1D ExtractSubsetDataAtOnePoint ( DataArray2D dataArray2D,
VectorD extractionCoordinates,
bool enforceSteppedInterpolation,
string newCommentOfData,
double newStartCoordinate,
double newSamplingDistance,
string commentOfNewCoordinate,
MeasuredQuantity physicalPropertyOfNewCoordinate,
out PhysicalValueComplex singleValueForSingleSubset )
static

Extracts the subset data at one point.

Parameters
dataArray2DThe data array from which the data is extracted.
extractionCoordinatesThe extraction coordinates.
enforceSteppedInterpolationIf true, a stepped interpolation (i.e. Nearest Neighbor or Constant Interval) will be used, no matter what the DataArrays own interpolation method is.
newCommentOfDataThe new comment of data.
newStartCoordinateThe new start coordinate.
newSamplingDistanceThe new sampling distance.
commentOfNewCoordinateThe new comment of the coordinate axis.
physicalPropertyOfNewCoordinateThe new physical property of the coordinate axis.
singleValueForSingleSubsetOut parameter returning the single value in case the given data array has only one subset.
Returns
A DataArray1D with the extracted data.
Exceptions
System.ArgumentExceptionThe given coordinate lies outside the coordinate range of the Numerical Data Array. or The subsets have different physical properties.

◆ ExtractSubsetsFromDataArray() [1/2]

static ChromaticFieldsSetBase ExtractSubsetsFromDataArray ( ChromaticFieldsSetBase cfsBase,
int[] indicesToBeKept )
static

Method that extracts subsets from a data array.

Parameters
cfsBaseChromatic Fields Set to extract subsets from.
indicesToBeKeptThe indices of the subsets to extract.
Returns
A data array with extracted subsets.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D, DataArray2D, and DataArrayGridLess only.

◆ ExtractSubsetsFromDataArray() [2/2]

static DataArrayBase ExtractSubsetsFromDataArray ( DataArrayBase dataArrayBase,
int[] indicesToBeKept )
static

Method that extracts subsets from a data array.

Parameters
dataArrayBaseData array to extract subsets from.
indicesToBeKeptThe indices of the subsets to extract.
Returns
A data array with extracted subsets.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D, DataArray2D, and DataArrayGridLess only.

◆ FillSelection()

static DataArrayBase FillSelection ( DataArrayBase dataArray,
Complex fillValue,
RectangleOfPixels regionMarker,
bool elliptical,
bool useInverseSelection,
int[] subsetIndices )
static

Fills the selected region of the data array with the specified value.

Parameters
dataArrayThe data array to manipulate.
fillValueThe value with which the selected region shall be filled.
regionMarkerThe region of the field that shall be filled.
ellipticalIs the selection elliptically?
useInverseSelectionIf set to true the inverse of the selection is filled.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The manipulated data array.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ FourierTransformationOfDataArray()

static DataArrayBase FourierTransformationOfDataArray ( DataArrayBase dataArray,
bool useNumericalFT,
bool useInverseFT )
static

Applies a FFT to a data array.

Parameters
dataArrayData array to be transformed. It has to be equidistant. The coordinates have to have one of the properties 'length', 'wave number', 'time', 'temporal frequency' or 'no unit'. The coordinates has to be centered around zero.
useNumericalFTIf TRUE, a numerical FFT instead of a physical one is done.
useInverseFTIf TRUE, an inverse FFT is done.
Returns
Fourier transform of input DA.
Exceptions
System.ArgumentExceptionOperation is allowed for equidistant arrays only. or The coordinate 0 has to be in the center of the array. or Operation is allowed for equidistant arrays only.
System.ExceptionType of data array is not supported.

◆ GeneralUnaryPointManipulation()

static DataArrayBase GeneralUnaryPointManipulation ( DataArrayBase inputDataArray,
Func< List< PhysicalValueComplex >, List< PhysicalValueBase > > manipulation,
CancellationToken? cancellationToken = null )
static

A general point-wise manipulation for data arrays. For each data point one or more physical values are calculated from the values of the input data array at this point (one per subset). Whether the resulting data array is complex-valued is determined by whether PhysicalValue or PhysicalValueComplex are calculated from the results of the actual manipulation for the first data point. Amount, measured quantities and comments of the subsets are also determined from the results for the first data point.

Parameters
inputDataArrayThe input data array.
manipulationThe actual manipulation done on each data point.
cancellationTokenToken for cooperative task cancellation. Only has an effect for 2D diagrams.
Returns
The resulting data array.
Exceptions
NotImplementedExceptionImplementation for given data array type missing.

◆ GetDifferentCoordinateParametersOfTwoDataArrays() [1/3]

static void GetDifferentCoordinateParametersOfTwoDataArrays ( DataArray1D dataArray_1,
DataArray1D dataArray_2,
bool checkWithTolerance,
out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences )
static

Gets all data array differences related to the coordinates.

Parameters
dataArray_1First data array for comparison.
dataArray_2Second data array for comparison.
checkWithToleranceDo the comparison with some tolerance?
differencesList of all differences related to the coordinates.

◆ GetDifferentCoordinateParametersOfTwoDataArrays() [2/3]

static void GetDifferentCoordinateParametersOfTwoDataArrays ( DataArray2D dataArray_1,
DataArray2D dataArray_2,
bool checkWithTolerance,
out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences_X,
out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences_Y )
static

Gets all data array differences related to the coordinates.

Parameters
dataArray_1First data array for comparison.
dataArray_2Second data array for comparison.
checkWithToleranceDo the comparison with some tolerance?
differences_XList of all differences related to the x-coordinates.
differences_YList of all differences related to the y-coordinates.

◆ GetDifferentCoordinateParametersOfTwoDataArrays() [3/3]

static void GetDifferentCoordinateParametersOfTwoDataArrays ( DataArrayGridLess dataArray_1,
DataArrayGridLess dataArray_2,
bool checkWithTolerance,
out List<(string propName, string prop_1, string prop_2, bool samplingRelated)> differences )
static

Gets all data array differences related to the coordinates.

Parameters
dataArray_1First data array for comparison.
dataArray_2Second data array for comparison.
checkWithToleranceDo the comparison with some tolerance?
differencesList of all differences.

◆ GetTemporalSamplingOfRealPart()

static DataArrayBase GetTemporalSamplingOfRealPart ( DataArrayBase numericalDataArray,
int numberOfFrames,
bool treatAsElectricField )
static

Get temporal sampling of real part of first data subset over one period. The real part of the given data array is multiplied with exp(i*omega*t) [=exp(i*2PI*[t/T])].

Parameters
numericalDataArrayData Array to be temporally sampled.
numberOfFramesTemporal sampling count n.
treatAsElectricFieldIf true, the data re treated as being an electric field, as well as the result. Note that there is a scaling factor of 2 in case of an electric field. See the manual for more information.
Returns
Data Array with n subsets - one for each temporal frame.

◆ IntegrateDataArrayAlongWavelengths() [1/2]

static DataArrayBase IntegrateDataArrayAlongWavelengths ( DataArrayBase daInput,
double[] wavelengths,
string subsetDescription,
MeasuredQuantity quantityOfIntegratedData )
static

public support function to integrate the subsets of a given data array along the subset index The coordinate for the subset index are interpreted as wavelengths here (used for photometry evaluation within detector add-ons)

Parameters
daInputinput data array
wavelengthsthe list of wavelengths associated to the subsets of the data array
subsetDescriptioncomment for subset of output data array
quantityOfIntegratedDatathe measured quantity of the integrated data
Returns
a data array, which contains the integrated values along the subsets as coordinates

◆ IntegrateDataArrayAlongWavelengths() [2/2]

static DataArrayBase IntegrateDataArrayAlongWavelengths ( DataArrayBase daInput,
double[] wavelengths,
string subsetDescription,
PhysicalProperty propertyOfIntegratedData )
static

public support function to integrate the subsets of a given data array along the subset index The coordinate for the subset index are interpreted as wavelengths here (used for photometry evaluation within detector add-ons)

Parameters
daInputinput data array
wavelengthsthe list of wavelengths associated to the subsets of the data array
subsetDescriptioncomment for subset of output data array
propertyOfIntegratedDatathe physical property of the integrated data
Returns
a data array, which contains the integrated values along the subsets as coordinates

◆ LiftPositive()

static DataArrayBase LiftPositive ( DataArrayBase dataArray,
int[] subsetIndices )
static

Lifts the values of a data array in a way no negative values occur in the real part anymore.

Parameters
dataArrayThe data array which shall be lifted.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The manipulated data array.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ MirrorDataArray1D_Horizontally()

static DataArray1D MirrorDataArray1D_Horizontally ( DataArray1D dataArray,
int[] subsetIndices )
static

Method which performs a horizontal mirror operation on a DataArray1D.

Parameters
dataArrayThe data array to be manipulated.
subsetIndicesOne or more subset indices which shall be manipulated. If none is specified, then all subsets are manipulated.
Returns
Data array with mirrored subset(s).

◆ MirrorDataArray2D_Horizontally()

static DataArray2D MirrorDataArray2D_Horizontally ( DataArray2D dataArray,
int[] subsetIndices )
static

Method which performs a horizontal mirror operation on a DataArray2D.

Parameters
dataArrayThe data array to be manipulated.
subsetIndicesOne or more subset indices which shall be manipulated. If none is specified, then all subsets are manipulated.
Returns
Data array with mirrored subset(s).

◆ MirrorDataArray2D_Vertically()

static DataArray2D MirrorDataArray2D_Vertically ( DataArray2D dataArray,
int[] subsetIndices )
static

Method which performs a vertical mirror operation on a DataArray2D.

Parameters
dataArrayThe data array to be manipulated.
subsetIndicesOne or more subset indices which shall be manipulated. If none is specified, then all subsets are manipulated.
Returns
Data array with mirrored subset(s).

◆ ModifyPhase()

static DataArrayBase ModifyPhase ( DataArrayBase dataArrayBase,
PhaseModifyOperation operation,
double wavelength,
bool useQuantization,
int numberOfLevels,
double doubleParameter,
bool hermitian,
bool superimpose,
int[] subsetIndices )
static

Static method which modifies the phase in various ways.

Parameters
dataArrayBaseThe data array document to manipulate.
operationOperation to be applied to the phase.
wavelengthWavelength to be used in case of lens or spherical phase.
useQuantizationif set to true the random phase is quantized..
numberOfLevelsThe number of quantization levels. Only has an effect if the random phase is quantized.
doubleParameterDouble parameter whose meaning depends on the chosen operation.
hermitianHermitian option (for Random)
superimposeIf true, the old phase will be superimposed with the new one, otherwise it will be replaced.
subsetIndicesOne or more subset indices which shall be manipulated. If none is specified, then all subsets are manipulated.
Returns
Data array with manipulated phase.
Exceptions
ArgumentExceptionOperation is defined for equidistant data only. or Method works for DataArray1D and DataArray2D only.
ExceptionCase not found.

◆ MultiplyConstant_Complex()

static DataArrayBase MultiplyConstant_Complex ( DataArrayBase dataArray,
Complex constant,
int[] subsetIndices )
static

Multiply a constant with certain subsets. The operation will be a complex multiplication.

Parameters
dataArrayThe data array to manipulate.
constantThe complex constant to be used for the operation.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the multiplication.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ MultiplyConstant_Separately()

static DataArrayBase MultiplyConstant_Separately ( DataArrayBase dataArray,
double realPartOrAmplitude,
double imaginaryPartOrPhase,
bool amplitudePhaseRepresentation,
int[] subsetIndices )
static

Multiply a constant with certain subsets. The operation will consist of two independent real valued operations for the complex parts respectively.

Parameters
dataArrayThe data array to manipulate.
realPartOrAmplitudeThe value multiplied to the real part or the amplitude.
imaginaryPartOrPhaseThe value multiplied to the imaginary part or the phase.
amplitudePhaseRepresentationIf set to true amplitude and phase are given. Otherwise real and imaginary part are given.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the multiplication.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ Normalize()

static DataArrayBase Normalize ( DataArrayBase dataArray,
RectangleOfPixels regionMarker = null,
bool elliptical = false,
int[] subsetIndices )
static

Normalizes a data array, i.e. brings the amplitude into the range 0 ... +1 and the real part into the range -1 ... +1.

Parameters
dataArrayThe data array which shall be normalized.
regionMarkerIf this parameter is set only the specified region is taken into account for the calculation of the maximum being the normalization reference. Can be omitted or set to null if the whole data shall be evaluated.
ellipticalShall the normalization reference be an elliptical selection? (Only effective if regionMarker given.)
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The normalized data array.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ PeriodicReplicationOfDataArray()

static DataArrayBase PeriodicReplicationOfDataArray ( DataArrayBase dataArrayBase,
VectorD replicationFactors,
bool keepOriginalInCenter )
static

Method for periodic replication of data arrays.

Parameters
dataArrayBaseData array to be replicated periodically.
replicationFactorsReplication factor in x and y. The y-component will be ignored in case of DataArray1D.
keepOriginalInCenterIf true (and if the considered dimension is equidistant), the original array will be kept in the center.
Returns
Replicated data array.
Exceptions
System.ArgumentExceptionNon-equidistant data arrays with constant interval interpolation may not be replicated if one of the last intervals is infinite. or Method works for DataArray1D and DataArray2D only.

◆ Quantize()

static DataArrayBase Quantize ( DataArrayBase dataArray,
QuantizationType quantizationType,
int noOfAmplitudeLevels,
int noOfPhaseLevels,
double softQuantizationFactor )
static

Does a quantization of all subsets of a data array.

Parameters
dataArrayData array to be quantized.
quantizationTypeType of quantization
noOfAmplitudeLevelsNumber of amplitude levels after quantization.
noOfPhaseLevelsNumber of phase levels after quantization.
softQuantizationFactorThe quantization factor for soft quantization. If a different type is desired, this value will be ignored.
Returns
Quantized data array.
Exceptions
System.ExceptionType of data array is not supported.

◆ RaiseToPowerOfConstant_Complex()

static DataArrayBase RaiseToPowerOfConstant_Complex ( DataArrayBase dataArray,
Complex constant,
int[] subsetIndices )
static

Raise to the power of a constant with certain subsets. The operation will be a complex exponentiation.

Parameters
dataArrayThe data array to manipulate.
constantThe complex constant to be used for the operation.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the exponentiation.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ RaiseToPowerOfConstant_Separately()

static DataArrayBase RaiseToPowerOfConstant_Separately ( DataArrayBase dataArray,
double realPartOrAmplitude,
double imaginaryPartOrPhase,
bool amplitudePhaseRepresentation,
int[] subsetIndices )
static

Raise to the power of a constant with certain subsets. The operation will consist of two independent real valued operations for the complex parts respectively.

Parameters
dataArrayThe data array to manipulate.
realPartOrAmplitudeThe exponent applied on the real part or the amplitude.
imaginaryPartOrPhaseThe exponent applied on the imaginary part or the phase.
amplitudePhaseRepresentationIf set to true amplitude and phase are given. Otherwise real and imaginary part are given.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The result of the exponentiation.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ RemovePhaseDislocationsInsideSelection()

static DataArray2D RemovePhaseDislocationsInsideSelection ( DataArray2D dataArray,
RectangleOfPixels regionMarker,
bool elliptical,
int[] subsetIndices )
static

Static function to remove all phase dislocations within a 2D selection.

Parameters
dataArrayThe data array in whose 2D selection the phase dislocations shall be removed.
regionMarkerIf this optional parameter is set only the specified region is taken into account for the calculation of the maximum being the normalization reference.
ellipticalIs regionMarker to be interpreted as bounding box of an elliptical selection?
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The data array with removed phase dislocations.

◆ RemoveRedundantData()

static DataArray2D RemoveRedundantData ( DataArray2D inputDataArray)
static

Removes redundant data in a two-dimensional non-equidistant data array with Constant Interval interpolation and one subset. First all columns are scanned whether two consecutive columns have the same data. Then the same is done for all rows.

Parameters
inputDataArrayThe input data array.
Returns
New data array with removed data. The original data array if no data was removed.
Exceptions
ArgumentExceptionRemove redundant data only works for non-equidistant data arrays with Constant Interval interpolation and one subset.

◆ RemoveSubsetsFromDataArray() [1/2]

static ChromaticFieldsSetBase RemoveSubsetsFromDataArray ( ChromaticFieldsSetBase cfsBase,
int[] removeIndices )
static

Method that removes subsets from a data array.

Parameters
cfsBaseChromatic fields set to remove subsets from.
removeIndicesThe indices of the subsets to remove.
Returns
A cfs with removed subsets.

◆ RemoveSubsetsFromDataArray() [2/2]

static DataArrayBase RemoveSubsetsFromDataArray ( DataArrayBase dataArrayBase,
int[] removeIndices )
static

Method that removes subsets from a data array.

Parameters
dataArrayBaseData array to remove subsets from.
removeIndicesThe indices of the subsets to remove.
Returns
A data array with removed subsets.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D, DataArray2D, and DataArrayGridLess only.

◆ SavitzkyGolayFilter()

static DataArrayBase SavitzkyGolayFilter ( DataArrayBase dataArray,
int windowSize,
int order )
static

Applies the Savitzky-Golay-Filter on the given data array. This filter is a special low-pass filter, well adapted for data smoothing.

Parameters
dataArrayThe data array.
windowSizeThe window size of the filter (in pixels).
orderThe order of the filter. The smaller the order the smoother the result. The order should be smaller than filter window size, otherwise the algorithm is not correct.
Returns
The filtered data array.
Exceptions
ArgumentExceptionSelected data array is not equidistantly sampled.

◆ ScaleToValueRange()

static DataArrayBase ScaleToValueRange ( DataArrayBase dataArray,
double minimum,
double maximum,
bool cloneDataArray,
int[] subsetIndices )
static

Normalizes a data array, i.e. brings the amplitude into the range 0 ... +1 and the real part into the range -1 ... +1.

Parameters
dataArrayThe data array which shall be normalized.
minimumThe minimum data value in the resulting data array.
maximumThe maximum data value in the resulting data array.
cloneDataArrayIf set to true the data array is cloned. Otherwise the original data array is manipulated which is faster.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The scaled data array.
Exceptions
ArgumentExceptionOperation only supported for real-valued data. or Method does not work for this type of data array.

◆ SetToConstant()

static DataArrayBase SetToConstant ( DataArrayBase dataArray,
Complex constant,
int[] subsetIndices )
static

Set certain subsets to a constant.

Parameters
dataArrayThe data array to manipulate.
constantThe complex constant to be used for the operation.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The data array with the constant value.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ SumOfAllSubsets() [1/2]

static DataArrayBase SumOfAllSubsets ( DataArrayBase dataArrayBase,
bool complexAddition,
ComplexPart partToSumInComplexCase )
static

Method which allows a complex-valued or real-valued summation of all subsets of a data array.

Parameters
dataArrayBaseData array to sum the subsets for.
complexAdditionIf false, the parameter partToSumInComplexCase determines which complex part is to be summed.
partToSumInComplexCaseComplex part to be summed.
Returns
Sum of all subsets.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ SumOfAllSubsets() [2/2]

static DataArrayBase SumOfAllSubsets ( DataArrayBase dataArrayBase,
bool complexAddition,
FieldQuantity fieldQuantityToSum )
static

Method which allows a complex-valued or real-valued summation of all subsets of a data array.

Parameters
dataArrayBaseData array to sum the subsets for.
complexAdditionIf false, the parameter fieldQuantityToSum determines which complex part is to be summed.
fieldQuantityToSumField quantity to be summed.
Returns
Sum of all subsets.
Exceptions
System.ArgumentExceptionMethod works for DataArray1D and DataArray2D only.

◆ TransformCFSFromKDomainIntoSDomain()

static ChromaticFieldsSetBase TransformCFSFromKDomainIntoSDomain ( ChromaticFieldsSetBase cfsInK,
HomogeneousMedium mediumAssociatedWithCFS )
static

public support function to convert a chromatic fields set (given in k-domain) to direction space For the conversion we use the common area of the domains!

Parameters
cfsInKinput field in k-domain
mediumAssociatedWithCFSmedium in which the chromatic fields set exist (necessary for conversion from k to s)
Returns
the data array in s-domain

◆ TransformCFSFromSToAlphaBeta()

static ChromaticFieldsSetBase TransformCFSFromSToAlphaBeta ( ChromaticFieldsSetBase cfsInS)
static

static support function to convert a chromatic fields set from S-domain into alpha beta domain

Parameters
cfsInSthe chromatic fields set which shall be converted
Returns
the chromatic fields set in angle domain

◆ TransposeDataArray2D() [1/2]

static DataArray2D TransposeDataArray2D ( DataArray2D dataArray)
static

Method which transposes a DataArray2D, which swaps all x and y properties.

Parameters
dataArrayData array to be transposed.
Returns
The transposed data array.

◆ TransposeDataArray2D() [2/2]

static DataArrayGridLess TransposeDataArray2D ( DataArrayGridLess dataArray)
static

Method which transposes a DataArrayGridLess, which swaps all x and y properties.

Parameters
dataArrayData array to be transposed.
Returns
DataArrayGridLess with transposed coordinates.
Exceptions
System.ArgumentExceptionThis manipulation works for 2D data only.

◆ UnifiedMergingOfDataArrays()

static DataArrayBase UnifiedMergingOfDataArrays ( DataArrayBase[] dataArrays,
bool cloneArrays )
static

Merges the given data array into one. If all data arrays have the same sampling the subsets are just appended. Else they are interpolated to the common sampling, which can be equidistant or non-equidistant.

Parameters
dataArraysThe data arrays to merge.
cloneArraysIf set to true the arrays are cloned, i.e. the original data arrays remain unchanged. If you created the data arrays just for this method, you can increase performance by setting this parameter to false.
Returns
The merged data arrays.
Exceptions
System.ArgumentExceptionThe physical meanings of the data arrays must be all the same.
System.InvalidOperationExceptionNo merging defined for gridless data arrays

◆ UnwrapPhase()

static DataArrayBase UnwrapPhase ( DataArrayBase dataArray,
int[] subsetIndices )
static

Unwraps the phase, i.e. removes the 2 \(\pi\) jumps.

Parameters
dataArrayThe data array to manipulate.
subsetIndicesOne or more subset indices which shall be evaluated. If none is specified, then all subsets are evaluated.
Returns
The data array with the unwrapped phase.
Exceptions
ArgumentExceptionOperation works for 1D and gridded 2D data arrays only.

Member Data Documentation

◆ newNoOfSamplingPoints

long newNoOfSamplingPoints
static

Method for determining the parameters needed for centering a 1D DA.

Parameters
firstCoordThe first coordinate.
lastCoordThe last coordinate.
samplingDistThe sampling distance.
noOfPointsThe number of sampling points.
Returns
A 3-tuple of the needed parameters: new no. of points, new start point index, additional within-pixel shift for an exact centering.

◆ xCentered

bool xCentered
static

Method for checking whether the coordinates are centered (as needed for FFT) or not.

Parameters
dataArrayData array to check.
Returns
A boolean 2-tuple which tells whether or not x and y are centered.
Exceptions
ArgumentExceptionThrown if the data array is not equidistant.