cfdm.Field.nc_clear_geometry_variable_groups

Field.nc_clear_geometry_variable_groups()[source]

Remove the netCDF geometry variable group hierarchy.

The group hierarchy is defined by the netCDF name. Groups are delimited by / (slash) characters in the netCDF name. The groups are returned, in hierarchical order, as a sequence of strings. If the name is not set, or contains no / characters then an empty sequence is returned, signifying the root group.

An alternative technique for removing the group structure is to set the netCDF variable name, with nc_set_geometry_variable, with no / characters.

New in version (cfdm): 1.8.6

Returns
tuple of str

The removed group structure.

Examples:

>>> f.nc_set_geometry_variable('geometry1')
>>> f.nc_geometry_variable_groups()
()
>>> f.nc_set_geometry_variable_groups(['forecast', 'model'])
>>> ()
>>> f.nc_geometry_variable_groups()
('forecast', 'model')
>>> f.nc_get_geometry_variable()
'/forecast/model/geometry1'
>>> f.nc_clear_geometry_variable_groups()
('forecast', 'model')
>>> f.nc_get_geometry_variable()
'geometry1'
>>> f.nc_set_geometry_variable('/forecast/model/geometry1')
>>> f.nc_geometry_variable_groups()
('forecast', 'model')
>>> f.nc_del_geometry_variable('/forecast/model/geometry1')
'/forecast/model/geometry1'
>>> f.nc_geometry_variable_groups()
()