Table of Contents

Class NetCdfVariable

Namespace
EncDotNet.S100.Datasets.NetCdf
Assembly
EncDotNet.S100.Datasets.NetCdf.dll

A NetCDF variable: a name, a type, the dimensions it's laid out along (slowest first) and its attributes.

public sealed class NetCdfVariable
Inheritance
NetCdfVariable
Inherited Members

Constructors

NetCdfVariable(string, NetCdfDataType, IReadOnlyList<NetCdfDimension>, IReadOnlyList<NetCdfAttribute>)

Creates a variable.

public NetCdfVariable(string name, NetCdfDataType dataType, IReadOnlyList<NetCdfDimension> dimensions, IReadOnlyList<NetCdfAttribute> attributes)

Parameters

name string

The variable's name.

dataType NetCdfDataType

The type of its values.

dimensions IReadOnlyList<NetCdfDimension>

Its dimensions, slowest-varying first; empty for a scalar.

attributes IReadOnlyList<NetCdfAttribute>

Its attributes.

Properties

Attributes

Its attributes, in file order.

public IReadOnlyList<NetCdfAttribute> Attributes { get; }

Property Value

IReadOnlyList<NetCdfAttribute>

DataType

The type of its values.

public NetCdfDataType DataType { get; }

Property Value

NetCdfDataType

Dimensions

Its dimensions, slowest-varying first; empty for a scalar.

public IReadOnlyList<NetCdfDimension> Dimensions { get; }

Property Value

IReadOnlyList<NetCdfDimension>

IsCoordinateVariable

Whether the variable is a coordinate variable: one dimension, with the same name as the variable (NetCDF User Guide, "Coordinate Variables").

public bool IsCoordinateVariable { get; }

Property Value

bool

IsNumeric

Whether the variable is numeric (and so can be read with Read(NetCdfVariable, ReadOnlySpan<long>, ReadOnlySpan<long>)).

public bool IsNumeric { get; }

Property Value

bool

Name

The variable's name, for example "VHM0".

public string Name { get; }

Property Value

string

Shape

The number of points along each dimension.

public IReadOnlyList<long> Shape { get; }

Property Value

IReadOnlyList<long>

Methods

FindAttribute(string)

Finds an attribute by name (case-sensitive, as NetCDF names are).

public NetCdfAttribute? FindAttribute(string name)

Parameters

name string

The attribute's name.

Returns

NetCdfAttribute

The attribute, or null.

GetText(string)

The text of attribute name, trimmed, or null when it's absent or numeric.

public string? GetText(string name)

Parameters

name string

The attribute's name.

Returns

string

ToString()

Returns the name and dimensions, for example "VHM0(time, latitude, longitude)".

public override string ToString()

Returns

string