Class NetCdfVariable
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
namestringThe variable's name.
dataTypeNetCdfDataTypeThe type of its values.
dimensionsIReadOnlyList<NetCdfDimension>Its dimensions, slowest-varying first; empty for a scalar.
attributesIReadOnlyList<NetCdfAttribute>Its attributes.
Properties
Attributes
Its attributes, in file order.
public IReadOnlyList<NetCdfAttribute> Attributes { get; }
Property Value
DataType
The type of its values.
public NetCdfDataType DataType { get; }
Property Value
Dimensions
Its dimensions, slowest-varying first; empty for a scalar.
public IReadOnlyList<NetCdfDimension> Dimensions { get; }
Property Value
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
IsNumeric
Whether the variable is numeric (and so can be read with Read(NetCdfVariable, ReadOnlySpan<long>, ReadOnlySpan<long>)).
public bool IsNumeric { get; }
Property Value
Name
The variable's name, for example "VHM0".
public string Name { get; }
Property Value
Shape
The number of points along each dimension.
public IReadOnlyList<long> Shape { get; }
Property Value
Methods
FindAttribute(string)
Finds an attribute by name (case-sensitive, as NetCDF names are).
public NetCdfAttribute? FindAttribute(string name)
Parameters
namestringThe 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
namestringThe attribute's name.
Returns
ToString()
Returns the name and dimensions, for example "VHM0(time, latitude, longitude)".
public override string ToString()