Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
ComplexAmplitudeInterpolation Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class contains static member functions for interpolating a complex amplitude to another sampling grid. More...

Static Public Member Functions

static SamplingParameters CalculateSamplingParametersForCoordinateTransformation (Matrix2x2D trafoMatrix, SamplingParameters oldSamplingParameters)
 Method for calculating sampling parameters for a field which will undergo a 2D coordinate transformation.
 
static ComplexAmplitude DiscreteOversampling (ComplexAmplitude ca, Vector factor)
 Inserts zero points between sampling points.

 
static ComplexAmplitude Interpolation (ComplexAmplitude ca, SamplingParameters samplingParameters, VectorD zeroPoint, InterpolationMethod interpolationMethod, CancellationToken? cancellationToken=null)
 Interpolates a ComplexAmplitude using the specified interpolation method. It is possible to interpolate a not centered part of the ComplexAmplitude using the zeroPoint parameter.
 
static ComplexAmplitude ProfileExtractionCoordsPhysical (ComplexAmplitude ca, VectorD startPointPhys, VectorD endPointPhys, int samplingPoints, InterpolationMethod interpolationMethod, bool removeSphericalPhase)
 Extracts a one-dimensional profile from a two-dimensional ComplexAmplitude. There are different interpolation methods supported.
 
static ComplexAmplitude Rotation2D (ComplexAmplitude ca, Vector newSamplingPoints, double phi, InterpolationMethod interpolationMethod)
 Rotates a ComplexAmplitude in the x-y-plane by angle \(\phi\). The rotation is calculated using the specified interpolation method.
 
static void SampleAllAnalyticFunctionsAtField (ref ComplexAmplitude ca, InterpolationMethod interpolationMethod, CancellationToken cancellationToken)
 Method that samples the lateral offset (via embedding, i.e. zero padding) which is stored at a field as well as its quadratic and linear phase function.
 
static void SampleLateralOffsetFromAnalyticValuesAtField (ref ComplexAmplitude ca, bool sampleOtherAnalyticFunctionsToo, CancellationToken cancellationToken, InterpolationMethod interpMethod=InterpolationMethod.SincFFT)
 Method that samples (via embedding, i.e. zero padding) the lateral offset stored at a given field.
 
static void SampleLinearPhaseFromAnalyticFunctionAtField (ref ComplexAmplitude ca, InterpolationMethod interpolationMethod, CancellationToken cancellationToken)
 Samples the linear phase function stored at a field and multiplies function and field values.
 
static void SampleLinearPhaseFromDirectionVector (ref ComplexAmplitude ca, InterpolationMethod interpolationMethod)
 Samples the linear phase function stored at a field and multiplies function and field values.
 
static void SampleQuadraticPhaseFromAnalyticFunctionAtField (ref ComplexAmplitude ca, InterpolationMethod interpolationMethod, bool enableAnalyticalLinearPhaseResultingFromOffset, CancellationToken cancellationToken, LightPathProcessingLogger logger=null, long maximumNumberPixels=-1)
 Samples a quadratic phase from a given quadratic function and multiplies it with the given ComplexAmplitude.
 
static ComplexAmplitude SampleSphericalPhaseFactor (ComplexAmplitude ca)
 ComplexAmplitude can contain a separate spherical phase factor. Thus the phase of the sampled complex amplitude can be undersampled. This function resamples the complex amplitude in a way that complies to Nyquist criterion and separate spherical phase is no longer needed.
 
static HarmonicFieldBase SampleSphericalPhaseFactor (HarmonicFieldBase field)
 A Harmonic Field can contain a separate spherical phase factor. Thus the phase of the sampled complex amplitude can be undersampled. This function resamples the harmonic field in a way that complies to Nyquist criterion and separate spherical phase factor is no longer needed.
 
static HarmonicFieldsSet SampleSphericalPhaseFactor (HarmonicFieldsSet hfs)
 The member fields of a HarmonicFieldsSet can contain a separate spherical phase factor. Thus the phase of the sampled complex amplitude can be undersampled. This function resamples the complex amplitude in a way that complies to Nyquist criterion and separate spherical phase is no longer needed.
 
static ComplexAmplitude TryToDecreaseSamplingEffort (ComplexAmplitude caIn, bool truncateFieldSize, double minimumOversamplingFactor, double truncationInflationFactor, double powerPortionForEvaluation, CancellationToken cancellationToken)
 Method which tries to decrease the sampling effort for a ComplexAmplitude.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class contains static member functions for interpolating a complex amplitude to another sampling grid.

Member Function Documentation

◆ CalculateSamplingParametersForCoordinateTransformation()

static SamplingParameters CalculateSamplingParametersForCoordinateTransformation ( Matrix2x2D  trafoMatrix,
SamplingParameters  oldSamplingParameters 
)
static

Method for calculating sampling parameters for a field which will undergo a 2D coordinate transformation.

Parameters
trafoMatrixThe matrix which describes the transform.
oldSamplingParametersOld sampling parameters of the field to be transformed.
Returns
The new sampling parameters after the transform.

◆ DiscreteOversampling()

static ComplexAmplitude DiscreteOversampling ( ComplexAmplitude  ca,
Vector  factor 
)
static

Inserts zero points between sampling points.

Parameters
caComplexAmplitude operation is applied to.
factorE.g.: Factor two means, that every second sampling point is zero.
Returns
Result of operation.

◆ Interpolation()

static ComplexAmplitude Interpolation ( ComplexAmplitude  ca,
SamplingParameters  samplingParameters,
VectorD  zeroPoint,
InterpolationMethod  interpolationMethod,
CancellationToken?  cancellationToken = null 
)
static

Interpolates a ComplexAmplitude using the specified interpolation method. It is possible to interpolate a not centered part of the ComplexAmplitude using the zeroPoint parameter.

Parameters
caComplexAmplitude to interpolate.
samplingParametersContains the new number of sampling points and the sampling distance of the ComplexAmplitude after interpolation.
zeroPointThe zero point parameter specifies the position of the center of the ComplexAmplitude after interpolation.
interpolationMethodInterpolation Method.
cancellationTokenOptional token for cooperative task cancellation.
Returns
Result of operation.

◆ ProfileExtractionCoordsPhysical()

static ComplexAmplitude ProfileExtractionCoordsPhysical ( ComplexAmplitude  ca,
VectorD  startPointPhys,
VectorD  endPointPhys,
int  samplingPoints,
InterpolationMethod  interpolationMethod,
bool  removeSphericalPhase 
)
static

Extracts a one-dimensional profile from a two-dimensional ComplexAmplitude. There are different interpolation methods supported.

Parameters
caComplexAmplitude to extract a profile from.
startPointPhysStart point of the one-dimensional profile in physical coordinates.
endPointPhysEnd point of the one-dimensional profile in physical coordinates.
samplingPointsNumber of sampling points of the profile including the start and the end point. So the minimum number is 2.
interpolationMethodInterpolation method for extraction.
removeSphericalPhaseAdditional spherical phase is removed from profile line.
Returns
Result of operation.

◆ Rotation2D()

static ComplexAmplitude Rotation2D ( ComplexAmplitude  ca,
Vector  newSamplingPoints,
double  phi,
InterpolationMethod  interpolationMethod 
)
static

Rotates a ComplexAmplitude in the x-y-plane by angle \(\phi\). The rotation is calculated using the specified interpolation method.

Parameters
caComplexAmplitude to rotate.
newSamplingPointsThe number of sampling points the rotated field shall have.
phiRotation angle in radians.
interpolationMethodSpecifies with which algorithm the point interpolation is done.
Returns
Result of operation.

◆ SampleAllAnalyticFunctionsAtField()

static void SampleAllAnalyticFunctionsAtField ( ref ComplexAmplitude  ca,
InterpolationMethod  interpolationMethod,
CancellationToken  cancellationToken 
)
static

Method that samples the lateral offset (via embedding, i.e. zero padding) which is stored at a field as well as its quadratic and linear phase function.

Parameters
caHarmonic field whose analytic function parameters shall be sampled.
interpolationMethodInterpolation method to be used for sampling the quadratic and the linear phase function.
cancellationTokenThe token for cooperative task cancellation.

◆ SampleLateralOffsetFromAnalyticValuesAtField()

static void SampleLateralOffsetFromAnalyticValuesAtField ( ref ComplexAmplitude  ca,
bool  sampleOtherAnalyticFunctionsToo,
CancellationToken  cancellationToken,
InterpolationMethod  interpMethod = InterpolationMethod::SincFFT 
)
static

Method that samples (via embedding, i.e. zero padding) the lateral offset stored at a given field.

Parameters
caField whose offset shall be sampled.
sampleOtherAnalyticFunctionsTooIf true, the sampling of quadratic and linear phase functions will be ensured.
cancellationTokenThe token for cooperative task cancellation.
interpMethodIn case the parameter sampleOtherAnalyticFunctionsToo is true, the interpolation method for the sampling can be set here.

◆ SampleLinearPhaseFromAnalyticFunctionAtField()

static void SampleLinearPhaseFromAnalyticFunctionAtField ( ref ComplexAmplitude  ca,
InterpolationMethod  interpolationMethod,
CancellationToken  cancellationToken 
)
static

Samples the linear phase function stored at a field and multiplies function and field values.

Parameters
caComplexAmplitude to sample the linear phase on. Since this is a ref parameter, it will be modified by the function.
interpolationMethodMethod of interpolation if necessary
cancellationTokenThe token for cooperative task cancellation.

◆ SampleLinearPhaseFromDirectionVector()

static void SampleLinearPhaseFromDirectionVector ( ref ComplexAmplitude  ca,
InterpolationMethod  interpolationMethod 
)
static

Samples the linear phase function stored at a field and multiplies function and field values.

Parameters
caComplexAmplitude to sample the linear phase on. Since this is a ref parameter, it will be modified by the function.
interpolationMethodMethod of interpolation if necessary

◆ SampleQuadraticPhaseFromAnalyticFunctionAtField()

static void SampleQuadraticPhaseFromAnalyticFunctionAtField ( ref ComplexAmplitude  ca,
InterpolationMethod  interpolationMethod,
bool  enableAnalyticalLinearPhaseResultingFromOffset,
CancellationToken  cancellationToken,
LightPathProcessingLogger  logger = null,
long  maximumNumberPixels = -1 
)
static

Samples a quadratic phase from a given quadratic function and multiplies it with the given ComplexAmplitude.

Parameters
caComplexAmplitude to sample the quadratic phase on. Since this is a ref parameter, it will be modified by the function.
interpolationMethodMethod of interpolation if necessary
enableAnalyticalLinearPhaseResultingFromOffsetIf true, the result may contain an additional analytical linear phase, which results from the quadratic phase if there is a lateral offset.
cancellationTokenThe token for cooperative task cancellation.
loggerThe process logger.
maximumNumberPixelsmaximum number of pixels to use

◆ SampleSphericalPhaseFactor() [1/3]

static ComplexAmplitude SampleSphericalPhaseFactor ( ComplexAmplitude  ca)
static

ComplexAmplitude can contain a separate spherical phase factor. Thus the phase of the sampled complex amplitude can be undersampled. This function resamples the complex amplitude in a way that complies to Nyquist criterion and separate spherical phase is no longer needed.

Parameters
caComplexAmplitude to sample the spherical phase for.
Returns
Result of operation.

◆ SampleSphericalPhaseFactor() [2/3]

static HarmonicFieldBase SampleSphericalPhaseFactor ( HarmonicFieldBase  field)
static

A Harmonic Field can contain a separate spherical phase factor. Thus the phase of the sampled complex amplitude can be undersampled. This function resamples the harmonic field in a way that complies to Nyquist criterion and separate spherical phase factor is no longer needed.

Parameters
fieldComplexAmplitude to sample the spherical phase for.
Returns
Result of operation.

◆ SampleSphericalPhaseFactor() [3/3]

static HarmonicFieldsSet SampleSphericalPhaseFactor ( HarmonicFieldsSet  hfs)
static

The member fields of a HarmonicFieldsSet can contain a separate spherical phase factor. Thus the phase of the sampled complex amplitude can be undersampled. This function resamples the complex amplitude in a way that complies to Nyquist criterion and separate spherical phase is no longer needed.

Parameters
hfsThe HarmonicFieldsSet whose member fields shall be resampled according to the spherical phase factor.
Returns
Result of operation. Null if the sampling warning was shown and the user decided to not create such a large field.

◆ TryToDecreaseSamplingEffort()

static ComplexAmplitude TryToDecreaseSamplingEffort ( ComplexAmplitude  caIn,
bool  truncateFieldSize,
double  minimumOversamplingFactor,
double  truncationInflationFactor,
double  powerPortionForEvaluation,
CancellationToken  cancellationToken 
)
static

Method which tries to decrease the sampling effort for a ComplexAmplitude.

Parameters
caInComplexAmplitude whose sampling shall be optimized.
truncateFieldSizeIf true, a truncation of the field is tried.
minimumOversamplingFactorMinimum oversampling factor, independent of the factor given in Globals. The larger value of both will be used.
truncationInflationFactorIf the truncation flag is true, this factor will be applied to the minimum detected field size.
powerPortionForEvaluationthe power portion that shall be used for evaluation in case of truncation. If truncateFieldSize is false, this parameter will be ignored.
cancellationTokenToken for cooperative task cancellation.
Returns
A ComplexAmplitude which uses less sampling than the input if possible.