Skip to main content

Class: RawVectorField<ArrayType, GridType>

Defined in: RawField.ts:605

A class representing a 2D gridded field of vectors

Extends

Type Parameters

Type Parameter
ArrayType extends TypedArray
GridType extends AutoZoomGrid

Constructors

Constructor

new RawVectorField<ArrayType, GridType>(grid, u_ary, v_ary, opts?): RawVectorField<ArrayType, GridType>

Defined in: RawField.ts:616

Create a vector field.

Parameters

ParameterTypeDescription
gridGridTypeThe grid on which the vector components are defined
u_aryArrayTypeThe u (east/west) component of the vectors, which should be given as a 1D array in row-major order, with the first element being at the lower-left corner of the grid
v_aryArrayTypeThe v (north/south) component of the vectors, which should be given as a 1D array in row-major order, with the first element being at the lower-left corner of the grid
opts?RawVectorFieldOptionsOptions for creating the vector field.

Returns

RawVectorField<ArrayType, GridType>

Overrides

ExpressionVectorField.constructor

Properties

PropertyModifierTypeInherited fromDefined in
relative_toreadonlyVectorRelativeToExpressionVectorField.relative_toRawField.ts:442
ureadonlyExpressionScalarField<ArrayType, GridType>ExpressionVectorField.uRawField.ts:440
vreadonlyExpressionScalarField<ArrayType, GridType>ExpressionVectorField.vRawField.ts:441

Methods

add()

add(other): ComputedVectorField<ArrayType, GridType>

Defined in: RawField.ts:503

Add this vector field to another vector field. The addition occurs on the GPU if the resulting field is used in a plot component.

Parameters

ParameterTypeDescription
otherExpressionVectorField<ArrayType, GridType>Vector field to add.

Returns

ComputedVectorField<ArrayType, GridType>

A ComputedVectorField representing the added vector field

Inherited from

ExpressionVectorField.add


divide()

divide(other): ComputedVectorField<ArrayType, GridType>

Defined in: RawField.ts:494

Divide this vector field by a scalar. The division occurs on the GPU if the resulting field is used in a plot component.

Parameters

ParameterTypeDescription
othernumber | ExpressionScalarField<ArrayType, GridType>Scalar to divide by. Can be either a number or a scalar field.

Returns

ComputedVectorField<ArrayType, GridType>

A ComputedVectorField representing the divided vector field

Inherited from

ExpressionVectorField.divide


magnitude()

magnitude(): ComputedScalarField<ArrayType, GridType>

Defined in: RawField.ts:540

Get the magnitude of the vector field as a scalar field. The magnitude calculation occurs on the GPU if this field is used in a plot component.

Returns

ComputedScalarField<ArrayType, GridType>

A ComputedScalarField representing the subtracted vector field

Inherited from

ExpressionVectorField.magnitude


multiply()

multiply(other): ComputedVectorField<ArrayType, GridType>

Defined in: RawField.ts:485

Multiply this vector field by a scalar. The multiplication occurs on the GPU if the resulting field is used in a plot component.

Parameters

ParameterTypeDescription
othernumber | ExpressionScalarField<ArrayType, GridType>Scalar to multiply by. Can be either a number or a scalar field.

Returns

ComputedVectorField<ArrayType, GridType>

A ComputedVectorField representing the multiplied vector field

Inherited from

ExpressionVectorField.multiply


sampleField()

sampleField(lon, lat): [number, number]

Defined in: RawField.ts:564

Sample this field at a given latitude and longitude.

Parameters

ParameterTypeDescription
lonnumberLongitude of the sample in degrees east
latnumberLatitude of the sample in degrees north

Returns

[number, number]

A tuple containing the [bearing, magnitude] of the vector field at the nearest grid point. The bearing is given as degrees from north, increasing clockwise. If the point is outside the grid, it returns [NaN, NaN] instead.

Inherited from

ExpressionVectorField.sampleField


subtract()

subtract(other): ComputedVectorField<ArrayType, GridType>

Defined in: RawField.ts:512

Subtract another vector field from this vector field. The subtraction occurs on the GPU if the resulting field is used in a plot component.

Parameters

ParameterTypeDescription
otherExpressionVectorField<ArrayType, GridType>Vector field to subtract.

Returns

ComputedVectorField<ArrayType, GridType>

A ComputedVectorField representing the subtracted vector field

Inherited from

ExpressionVectorField.subtract