cf.Variable.name¶
-
Variable.name(default=None, identity=False, ncvar=False, relaxed_identity=None)[source]¶ Return a name for the variable.
By default the name is the first found of the following:
- The
standard_nameCF property. - The
long_nameCF property, preceeded by the string'long_name:'. - The
idattribute. - The
ncvarattribute, preceeded by the string'ncvar%'. - The value of the default parameter.
Note that
f.name(identity=True)is equivalent tof.identity().See also
Examples 1: >>> n = f.name() >>> n = f.name(default='NO NAME')
Parameters: Returns: - out:
The name.
Examples 2: >>> f.standard_name = 'air_temperature' >>> f.long_name = 'temperature of the air' >>> f.ncvar = 'tas' >>> f.name() 'air_temperature' >>> del f.standard_name >>> f.name() 'long_name:temperature of the air' >>> del f.long_name >>> f.name() 'ncvar:tas' >>> del f.ncvar >>> f.name() None >>> f.name('no_name') 'no_name' >>> f.standard_name = 'air_temperature' >>> f.name('no_name') 'air_temperature'
- The