seagrid.utils.grids#

Legacy grid helpers, kept for the 2.x series.

These return pyresample geometries the way the data-source modules have always done. New code should use seagrid.grids, which these wrap. They will emit DeprecationWarning once all sources use seagrid.grids.Grid (refactoring phase 5) and will be removed in 3.0.

Functions

setup_latlon_grid(ds, **kw)

Create a pyresample grid definition from a dataset's lat/lon.

setup_nasa_grid([resolution])

Create the NASA OBPG equal-angle grid as a pyresample grid definition.

setup_plate_carree_grid(lon1, lon2, lat1, ...)

Create a plate carrée (lat/lon) pyresample area definition.

seagrid.utils.grids.setup_latlon_grid(ds, **kw)[source]#

Create a pyresample grid definition from a dataset’s lat/lon.

Parameters:
  • ds (xarray.Dataset) – Dataset with lat and lon coordinates.

  • **kw – Unused, accepted for compatibility.

Returns:

pyresample.geometry.GridDefinition – In the dataset’s row order, with the extra attributes ivec, jvec, iarr and jarr.

Return type:

GridDefinition

seagrid.utils.grids.setup_nasa_grid(resolution='4km', **kw)[source]#

Create the NASA OBPG equal-angle grid as a pyresample grid definition.

Parameters:
  • resolution ({"1deg", "18km", "9km", "4km", "2km", "1km"}, optional) – Grid resolution. Default "4km".

  • **kw – Unused, accepted for compatibility.

Returns:

pyresample.geometry.GridDefinition – Latitude ascending, with the extra attributes ivec, jvec, iarr and jarr.

Raises:

ValueError – If resolution is not supported.

Return type:

GridDefinition

seagrid.utils.grids.setup_plate_carree_grid(lon1, lon2, lat1, lat2, width, height, **kw)[source]#

Create a plate carrée (lat/lon) pyresample area definition.

Parameters:
  • lon1 (float) – Western and eastern edge of the area, in degrees.

  • lon2 (float) – Western and eastern edge of the area, in degrees.

  • lat1 (float) – Southern and northern edge of the area, in degrees.

  • lat2 (float) – Southern and northern edge of the area, in degrees.

  • width (int) – Number of columns and rows.

  • height (int) – Number of columns and rows.

  • **kw – Unused, accepted for compatibility.

Returns:

pyresample.geometry.AreaDefinition – Rows run north to south, as in all pyresample area definitions.

Return type:

AreaDefinition