oceanum-js

@oceanum/datamesh


@oceanum/datamesh / index / DataVar

Class: DataVar<S>

Defined in: packages/datamesh/src/lib/datamodel.ts:441

Represents a data variable within a dataset.

Type Parameters

S

S extends TempZarr | HttpZarr

Constructors

Constructor

new DataVar<S>(id, dimensions, attributes, arr): DataVar<DType, S>

Defined in: packages/datamesh/src/lib/datamodel.ts:459

Parameters

id

string

dimensions

string[]

attributes

Record<string, unknown>

arr

S extends TempZarr ? Array<DType, Mutable> : Array<DType, AsyncReadable<unknown>>

Returns

DataVar<DType, S>

Properties

arr

arr: S extends TempZarr ? Array<DType, Mutable> : Array<DType, AsyncReadable<unknown>>

Defined in: packages/datamesh/src/lib/datamodel.ts:456


attributes

attributes: Record<string, unknown>

Defined in: packages/datamesh/src/lib/datamodel.ts:455


dimensions

dimensions: string[]

Defined in: packages/datamesh/src/lib/datamodel.ts:454


id

id: string

Defined in: packages/datamesh/src/lib/datamodel.ts:453

Creates an instance of DataVar.

Param

The identifier for the data variable.

Param

The dimensions associated with the data variable.

Param

The attributes of the data variable, represented as a record of key-value pairs.

Param

The zarr array associated with the data variable.

Methods

get()

get(index?): Promise<Data>

Defined in: packages/datamesh/src/lib/datamodel.ts:480

Retrieves the data from the zarr array. If the data is already cached, it returns the cached data.

Parameters

index?

Optional slice parameters to retrieve specific data from the zarr array.

string[] (number | Slice)[]

Returns

Promise<Data>

A promise that resolves to the data of the zarr array.