cf.DimensionCoordinate.create_regular

classmethod DimensionCoordinate.create_regular(args, units=None, standard_name=None, bounds=True)[source]

Create a new DimensionCoordinate with the given range and cellsize.

Added in version 3.15.0.

Note:

This method does not set the cyclicity of the DimensionCoordinate.

Parameters:
args: sequence of numbers

A sequence of three numeric values. The first two values in the sequence represent the coordinate range (see the bounds parameter for details), and the third value represents the cellsize.

Note

The cellsize does not have to explicitly divide into the range of the given dimension. But as it follows numpy.arange while creating the points, one should verify that that the number of grid points are returned as expected.

bounds: bool, optional

If True (the default) then the given range represents the bounds, and the coordinate points will be the midpoints of the bounds. If False, the range represents the coordinate points directly.

units: str or Units, optional

The units of the new DimensionCoordinate object.

standard_name: str, optional

The standard_name of the DimensionCoordinate object.

Returns:
DimensionCoordinate

The newly created DimensionCoordinate object.

Examples

>>> longitude = cf.DimensionCoordinate.create_regular(
        (-180, 180, 1), units='degrees_east', standard_name='longitude'
    )
>>> longitude.dump()
Dimension coordinate: longitude
    standard_name = 'longitude'
    units = 'degrees_east'
    Data(360) = [-179.5, ..., 179.5] degrees_east
    Bounds:units = 'degrees_east'
    Bounds:Data(360, 2) = [[-180.0, ..., 180.0]] degrees_east