NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import NetcdfReader from 'ngl/src/utils/netcdf-reader.js'
public class | source

NetcdfReader

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public get
public get
public
public get
public get
public get

Method Summary

Public Methods
public

getDataVariable(variableName: string | object): Array

Retrieves the data for a given variable

public

hasDataVariable(variableName: string | object): Boolean

Checks if a variable is available

Public Constructors

public constructor(data: ArrayBuffer) source

Params:

NameTypeAttributeDescription
data ArrayBuffer

ArrayBuffer or any Typed Array with the data

Public Members

public buffer source

public get dimensions: Array<object> source

Return:

Array<object>

List of dimensions with:

  • name: String with the name of the dimension
  • size: Number with the size of the dimension

public get globalAttributes: Array<object> source

Return:

Array<object>

List of global attributes with:

  • name: String with the name of the attribute
  • type: String with the type of the attribute
  • value: A number or string with the value of the attribute

public header source

public get recordDimension: object source

Return:

object

Metadata for the record dimension

  • length: Number of elements in the record dimension
  • id: Id number in the list of dimensions for the record dimension
  • name: String with the name of the record dimension
  • recordStep: Number with the record variables step size

public get variables: Array<object> source

Return:

Array<object>

List of variables with:

  • name: String with the name of the variable
  • dimensions: Array with the dimension IDs of the variable
  • attributes: Array with the attributes of the variable
  • type: String with the type of the variable
  • size: Number with the size of the variable
  • offset: Number with the offset where of the variable begins
  • record: True if is a record variable, false otherwise

public get version: string source

Return:

string

Version for the NetCDF format

Public Methods

public getDataVariable(variableName: string | object): Array source

Retrieves the data for a given variable

Params:

NameTypeAttributeDescription
variableName string | object

Name of the variable to search or variable object

Return:

Array

List with the variable values

public hasDataVariable(variableName: string | object): Boolean source

Checks if a variable is available

Params:

NameTypeAttributeDescription
variableName string | object

Name of the variable to check

Return:

Boolean

Variable existence