Programming Reference for VirtualLab Fusion  2022.1
Static Public Member Functions | List of all members
ComplexAmplitudeOperations Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Contains different operators for the manipulation of ComplexAmplitude. More...

Static Public Member Functions

static ComplexAmplitude CoherentAddition (ComplexAmplitude[] fields)
 Coherent addition of multiple fields. More...
 
static ComplexAmplitude Combine (ComplexAmplitude caX, ComplexAmplitude caY)
 Combines two one-dimensional ComplexAmplitudes into a two-dimensional one. \(P(x,y)=f_x(x) * f_y(y)\). The more exact precision of both one-dimensional ComplexFields is used for the two-dimensional ComplexField. Is one of the one-dimensional ComplexField is complex then the resulting ComplexField is complex else it is real. More...
 
static bool ComputeDeviation (ComplexAmplitude caArg, ComplexAmplitude caReference, bool applyComplexScalingFactor, out double relativeDeviation, out double absoluteDeviation, out Complex scalingFactor, InterpolationMethod interpolationMethod=InterpolationMethod.SincFFT)
 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. More...
 
static ComplexAmplitude CreateRotationallySymmetricFieldFromCrossSection (ComplexAmplitude crossSection, SamplingParameters resultSampling, InterpolationMethod interpolationMethod=InterpolationMethod.Linear_AmplitudeAndPhase)
 Creates a rotationally symmetric field from a one-dimensional cross section. More...
 
static DataArrayBase FieldDeviation (ComplexAmplitude firstCA, ComplexAmplitude secondCA)
 Help method to compare amplitude and phase of two harmonic fields. The results are stored into distinct subsets of a data array. More...
 
static void Separate (ComplexAmplitude ca, out ComplexAmplitude xField, out ComplexAmplitude yField)
 Separates a globally and 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. More...
 
static DataArray2D ToAngularCoordinates (ComplexAmplitude inputField, CoordinateDefinitionType coordinateType, VectorialComponent[] vectorialComponents, double oversamplingFactorAngle1, double oversamplingFactorAngle2)
 Resamples a given Harmonic Field to angular coordinates. More...
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Contains different operators for the manipulation of ComplexAmplitude.

Member Function Documentation

◆ CoherentAddition()

static ComplexAmplitude CoherentAddition ( ComplexAmplitude[]  fields)
static

Coherent addition of multiple fields.

Parameters
fieldsThe fields to sum up.
Returns
The summed fields. For the result, wavelength, Jones vector etc. are taken from the first field.
Exceptions
ArgumentExceptionAt 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()

static ComplexAmplitude Combine ( ComplexAmplitude  caX,
ComplexAmplitude  caY 
)
static

Combines two one-dimensional ComplexAmplitudes into a two-dimensional one. \(P(x,y)=f_x(x) * f_y(y)\). The more exact precision of both one-dimensional ComplexFields is used for the two-dimensional ComplexField. Is one of the one-dimensional ComplexField is complex then the resulting ComplexField is complex else it is real.

Parameters
caXOne-dimensional X field.
caYOne-dimensional Y field.
Returns
Resulting complex amplitude, which is only globally polarized if both input fields have the same Jones vector.

◆ ComputeDeviation()

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

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.

Parameters
caArgArgument field that is to be compared to the reference. Polarization may be arbitrary.
caReferenceReference field. Polarization may be arbitrary.
applyComplexScalingFactorIf true, a optimal complex scaling factor is computed to scale the argument field prior to computing the deviation.
relativeDeviationRelative deviation that is being computed.
absoluteDeviationAbsolute deviation that is being computed.
scalingFactorScaling factor that is being used.
interpolationMethodThe used interpolation method.
Returns
true iff successful computation

◆ CreateRotationallySymmetricFieldFromCrossSection()

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

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

Parameters
crossSectionThe cross section. It is assumed that the radius r = 0 is exactly at pixel 0.
resultSamplingThe sampling the resulting field shall have.
interpolationMethodThe 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
A rotationally symmetric field created from the cross section.
Exceptions
System.ArgumentExceptionThe cross section must be one-dimensional, i.e. it must contain only one sampling point in y-direction.

◆ FieldDeviation()

static DataArrayBase FieldDeviation ( ComplexAmplitude  firstCA,
ComplexAmplitude  secondCA 
)
static

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

Parameters
firstCAThe first harmonic field to compare.
secondCAThe second harmonic field to compare.
Returns
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
OperationNotSupportedExceptionOperation between 1d and 2d or 1d-x and 1d-y arrays is not defined.

◆ Separate()

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

Separates a globally and 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.

Parameters
caComplexAmplitude to be separated.
xFieldSeparated x-field.
yFieldSeparated y-field.

◆ ToAngularCoordinates()

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

Resamples a given Harmonic Field to angular coordinates.

Parameters
inputFieldThe field2convert.
coordinateTypeType of the coordinate.
vectorialComponentsThe vectorial components.
oversamplingFactorAngle1The oversampling factor for either the Cartesian angle α or the spherical angle φ.
oversamplingFactorAngle2The oversampling factor for either the Cartesian angle β or the spherical angle ϑ.
Returns
The field in angular coordinates as Data Array.
Exceptions
System.ArgumentExceptionNo valid data given. or Conversion supports 2-dimensional data only. or Resulting sampling distances are numerically equal to zero.
System.NotImplementedExceptionCase missing.