ZarrCubeVelocityProvider
Provider responsible for loading and rendering 3D velocity fields (U and V components)
from Zarr datasets as animated Cesium WindLayers.
Remarks
This provider uses cube-cesium-wind-layer, the NOC-OI fork of
cesium-wind-layer. The fork adds
cube-aware rendering, bounded camera-driven particle scaling through
minVisibleRatio, and restores overview styling after zooming back out. The
provider passes one elevation-major U/V cube to a single animated layer.
Example
const provider = new ZarrCubeVelocityProvider(viewer, {
urls: { u: 'uo.zarr', v: 'vo.zarr' },
variables: { u: 'uo', v: 'vo' },
bounds: { west: -10, south: 30, east: 10, north: 45 }
});
await provider.load();
Accessors
queryDimensionValues
Get Signature
get queryDimensionValues(): object;
Coordinate values addressable by queries against the loaded velocity subset.
Returns
object
queryIndexOffsets
Get Signature
get queryIndexOffsets(): Record<string, number>;
Global coordinate offsets represented by index zero of the in-memory subset.
Returns
Record<string, number>
Elevation offset used by shared profile query helpers.
Constructors
Constructor
new ZarrCubeVelocityProvider(viewer, options): ZarrCubeVelocityProvider;
Creates a new ZarrCubeVelocityProvider instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
viewer | CesiumHost | Cesium viewer or widget where the layers will be rendered. |
options | VelocityOptions | Velocity dataset options (see VelocityOptions). |
Returns
ZarrCubeVelocityProvider
Throws
If either U or V has neither a URL nor a custom store.
Methods
destroy()
destroy(): void;
Removes the active wind cube layer from the Cesium scene and releases its GPU resources.
Returns
void
Remarks
Loaded U/V arrays and selectors remain in memory. Call updateSlices or load to render layers again.
getTimeSeries()
getTimeSeries(
position,
selectors?,
options?): Promise<QueryResult>;
Queries all time values and vector components at one position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | QueryPosition | [longitude, latitude] in WGS84 degrees. |
selectors? | ZarrSelectors | Fixed selectors for dimensions other than time. |
options? | QueryOptions | Query cancellation and coordinate-output controls. |
Returns
Promise<QueryResult>
Speed and component values ordered by time.
getVerticalProfile()
getVerticalProfile(
position,
selectors?,
options?): Promise<QueryResult>;
Queries all loaded elevation values and vector components at one position.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | QueryPosition | [longitude, latitude] in WGS84 degrees. |
selectors? | ZarrSelectors | Fixed selectors for dimensions other than elevation. |
options? | QueryOptions | Query cancellation and coordinate-output controls. |
Returns
Promise<QueryResult>
Speed and component values ordered by elevation.
load()
load(): Promise<void>;
Loads both U and V components of the velocity field from their respective Zarr datasets.
Returns
Promise<void>
A promise resolved after both components, coordinates, selected subsets, and all elevation wind layers have loaded.
Throws
When either custom or URL-backed store, selected array, dimensions, or data chunks cannot be read.
Remarks
U and V must describe compatible grids.
queryData()
queryData(
geometry,
selectors,
options): Promise<VelocityQueryResult>;
Queries velocity components and derived speed at a WGS84 point.
Parameters
| Parameter | Type | Description |
|---|---|---|
geometry | QueryGeometry | Point geometry in [longitude, latitude] degrees. |
selectors | ZarrSelectors | Optional time/elevation selectors for this query. |
options | QueryOptions | Cancellation and coordinate-output controls. |
Returns
Promise<VelocityQueryResult>
Speed values plus aligned U and V component arrays.
Throws
For unsupported geometries, invalid selectors, or failed reads.
Remarks
A ranged elevation selector returns a vertical profile; a ranged time selector reads the source arrays instead of only the rendered layers.
updateSelectors()
updateSelectors(options): Promise<void>;
Updates the dimension selectors, multiscale level, or geographic bounds, and reloads the velocity data accordingly.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { bounds?: BoundsProps; multiscaleLevel?: number; selectors?: { [key: string]: ZarrSelectorsProps; }; } | Partial data-selection update. Changed selectors, level, or bounds destroy the existing wind layers and reload both components. |
options.bounds? | BoundsProps | - |
options.multiscaleLevel? | number | - |
options.selectors? | { [key: string]: ZarrSelectorsProps; } | - |
Returns
Promise<void>
A promise that resolves after the change is scheduled. If no value changed, it resolves without rebuilding layers.
Remarks
Bounds are validated against geographic latitude limits.
updateSlices()
updateSlices(options): Promise<void>;
Updates the rendered cube's active elevation interval or vertical placement.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { elevationMode?: ElevationMode; sliceSpacing?: number; verticalExaggeration?: number; } | Partial slice-layout update. sliceSpacing is an elevation index interval; verticalExaggeration scales height; elevationMode controls whether coordinates are heights or depths. |
options.elevationMode? | ElevationMode | - |
options.sliceSpacing? | number | - |
options.verticalExaggeration? | number | - |
Returns
Promise<void>
A promise resolved after the cube layer options are updated.
Remarks
Non-positive spacing/exaggeration and spacing beyond the elevation dimension are rejected with a warning.
updateStyle()
updateStyle(options): void;
Updates the visual style of the velocity cube, such as opacity, color scale, or particle simulation parameters.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { colormap?: string; opacity?: number; scale?: [number, number]; windOptions?: VelocityWindOptions; } | Partial style update. windOptions are forwarded to the WindLayer except particleHeight, which remains derived from Zarr elevation. |
options.colormap? | string | - |
options.opacity? | number | - |
options.scale? | [number, number] | - |
options.windOptions? | VelocityWindOptions | - |
Returns
void
Remarks
The existing layer is updated in place; source data is not reloaded.
Properties
bounds
bounds: BoundsProps;
Configuration defining the geographic bounds of the cube.
cubeDimensions
cubeDimensions: [number, number, number] | null = null;
Cube dimensions: [longitude, latitude, elevation].
cubeDimensionValues
cubeDimensionValues: object = {};
Coordinate values represented by the currently loaded velocity cube subset.
Index Signature
[key: string]: string[] | number[] | Float64Array<ArrayBufferLike>
dimensionValues
dimensionValues: object = {};
Dimension coordinate arrays (e.g. lat, lon, elevation).
Index Signature
[key: string]: string[] | number[] | Float64Array<ArrayBufferLike>
elevationShape
elevationShape: number = 0;
Shape (size) of the elevation dimension.
id
id: string = '';
Unique identifier for the cube provider instance.
levelInfos
levelInfos: string[] = [];
Information about multiscale levels in the Zarr dataset.
multiscaleLevel
multiscaleLevel: number = 0;
Current multiscale level to load.
selectors
selectors: object;
User-defined selectors for slicing dimensions.
Index Signature
[key: string]: ZarrSelectorsProps