autumnplot-gl

Hardware-accelerated geospatial data plotting in the browser


Project maintained by tsupinie Hosted on GitHub Pages — Theme by mattgraham

autumnplot-glDocs


autumnplot-gl / RawScalarField

Class: RawScalarField<ArrayType>

A class representing a raw 2D field of gridded data, such as height or u wind.

Type parameters

ArrayType extends TypedArray

Constructors

new RawScalarField()

new RawScalarField<ArrayType>(grid, data): RawScalarField<ArrayType>

Create a data field.

Parameters

grid: Grid

The grid on which the data are defined

data: ArrayType

The data, 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.

Returns

RawScalarField<ArrayType>

Source

RawField.ts:26

Properties

data

readonly data: ArrayType

Source

RawField.ts:17


grid

readonly grid: Grid

Source

RawField.ts:16

Methods

getContours()

getContours(opts): Promise<ContourData>

Parameters

opts: FieldContourOpts

Returns

Promise<ContourData>

Source

RawField.ts:54


aggregateFields()

static aggregateFields<ArrayType>(func, …args): RawScalarField<ArrayType>

Create a new field by aggregating a number of fields using a specific function

Type parameters

ArrayType extends TypedArray

Parameters

func

A function that will be applied each element of the field. It should take the same number of arguments as fields you have and return a single number.

• …args: RawScalarField<ArrayType>[]

The RawScalarFields to aggregate

Returns

RawScalarField<ArrayType>

a new gridded field

Example

// Compute wind speed from u and v
wind_speed_field = RawScalarField.aggreateFields(Math.hypot, u_field, v_field);

Source

RawField.ts:67