oocgcm.griddeddata.grids.plane_2d_grid

oocgcm.griddeddata.grids.plane_2d_grid(xcoord=None, ycoord=None, mask=None, chunks=None, lat=45.0, lon=0.0)

Return a generic 2d grid build from arrays of coordinate.

The grid object corresponds to a Arakawa C-grid assuming that xcoord, ycoord and mask refer to the centers of the cells.

Parameters:

xcoord : array-like (numpy array or xarray)

array of x-coordinate from which to build the grid metrics. This can be either a one-dimensionnal or a two-dimensional array. For 2d arrays, assume that the order of the dimensions is (‘y’,’x’).

ycoord : array-like (numpy array or xarray)

array of y-coordinate from which to build the grid metrics. This can be either a one-dimensionnal or a two-dimensional array. For 2d arrays, assume that the order of the dimensions is (‘y’,’x’).

mask : boolean array-like (numpy array or xarray)

two-dimensional array describing the inner domain of the grid. mask==1 within the ocean, mask==0 on land.

chunks : dict-like

dictionnary of sizes of chunk for creating xarray.DataArray.

lat : float or array-like

latitude of t-points. This can be a float, a 1d or a 2d numpy array.

lon : float or array-like

longitude of t-points. This can be a float, a 1d or a 2d numpy array.

Returns:

grid : oocgcm.core.grids.generic_2d_grid

grid object corresponding to the input xcoord,ycoord arrays.