Table of Contents

Class ComplexFieldDerivative1D

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

Class derived from ComplexField, designed especially for one-dimensional data.

[Serializable]
public class ComplexFieldDerivative1D : ComplexField, ILargeArray<Complex>, ICloneable, IDisposable
Inheritance
ComplexFieldDerivative1D
Implements
Derived
Inherited Members

Constructors

ComplexFieldDerivative1D()

Creates a ComplexFieldDerivative1D with 1 sampling point. The internal data presentation is complex.

public ComplexFieldDerivative1D()

ComplexFieldDerivative1D(int)

Creates a ComplexFieldDerivative1D with given number of sampling points. The internal data representation is complex.

public ComplexFieldDerivative1D(int samplingPoints)

Parameters

samplingPoints int

Number of points.

ComplexFieldDerivative1D(int, bool, Complex)

Creates a ComplexFieldDerivative1D with given number of sampling points. The internal data representation can be complex or real. The field will be filled with a given constant value. In case of a real valued complex field only the real part of constant value is stored.

public ComplexFieldDerivative1D(int samplingPoints, bool isComplex, Complex c)

Parameters

samplingPoints int

Number of values.

isComplex bool

Indicates, whether the new ComplexFieldDerivative1D should internally store real + imaginary part (true) or the real part only (false), where the imaginary part is zero.

c Complex

Complex number to initialize the field with.

ComplexFieldDerivative1D(int, bool, PrecisionMode)

Creates a ComplexFieldDerivative1D with given number of sampling points. The internal data representation can be complex or real.

public ComplexFieldDerivative1D(int samplingPoints, bool isComplex, PrecisionMode precision = PrecisionMode.Double)

Parameters

samplingPoints int

Number of values.

isComplex bool

Indicates, whether the new ComplexFieldDerivative1D should internally store real + imaginary part (true) or the real part only (false), whereas the imaginary part is zero.

precision PrecisionMode

Optional and obsolete parameter. Should not be used.

ComplexFieldDerivative1D(ComplexField)

Constructor that gets an object of type ComplexField.

public ComplexFieldDerivative1D(ComplexField cf)

Parameters

cf ComplexField

ComplexField to be converted

ComplexFieldDerivative1D(ComplexFieldDerivative1D)

Copy constructor.

public ComplexFieldDerivative1D(ComplexFieldDerivative1D cfd)

Parameters

cfd ComplexFieldDerivative1D

Field to copy.

Properties

IsOneD

Overrides a property in base class ComplexField. This will return always true for objects of type ComplexFieldDerivative1D.

public override bool IsOneD { get; }

Property Value

bool

this[int]

Indexer to access complex values of complex field. Property performs a range checking before every access. If you try to read a complex value and index is out of range Complex(0) is returned. If you try to set a complex value and index is out of range nothing will happen. If IsComplex is false only the real part is stored.

public Complex this[int x] { get; set; }

Parameters

x int

Index for x-coordinate

Property Value

Complex

this[int, int]

Overridden 2D indexer. Uses 1D indexer, ignoring y!

public override Complex this[int x, int y] { get; set; }

Parameters

x int

Index for x-coordinate.

y int

Index for y-coordinate.

Property Value

Complex

The value at the given index.

this[long, FieldQuantity, double, double]

Special indexer which checks for phase artifacts and returns a certain field quantity.

public double this[long x, FieldQuantity quantity, double thresholdForPhaseArtifacts, double maxAmplitude] { get; }

Parameters

x long

Index to extract.

quantity FieldQuantity

Field quantity to extract.

thresholdForPhaseArtifacts double

Relative threshold to be used for suppressing phase artifacts.

maxAmplitude double

Maximum amplitude of the field for calculating an absolute threshold from the relative one.

Property Value

double

Real valued extracted field quantity of the complex value at index x.

SamplingPoints

Gets or sets the number of sampling points. Setting a new number of sampling points will embed the sampling points in zero samples or extract the central sampling points. See also EmbedExtract(Rectangle).

public override Vector SamplingPoints { get; set; }

Property Value

Vector

Methods

Clone()

Clones this ComplexFieldDerivative1D.

public override object Clone()

Returns

object

The cloned object.

ConvertTo1DDoubleArray(out double[], out double[])

Public support method to convert the complex field into two double arrays (real and imaginary part will be output separately).

public void ConvertTo1DDoubleArray(out double[] doubleArrayReal, out double[] doubleArrayImaginary)

Parameters

doubleArrayReal double[]

The double array storing the real part.

doubleArrayImaginary double[]

The double array storing the imaginary part (remark: if the underlying complex field is real valued, this data array will contain only zeros.

EmbedExtract()

Embeds the currentComplexFieldDerivative1D into double side-length field of zero sampling points and places the original in the middle of the new field.

public override void EmbedExtract()

EmbedExtract(Rectangle)

Extract a region of the current ComplexFieldDerivative1D including the left corner but excluding the right corner. Note that "new Rectangle(Vector, Vector)" works due to implicit casts.

public override ComplexField EmbedExtract(Rectangle rectangle)

Parameters

rectangle Rectangle

Region to extract.

Returns

ComplexField

Result of Operation.

EmbedExtract(Vector)

Embeds the current ComplexFieldDerivative1D into field of passed size of zero sampling points and places the original in the middle of the new field. By decreasing size, field can be extracted.

public override void EmbedExtract(Vector newSize)

Parameters

newSize Vector

New size in pixel. The y value will be ignored and considered to be 1.