cfdm.CFDMImplementation.get_data_ndim¶
- CFDMImplementation.get_data_ndim(parent)[source]¶
Return the number of dimensions spanned by the data array.
- Parameters:
- parent:
The object containing the data array.
- Returns:
intThe number of dimensions spanned by the data array.
Examples
>>> w = cfdm.implementation() >>> d = cfdm.DimensionCoordinate( ... properties={ ... 'standard_name': 'latitude', 'units': 'degrees_north'}, ... data=cfdm.Data(range(180)) ... ) >>> d <DimensionCoordinate: latitude(180) degrees_north> >>> w.get_data_ndim(d) 1
>>> b = cfdm.Bounds( ... properties={ ... 'standard_name': 'latitude', 'units': 'degrees_north'}, ... data=cfdm.Data(numpy.arange(360).reshape(180, 2)) ... ) >>> b <Bounds: latitude(180, 2) degrees_north> >>> w.get_data_ndim(b) 2