Hardware-accelerated geospatial data plotting in the browser
autumnplot-gl • Docs
autumnplot-gl / RawScalarField
A class representing a raw 2D field of gridded data, such as height or u wind.
• ArrayType extends TypedArray
new RawScalarField<
ArrayType
>(grid
,data
):RawScalarField
<ArrayType
>
Create a data field.
• 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.
RawScalarField
<ArrayType
>
readonly
data:ArrayType
readonly
grid:Grid
getContours(
opts
):Promise
<ContourData
>
• opts: FieldContourOpts
Promise
<ContourData
>
static
aggregateFields<ArrayType
>(func
, …args
):RawScalarField
<ArrayType
>
Create a new field by aggregating a number of fields using a specific function
• ArrayType extends TypedArray
• 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
RawScalarField
<ArrayType
>
a new gridded field
// Compute wind speed from u and v
wind_speed_field = RawScalarField.aggreateFields(Math.hypot, u_field, v_field);