This is documentation for an old release of SciPy (version 0.11.0). Read this page in the documentation of the latest stable release (version 1.14.1).

scipy.io.netcdf.netcdf_file

class scipy.io.netcdf.netcdf_file(filename, mode='r', mmap=None, version=1)[source]

A file object for NetCDF data.

A netcdf_file object has two standard attributes: dimensions and variables. The values of both are dictionaries, mapping dimension names to their associated lengths and variable names to variables, respectively. Application programs should never modify these dictionaries.

All other attributes correspond to global attributes defined in the NetCDF file. Global file attributes are created by assigning to an attribute of the netcdf_file object.

Parameters :

filename : string or file-like

string -> filename

mode : {‘r’, ‘w’}, optional

read-write mode, default is ‘r’

mmap : None or bool, optional

Whether to mmap filename when reading. Default is True when filename is a file name, False when filename is a file-like object

version : {1, 2}, optional

version of netcdf to read / write, where 1 means Classic format and 2 means 64-bit offset format. Default is 1. See here for more info.

Methods

close() Closes the NetCDF file.
createDimension(name, length) Adds a dimension to the Dimension section of the NetCDF data structure.
createVariable(name, type, dimensions) Create an empty variable for the netcdf_file object, specifying its data type and the dimensions it uses.
flush() Perform a sync-to-disk flush if the netcdf_file object is in write mode.
sync() Perform a sync-to-disk flush if the netcdf_file object is in write mode.

Previous topic

scipy.io.arff.loadarff

Next topic

scipy.io.netcdf.netcdf_file.close