seagrid.utils.gridtools#
Grid-spacing helpers (2.x interface), computed by seagrid.grids.metrics.
Functions
|
Return the zonal cell width in metres from 2-D cell centres. |
|
Return the meridional cell height in metres from 2-D cell centres. |
|
Return cell areas in km² from the distances between neighbouring centres. |
- seagrid.utils.gridtools.dx_approx(*, lats=None, lons=None, grid=None)[source]#
Return the zonal cell width in metres from 2-D cell centres.
- Parameters:
lats (
numpy.ndarray, optional) – 2-D cell-centre coordinates. Required without grid.lons (
numpy.ndarray, optional) – 2-D cell-centre coordinates. Required without grid.grid (
Gridorpyresample geometry, optional) – Grid; its coordinates are used instead.
- Returns:
- Raises:
TypeError – If neither grid nor both lats and lons are given.
- Return type:
See also
- seagrid.utils.gridtools.dy_approx(*, lats=None, lons=None, grid=None)[source]#
Return the meridional cell height in metres from 2-D cell centres.
As
dx_approx().See also
- seagrid.utils.gridtools.haversine_area(ds)[source]#
Return cell areas in km² from the distances between neighbouring centres.
- Parameters:
ds (
xarray.Dataset) – With 1-Dlat/loncoordinates or 2-Dlats/lonsvariables.- Returns:
numpy.ndarray– Edge cells are linearly extrapolated.- Return type:
See also
seagrid.geospatial.cell_areaexact spherical areas of any grid.