cf.Field.del_coordinate_reference¶
-
Field.
del_coordinate_reference
(identity=None, construct=None, default=ValueError())[source]¶ Remove a coordinate reference construct and all of its domain ancillary constructs.
New in version 3.0.0.
See also
- Parameters
- identity: optional
Select the coordinate reference construct by one of:
The identity or key of a coordinate reference construct.
A construct identity is specified by a string (e.g.
'grid_mapping_name:latitude_longitude'
,'latitude_longitude'
,'ncvar%lat_lon'
, etc.); aQuery
object (e.g.cf.eq('latitude_longitude')
); or a compiled regular expression (e.g.re.compile('^atmosphere')
) that selects the relevant constructs whose identities match viare.search
.Each construct has a number of identities, and is selected if any of them match any of those provided. A construct’s identities are those returned by its
identities
method. In the following example, the constructx
has two identities:>>> x.identities() ['grid_mapping_name:latitude_longitude', 'ncvar%lat_lon']
A identity’s prefix of
'grid_mapping_name:'
or'standard_name:'
may be omitted (e.g.'standard_name:atmosphere_hybrid_height_coordinate'
and'atmosphere_hybrid_height_coordinate'
are both acceptable identities).A construct key may optionally have the
'key%'
prefix. For example'coordinatereference2'
and'key%coordinatereference2'
are both acceptable keys.Note that in the output of a
print
call ordump
method, a construct is always described by one of its identities, and so this description may always be used as an identity argument.- Parameter example:
identity='standard_name:atmosphere_hybrid_height_coordinate'
- Parameter example:
identity='grid_mapping_name:rotated_latitude_longitude'
- Parameter example:
identity='transverse_mercator'
- Parameter example:
identity='coordinatereference1'
- Parameter example:
identity='key%coordinatereference1'
- Parameter example:
identity='ncvar%lat_lon'
- construct: optional
TODO
- default: optional
Return the value of the default parameter if the construct can not be removed, or does not exist. If set to an
Exception
instance then it will be raised instead.
- Returns
The removed coordinate reference construct.
Examples:
>>> f.del_coordinate_reference('rotated_latitude_longitude') <CF CoordinateReference: rotated_latitude_longitude>