Package netCDF4 :: Module _netCDF4 :: Class CompoundType
[hide private]
[frames] | no frames]

Class CompoundType

object --+
         |
        CompoundType

A `netCDF4.CompoundType` instance is used to describe a compound data type, and can be passed to the the `netCDF4.Dataset.createVariable` method of a `netCDF4.Dataset` or `netCDF4.Group` instance. Compound data types map to numpy structured arrays. See `netCDF4.CompoundType.__init__` for more details.

The instance variables `dtype` and `name` should not be modified by the user.

Instance Methods [hide private]
 
__init__(...)
***`__init__(group, datatype, datatype_name)`***
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(x)
repr(x)
 
__unicode__(...)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  _nc_type
  dtype
  name

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 

***`__init__(group, datatype, datatype_name)`***

CompoundType constructor.

**`group`**: `netCDF4.Group` instance to associate with the compound datatype.

**`datatype`**: A numpy dtype object describing a structured (a.k.a record) array. Can be composed of homogeneous numeric or character data types, or other structured array data types.

**`datatype_name`**: a Python string containing a description of the compound data type.

***Note 1***: When creating nested compound data types, the inner compound data types must already be associated with CompoundType instances (so create CompoundType instances for the innermost structures first).

***Note 2***: `netCDF4.CompoundType` instances should be created using the `netCDF4.Dataset.createCompoundType` method of a `netCDF4.Dataset` or `netCDF4.Group` instance, not using this class directly.

Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(x)
(Representation operator)

 

repr(x)

Overrides: object.__repr__