Class: NetCDF::Dimension

Inherits:
CDMNode show all
Defined in:
lib/netcdf/dimension.rb

Overview

A Dimension is used to define the array shape of a Variable. It may be shared among Variables, which provides a simple yet powerful way of associating Variables. When a Dimension is shared, it has a unique name within its Group. It may have a coordinate Variable, which gives each index a coordinate value. A private Dimension cannot have a coordinate Variable, so use shared dimensions with coordinates when possible. The Dimension length must be > 0, except for an unlimited dimension which may have length = 0, and a vlen Dimension has length = -1. Immutable if setImmutable() was called, except for an Unlimited Dimension, whose size can change.

Direct Known Subclasses

DimensionWriter

Instance Attribute Summary

Attributes inherited from CDMNode

#netcdf_elmt

Instance Method Summary collapse

Methods inherited from CDMNode

#get_full_name, #get_short_name, #initialize

Constructor Details

This class inherits a constructor from NetCDF::CDMNode

Instance Method Details

#get_lengthObject Also known as: length




42
43
44
# File 'lib/netcdf/dimension.rb', line 42

def get_length
  @netcdf_elmt.getLength()
end

#groupObject




76
77
78
# File 'lib/netcdf/dimension.rb', line 76

def group
  NetCDF::Group.new(@netcdf_elmt.getGroup())
end

#shared?Boolean



Returns:

  • (Boolean)

52
53
54
# File 'lib/netcdf/dimension.rb', line 52

def shared?
  @netcdf_elmt.isShared()
end

#unlimited?Boolean



Returns:

  • (Boolean)

60
61
62
# File 'lib/netcdf/dimension.rb', line 60

def unlimited?
  @netcdf_elmt.isUnlimited()
end

#variable_length?Boolean



Returns:

  • (Boolean)

68
69
70
# File 'lib/netcdf/dimension.rb', line 68

def variable_length?
  @netcdf_elmt.isVariableLength()
end