__init__(self,
filename,
mode)
(Constructor)
|
|
- Parameters:
filename (str ) - name of the netCDF file. By convention, netCDF files have the
extension ".nc", but this is not enforced. The filename
may contain a home directory indication starting with
"~".
mode (str ) - 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" means
append (in analogy with serial files); an existing file is opened
for reading and writing, if the file does not exist it is
created. "r+" is similar to "a", but the file
must already exist. An "s" can be appended to any of
the modes listed above; it indicates that the file will be opened
or created in "share" mode, which reduces buffering in
order to permit simultaneous read access by other processes to a
file that is being written. When creating a file in write mode,
an "l" or "4" can be appended to use the
large-file format (introduced with netCDF 3.6) or the HDF5 format
(introduced with netCDF 4).
|