Class SamplingParameters
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
This class contains parameters for proper sampling of a complex field.
[Serializable]
public class SamplingParameters : SerializableObjectBase, IEquatable<IObjectBase>, ICloneable
- Inheritance
-
ObjectBaseSerializableObjectBaseSamplingParameters
- Implements
-
IEquatable<IObjectBase>
- Inherited Members
Constructors
SamplingParameters()
Default Constructor. Creates a SamplingParameters object with the default number of sampling points (SamplingPoints) and the default sampling distance (SamplingDistance}.
public SamplingParameters()
SamplingParameters(SamplingParameters)
Copy constructor.
public SamplingParameters(SamplingParameters samplingParameters)
Parameters
samplingParametersSamplingParametersSamplingParameters to copy.
SamplingParameters(Vector, VectorD)
Creates a SamplingParameters object with the given sampling points and distance.
public SamplingParameters(Vector SamplingPoints, VectorD SamplingDistance)
Parameters
Fields
samplingPoints
[NI] the number of sampling points in x- and y-direction
protected Vector samplingPoints
Field Value
Properties
Diameter
Calculates the diameter of the sampled area described by the sampling parameters.
This is SamplingPoints * SamplingDistance..
public VectorD Diameter { get; }
Property Value
Dimensionality
Gets the dimensionality (one- or two-dimensional) of the sampling parameters.
public FieldDimensions Dimensionality { get; }
Property Value
- FieldDimensions
NumberOfSamplingPoints
Gets the number of sampling points.
public long NumberOfSamplingPoints { get; }
Property Value
SamplingDistance
Sampling distance for x- and y-axis.
public VectorD SamplingDistance { get; set; }
Property Value
SamplingDistanceX
Sampling distance for the x-axis. If the sampling distance less or equal zero, then the sampling distance is set to Double.Epsilon.
public double SamplingDistanceX { get; set; }
Property Value
SamplingDistanceY
Sampling distance for the y-axis. If the sampling distance less or equal zero, then the sampling distance is set to Double.Epsilon.
public double SamplingDistanceY { get; set; }
Property Value
SamplingPoints
Number of sampling points along x- and y-axis.
public Vector SamplingPoints { get; set; }
Property Value
SamplingPointsX
Number of sampling points along the x-axis. If the number of sampling points is below 1, then 1 sampling point is assumed.
public int SamplingPointsX { get; set; }
Property Value
SamplingPointsY
Number of sampling points along the y-axis. If the number of sampling points is below 1, then 1 sampling point is assumed.
public int SamplingPointsY { get; set; }
Property Value
Methods
Clone()
Creates a new object that is a copy of the current instance.
public override object Clone()
Returns
- object
A new object that is a copy of this instance.
Equals(object, EqualityIntent)
Determines whether the specified object is equal to this instance.
public override bool Equals(object otherObject, EqualityIntent equalityIntent)
Parameters
otherObjectobjectThe object to compare with this instance.
equalityIntentEqualityIntentDefines what kind of equality you want to check when comparing two objects, for example all values or physical equality.
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
GetPositionOfCenter()
To avoid numerical errors, it was defined that the physical position (0 m; 0 m) is always at the center of one sampling point. For odd sampling, the geometrical center of the field is in the center of one sampling point. Thus this method returns (0 m; 0 m) in this case. In contrast, for even sampling the geometrical center is at the border between two sampling points and thus the center of the pixel to the top left of the center has the physical position (0 m; 0 m). Consequently, the geometrical center has the physical coordinate (- sampling distance / 2, - sampling distance / 2).
public VectorD GetPositionOfCenter()
Returns
- VectorD
The physical position of the center of the field (the location exactly half between the lowest and the highest sampling point). x- and y- direction are considered separately.
ToString()
Converts a SamplingParameters object into a string.
public override string ToString()
Returns
- string
String containing the SamplingParameters information.
ToString(PhysicalProperty)
Converts a SamplingParameters object into a string using information about the physical property of sampling distance and diameter.
public string ToString(PhysicalProperty physicalProperty)
Parameters
physicalPropertyPhysicalPropertyPhysical property of sampling distance and diameter.
Returns
- string
String containing the SamplingParameters information.
Operators
operator ==(SamplingParameters, SamplingParameters)
Compares two SamplingParameters objects for equality.
public static bool operator ==(SamplingParameters a, SamplingParameters b)
Parameters
aSamplingParametersFirst sampling parameters.
bSamplingParametersSecond sampling parameters.
Returns
- bool
Whether bot parameters are equal.
operator !=(SamplingParameters, SamplingParameters)
Compares two SamplingParameters objects for inequality.
public static bool operator !=(SamplingParameters a, SamplingParameters b)
Parameters
aSamplingParametersFirst sampling parameters.
bSamplingParametersSecond sampling parameters.
Returns
- bool
Whether bot parameters are unequal.