oocgcm.griddeddata.grids.latlon_2d_grid¶
- oocgcm.griddeddata.grids.latlon_2d_grid(latitudes=None, longitudes=None, mask=None, chunks=None)¶
Return a generic 2d grid build from arrays of lat,lon.
The grid object corresponds to a Arakawa C-grid assuming that latitudes, longitudes and mask refer to the centers of the cells.
Parameters: latitudes : array-like (numpy array or xarray)
array of latitudes 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’).
longitudes : array-like (numpy array or xarray)
array of longitudes 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.
Returns: grid : oocgcm.core.grids.generic_2d_grid
grid object corresponding to the input lat,lon arrays.