Table of Contents

Class ComplexAmplitudeOperations

Namespace
VirtualLabAPI.Core.FieldRepresentations
Assembly
VirtualLabAPI.dll

Contains different operators for the manipulation of a ComplexAmplitude.

public static class ComplexAmplitudeOperations
Inheritance
ComplexAmplitudeOperations
Inherited Members

Methods

CoherentAddition(params ComplexAmplitude[])

Coherent addition of multiple fields.

public static ComplexAmplitude CoherentAddition(params ComplexAmplitude[] fields)

Parameters

fields ComplexAmplitude[]

The fields to sum up.

Returns

ComplexAmplitude

The summed fields. For the result, wavelength, Jones vector etc. are taken from the first field.

Exceptions

ArgumentException

At least two fields must be given for coherent addition. or All fields must be of type “Globally Polarized Harmonic Field” or “Angular Spectrum of Harmonic Field (Globally Polarized)”.

Combine(ComplexAmplitude, ComplexAmplitude)

Combines two one-dimensional ComplexAmplitudes into a two-dimensional one. \(P(x,y)=f_x(x) * f_y(y)\). If one of the one-dimensional ComplexField is complex then the resulting ComplexField is complex, else it is real.

public static ComplexAmplitude Combine(ComplexAmplitude caX, ComplexAmplitude caY)

Parameters

caX ComplexAmplitude

One-dimensional X field.

caY ComplexAmplitude

One-dimensional Y field.

Returns

ComplexAmplitude

Resulting complex amplitude, which is only globally polarized if both input fields have the same Jones vector.

ComputeDeviation(ComplexAmplitude, ComplexAmplitude, bool, out double, out double, out Complex, InterpolationMethod)

Compute the absolute and relative deviation between two fields. The deviation between two harmonic fields is defined as the integral of the squared amplitudes of the difference field. The reference field prescribes the reference sampling and the reference medium for resampling. All four polarization combinations of both fields are allowed.

public static bool ComputeDeviation(ComplexAmplitude caArg, ComplexAmplitude caReference, bool applyComplexScalingFactor, out double relativeDeviation, out double absoluteDeviation, out Complex scalingFactor, InterpolationMethod interpolationMethod = InterpolationMethod.SincFFT)

Parameters

caArg ComplexAmplitude

Argument field that is to be compared to the reference. Polarization may be arbitrary.

caReference ComplexAmplitude

Reference field. Polarization may be arbitrary.

applyComplexScalingFactor bool

If true, a optimal complex scaling factor is computed to scale the argument field prior to computing the deviation.

relativeDeviation double

Relative deviation that is being computed.

absoluteDeviation double

Absolute deviation that is being computed.

scalingFactor Complex

Scaling factor that is being used.

interpolationMethod InterpolationMethod

The used interpolation method.

Returns

bool

true iff computation was successful.

CreateRotationallySymmetricFieldFromCrossSection(ComplexAmplitude, SamplingParameters, InterpolationMethod)

Creates a rotationally symmetric field from a one-dimensional cross section.

public static ComplexAmplitude CreateRotationallySymmetricFieldFromCrossSection(ComplexAmplitude crossSection, SamplingParameters resultSampling, InterpolationMethod interpolationMethod = InterpolationMethod.Linear_AmplitudeAndPhase)

Parameters

crossSection ComplexAmplitude

The cross section. It is assumed that the radius r = 0 is exactly at pixel 0.

resultSampling SamplingParameters

The sampling the resulting field shall have.

interpolationMethod InterpolationMethod

The interpolation method to be used to interpolate between values for different radii. If this optional parameter is not specified, linear interpolation is used, which is suitable for transmissions and very fast.

Returns

ComplexAmplitude

A rotationally symmetric field created from the cross section.

Exceptions

ArgumentException

The cross section must be one-dimensional, i.e. it must contain only one sampling point in y-direction.

EvaluationRegionFromField(ComplexAmplitude, bool)

Generates an Evaluation Region / Optimization Region from the given field.

public static IRegion1D2D EvaluationRegionFromField(ComplexAmplitude field, bool evaluateEy = false)

Parameters

field ComplexAmplitude

The field from which a Evaluation Region shall be generated.

evaluateEy bool

If set to true the Ey component is evaluated for locally polarized fields. Otherwise the Ex component is evaluated for locally polarized fields.

Returns

IRegion1D2D

A ComplexAmplitude object with the Evaluation Region. Returns null if the field is null.

FieldDeviation(ComplexAmplitude, ComplexAmplitude)

Help method to compare amplitude and phase of two harmonic fields. The results are stored into distinct subsets of a data array.

public static DataArrayBase FieldDeviation(ComplexAmplitude firstCA, ComplexAmplitude secondCA)

Parameters

firstCA ComplexAmplitude

The first harmonic field to compare.

secondCA ComplexAmplitude

The second harmonic field to compare.

Returns

DataArrayBase

A data arrays with one subset storing the amplitude differences and one storing the phase differences. If any of the two fields is locally polarized, results for Ex and Ey are returned (in total 4 subsets).

Exceptions

OperationNotSupportedException

Operation between 1d and 2d or 1d-x and 1d-y arrays is not defined.

FilterNoise(ComplexAmplitude, double)

Filters out numerical noise in the given harmonic field. This means that each pixel having an intensity below \(t \cdot I_{\text{max}}\) is set to zero. \(t\) is the give noise limit and \(I_{\text{max}}\) is the maximum intensity in the harmonic field. If the field is a locally polarized one, the filtering is done separately for the Ex and the Ey component, respectively.

public static ComplexAmplitude FilterNoise(ComplexAmplitude ca, double noiseLimit)

Parameters

ca ComplexAmplitude

The harmonic field to filter.

noiseLimit double

The noise limit \(t\).

Returns

ComplexAmplitude

The filter harmonic field.

RemoveSampledLinearPhase(ComplexAmplitude, Vector3D, VectorD)

Method that removes a linear phase from the sampled complex values of one harmonic field

public static ComplexAmplitude RemoveSampledLinearPhase(ComplexAmplitude ca, Vector3D centralDirectionVector, VectorD referencePointForCentralDirection = default)

Parameters

ca ComplexAmplitude

Harmonic field to remove the linear phase from

centralDirectionVector Vector3D

Direction vector that describes the linear phase

referencePointForCentralDirection VectorD

The reference point for the central direction.

Returns

ComplexAmplitude

Harmonic field, reduced by the given linear phase.

Exceptions

ArgumentException

Information about the sign of k_z is inconsistent.

Separate(ComplexAmplitude, out ComplexAmplitude, out ComplexAmplitude)

Separates a globally or locally polarized two-dimensional ComplexAmplitude P(x,y) and returns the x-component \(f_x(x)\) and the y-component \(f_y(y)\) as separated fields. If the field is separable, \(P(x,y)=f_x(x) * f_y(y)\) applies. The separation is done by integrating of all rows and columns.
Note: This function does not check whether input field is separable.

public static void Separate(ComplexAmplitude ca, out ComplexAmplitude xField, out ComplexAmplitude yField)

Parameters

ca ComplexAmplitude

ComplexAmplitude to be separated.

xField ComplexAmplitude

Separated x-field.

yField ComplexAmplitude

Separated y-field.

ToAngularCoordinates(ComplexAmplitude, CoordinateDefinitionType, VectorialComponent[], double, double)

Resamples a given Harmonic Field to angular coordinates.

public static DataArray2D ToAngularCoordinates(ComplexAmplitude inputField, CoordinateDefinitionType coordinateType, VectorialComponent[] vectorialComponents, double oversamplingFactorAngle1, double oversamplingFactorAngle2)

Parameters

inputField ComplexAmplitude

The field2convert.

coordinateType CoordinateDefinitionType

Type of the coordinate.

vectorialComponents VectorialComponent[]

The vectorial components.

oversamplingFactorAngle1 double

The oversampling factor for either the Cartesian angle α or the spherical angle φ.

oversamplingFactorAngle2 double

The oversampling factor for either the Cartesian angle β or the spherical angle ϑ.

Returns

DataArray2D

The field in angular coordinates as Data Array.

Exceptions

ArgumentException

No valid data given. or Conversion supports 2-dimensional data only. or Resulting sampling distances are numerically equal to zero.

NotImplementedException

Case missing.