cf.Domain.create_regular

classmethod Domain.create_regular(x_args, y_args, bounds=True)[source]

Create a new domain with the regular longitudes and latitudes.

New in version 3.15.1.

Parameters
x_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.

y_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 (default), bounds will be created for the coordinates, and the coordinate points will be the midpoints of the bounds. If False, the given ranges represent the coordinate points directly.

Returns
Domain

The newly created domain with the specified longitude and latitude coordinates and bounds.

Examples

>>> import cf
>>> domain = cf.Domain.create_regular((-180, 180, 1), (-90, 90, 1))
>>> domain.dump()
--------
Domain:
--------
Domain Axis: latitude(180)
Domain Axis: longitude(360)
Dimension coordinate: longitude
    standard_name = 'longitude'
    units = 'degrees_east'
    Data(longitude(360)) = [-179.5, ..., 179.5] degrees_east
    Bounds:units = 'degrees_east'
    Bounds:Data(longitude(360), 2) = [[-180.0, ..., 180.0]] degrees_east
Dimension coordinate: latitude
    standard_name = 'latitude'
    units = 'degrees_north'
    Data(latitude(180)) = [-89.5, ..., 89.5] degrees_north
    Bounds:units = 'degrees_north'
    Bounds:Data(latitude(180), 2) = [[-90.0, ..., 90.0]] degrees_north