cdms2.dataset:CdmsFile

CdmsFile.write(var, attributes=None, axes=None, extbounds=None, id=None, extend=None, fill_value=None, index=None, typecode=None, dtype=None, pack=False)[source]

Write var to the file.

Parameters
varvariable to copy.
attributesThe attribute dictionary for the variable. The default is var.attributes.
axesThe list of file axes comprising the domain of the variable. The default is to

copy var.getAxisList().

extboundsThe extended dimension bounds. Defaults to var.getAxis(0).getBounds().
idThe variable name in the file. Default is var.id.
extend :
  • 1 causes the first dimension to be extensible iteratively writeable. The default is None, in which case the first dimension is extensible if it is time.

  • 0 to turn off this behaviour.

fill_valueis the missing value flag.
indexThe extended dimension index to write to. The default index is determined b

lookup relative to the existing extended dimension.

dtypeThe numpy dtype.
typecodeDeprecated, for backward compatibility only
Returns
File variable

Notes

If the variable is not yet defined in the file, a definition is created. By default, the time dimension of the variable is defined as the extended dimension of the file. The function returns the corresponding file variable.