Trees | Indices | Help |
---|
|
object --+ | Dataset
Dataset(self, filename, mode="r", clobber=True, format='NETCDF3_64BIT')
A netCDF Dataset is a collection of dimensions, variables and attributes. Together they describe the meaning of data and relations among data fields stored in a netCDF file.
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. Appending
s
to modes w
, r+
or a
will enable unbuffered shared access. Unbuffered acesss may be useful
even if you don't need shared access, since it may be faster for programs
that don't access data sequentially.
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.
format
- underlying file format (either
'NETCDF3_64BIT'
or 'NETCDF3_CLASSIC'
. Only
relevant if mode = 'w'
(if mode = 'r','a'
or
'r+'
the file format is automatically detected). Default
'NETCDF3_64BIT'
(the 64-bit offset version of the netCDF 3
file format, which fully supports 2+ GB files)).
'NETCDF3_CLASSIC'
is the classic netCDF 3 file format that
does not handle 2+ Gb files very well.
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.
The instance variables dimensions, variables, file_format
and path
are read-only (and should not be modified by the
user).
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Instance Variables | |
dimensions The dimensions dictionary maps the names of dimensions
defined for the Dataset to instances of the Dimension class.
|
|
file_format The file_format attribute describes the netCDF file
format version, either NETCDF3_CLASSIC or or
NETCDF3_64BIT .
|
|
variables The variables dictionary maps the names of variables
defined for this Dataset to instances of the Variable class.
|
Properties | |
maskanscale | |
Inherited from |
Method Details |
x.__delattr__('name') <==> del x.name
|
x.__getattribute__('name') <==> x.name
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
|
x.__setattr__('name', value) <==> x.name = value
|
Creates a new dimension with the given
|
Creates a new variable with the given The Data from netCDF variables is presented to python as numpy arrays with the corresponding data type.
The optional keyword 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 Variable
instances behave much like array objects. Data can be assigned to or
retrieved from a variable with indexing and slicing operations on the Variable instance. A
Variable instance
has four standard attributes: |
delete a netCDF dataset or group attribute. Only use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes. |
retrievel a netCDF dataset attribute. Only use if you need to set a netCDF attribute with the same name as one of the reserved python attributes. |
Sets the fill mode for a Dataset open for writing to This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read. |
Sets the fill mode for a Dataset open for writing to This causes data to be pre-filled with fill values. The fill values
can be controlled by the variable's |
set a netCDF dataset attribute using name,value pair. Only use if you need to set a netCDF attribute with the same name as one of the reserved python attributes. |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Jul 8 10:58:35 2010 | http://epydoc.sourceforge.net |