cfdm.Field.set_data_axes

Field.set_data_axes(axes, key=None, _shape=None)[source]

Sets the axes spanned by the construct data.

Specifically, sets the domain axis constructs spanned by the data of the field or of a metadata construct.

New in version (cfdm): 1.7.0

Parameters
axes: sequence of str

The identifiers of the domain axis constructs spanned by the data of the field or of a metadata construct.

Parameter example:

axes='domainaxis1'

Parameter example:

axes=['domainaxis1']

Parameter example:

axes=['domainaxis1', 'domainaxis0']

key: str, optional

Specify a metadata construct, instead of the field construct.

Parameter example:

key='domainancillary1'

Returns

None

Examples

Set the domain axis constructs spanned by the data of the field construct:

>>> f = cfdm.Field()
>>> f.set_data_axes(['domainaxis0', 'domainaxis1'])
>>> f.get_data_axes()
('domainaxis0', 'domainaxis1')

Set the domain axis constructs spanned by the data of a metadata construct:

>>> f = cfdm.example_field(5)
>>> f.set_data_axes(['domainaxis1'], key='dimensioncoordinate1')