Trees | Indices | Help |
---|
|
object --+ | Dataset
A netCDF Dataset is a collection of dimensions, groups, variables and attributes. Together they describe the meaning of data and relations among data fields stored in a netCDF file.
Constructor: Dataset(filename, mode="r",
clobber=True)
Parameters:
filename
- Name of netCDF file to hold
dataset.
Keywords:
mode
- access mode. r
means
read-only; no data can be modified. w
means write; a new
file is created, an existing file with the same name is deleted.
a
and r+
mean append (in analogy with serial
files); an existing file is opened for reading and writing.
clobber
- if True
(default), opening
a file with mode='w'
will clobber an existing file with the
same name. if False
, an exception will be raised if a file
with the same name already exists.
Returns:
a Dataset instance. All further operations on the netCDF Dataset are accomplised via Dataset instance methods.
A list of attribute names corresponding to global netCDF attributes
defined for the Dataset can be obtained with the ncattrs()
method. These attributes can be created by assigning to an attribute of
the Dataset
instance. A dictionary containing all the netCDF attribute name/value
pairs is provided by the __dict__
attribute of a Dataset instance.
dimensions, variables, groups,
file_format
and path
are read-only (and should not be
modified by the user).
|
|||
|
__delattr__(...) x.__delattr__('name') <==> del x.name |
||
|
__getattribute__(...) x.__getattribute__('name') <==> x.name |
||
|
__init__(...) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
||
| __new__(T, S, ...) | ||
|
__setattr__(...) x.__setattr__('name', value) <==> x.name = value |
||
|
close(...) Close the Dataset. |
||
|
createDimension(...) Creates a new dimension with the given dimname and
size .
|
||
|
createGroup(...) Creates a new Group with the given groupname .
|
||
|
createUserType(...) Creates a new user-defined data type of type usertype , with a base data type of
base_datatype and a name usertype_name .
|
||
|
createVariable(...) Creates a new variable with the given varname ,
datatype , and dimensions .
|
||
|
ncattrs(...) return netCDF global attribute names for this Dataset or Group in a list. |
||
|
renameDimension(...) rename a Dimension named oldname to
newname .
|
||
|
renameVariable(...) rename a Variable named oldname to
newname
|
||
|
set_fill_off(...) Sets the fill mode for a Dataset open for writing to off .
|
||
|
set_fill_on(...) Sets the fill mode for a Dataset open for writing to on .
|
||
|
sync(...) Writes all buffered data in the Dataset to the disk file. |
||
Inherited from |
|
|||
|
_grpid = <member '_grpid' of 'netCDF4.Dataset' objects>
|
||
|
parent = <member 'parent' of 'netCDF4.Dataset' objects>
|
|
|||
|
dimensions = <member 'dimensions' of 'netCDF4.Dataset' objects> The dimensions dictionary maps the names of
dimensions defined for the Group or Dataset to instances of the Dimension
class.
|
||
|
file_format = <member 'file_format' of 'netCDF4.Dataset' objects> The file_format attribute describes the netCDF file
format version, one of NETCDF3_CLASSIC ,
NETCDF4 , NETCDF4_CLASSIC or
NETCDF3_64BIT .
|
||
|
groups = <member 'groups' of 'netCDF4.Dataset' objects> The groups dictionary maps the names of groups created for this Dataset or Group to instances of the Group class (the Dataset class is simply a special case of the Group class which describes the root group in the netCDF file). |
||
|
path = <member 'path' of 'netCDF4.Dataset' objects> The path attribute shows the location of the Group in the Dataset in a unix
directory format (the names of groups in the hierarchy separated by
backslashes).
|
||
|
variables = <member 'variables' of 'netCDF4.Dataset' objects> The variables dictionary maps the names of variables
defined for this Dataset or Group to instances of the Variable
class.
|
|
|||
Inherited from |
|
|
|
|
|
|
Close the Dataset. close()
|
Creates a new dimension with the given
size must be a positive integer or None ,
which stands for "unlimited" (default is None ).
The return value is the Dimension class instance describing the new dimension.
To determine the current maximum size of the dimension, use the
len function on the Dimension instance. To determine if a dimension is
'unlimited', use the isunlimited() method of the Dimension
instance.
|
Creates a new Group with the given
|
Creates a new user-defined data type of type
The new datatype may be passed to the Parameters:
usertype_name - a Python string containing a
description of the user-defined data type.
|
Creates a new variable with the given
The Data from netCDF variables of a primitive data type are presented to
python as numpy arrays with the corresponding data type, except for
variables with Data from netCDF variables with a user-defined data type are presented
to python as numpy object (for In netCDF 4 it is possible to have nested user-defined data types
(e.g. compound types composed of vlens), but this is not yet supported.
All user-defined data types must consist of collections of fixed-size
primitive data types (no
If the optional keyword The optional keyword If the optional keyword If the optional keyword If the optional keyword The optional keyword If the optional keyword parameter The return value is the Variable class instance describing the new variable. A list of names corresponding to netCDF variable attributes can be
obtained with the Variable method dimensions, dtype, dtype_base,
shape, least_significant_digit, usertype and
usertype_name . Application programs should never modify
these attributes. The dimensions attribute is a tuple
containing the names of the dimensions associated with this variable. The
dtype attribute is a string describing the variable's data
type. It can either be a string describing one of the primitive data
types (i4, f8, S1, etc), or an instance of the class UserType. The
dtype_base attribute (only relevant if dtype is an instance
of UserType) is a
string describing the primitive data type of which the user-defined data
type is composed. The shape attribute is a tuple describing
the current sizes of all the variable's dimensions. The
least_significant_digit attributes describes the power of
ten of the smallest decimal place in the data the contains a reliable
value. Data is truncated to this decimal place when it is assigned to
the Variable
instance. If None , the data is not truncated. The
usertype attribute is a string describing the type of
user-defined data type the Variable belongs to (False for a primitive
data type, 'vlen' for a variable-length array,
'compound' for compound data type). The
usertype_name attribute is a Python string describing the
user-defined data type (None if usertype is
False ).
|
rename a Dimension named renameDimension(oldname, newname)
|
rename a Variable named renameVariable(oldname, newname)
|
Sets the fill mode for a Dataset open for writing to
|
Sets the fill mode for a Dataset open for writing to
_Fill_Value attribute,
but is usually sufficient to the use the netCDF default
_Fill_Value (defined separately for each variable type). The
default behavior of the netCDF library correspongs to
set_fill_on . Data which are equal to the
_Fill_Value indicate that the variable was created, but
never written to.
|
Writes all buffered data in the Dataset to the disk file. sync()
|
|
_grpidNone
|
parentNone
|
|
dimensionsThedimensions dictionary maps the names of dimensions
defined for the Group
or Dataset to
instances of the Dimension class.
|
file_formatThefile_format attribute describes the netCDF file
format version, one of NETCDF3_CLASSIC ,
NETCDF4 , NETCDF4_CLASSIC or
NETCDF3_64BIT . This module can read all formats, but only
writes NETCDF4 . To write files in the other formats, use the
netCDF4_classic
module.
|
groupsThe groups dictionary maps the names of groups created for this Dataset or Group to instances of the Group class (the Dataset class is simply a special case of the Group class which describes the root group in the netCDF file).
|
pathThepath attribute shows the location of the Group in the Dataset in a unix
directory format (the names of groups in the hierarchy separated by
backslashes). A Dataset, instance is the root group, so the path is
simply '/' .
|
variablesThevariables dictionary maps the names of variables
defined for this Dataset or Group to instances of the Variable class.
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0alpha3 on Tue Feb 13 19:56:15 2007 | http://epydoc.sourceforge.net |