pyresample.future.geometry package

Submodules

pyresample.future.geometry.area module

Definitions for uniform gridded areas.

class pyresample.future.geometry.area.AreaDefinition(crs: str | int | dict | CRS, shape: tuple[int, ...], area_extent: tuple[float, float, float, float], attrs: dict | None = None)

Bases: AreaDefinition

Uniformly-spaced grid of pixels on a coordinate referenced system.

Parameters:
  • crs – Dictionary of PROJ parameters or string of PROJ or WKT parameters. Can also be a pyproj.crs.CRS object.

  • shape – Shape of the geographic region. Currently only a 2-element tuple is supported. The first element should be the number of elements in the Y direction (rows) and the second in the X direction (columns). So the final tuple is (rows, columns).

  • area_extent – Area extent as a list (lower_left_x, lower_left_y, upper_right_x, upper_right_y)

  • attrs

    Arbitrary metadata related to the area. Some keys in this dictionary have special meaning and may be used for various logging or serialization processes. The primary special keys are:

    • name: The identifying name for this area. This is equivalent

      to ‘area_id’ in the legacy AreaDefinition class. It is used in YAML serialization if provided. Defaults to an empty string if not provided. Not providing this should not affect normal coordinate operations.

    • description: A human-readable description of the area. This is

      equivalent to ‘description’ in the legacy AreaDefinition class. It is used in YAML serialization if provided.

area_id

Identifier for the area. This is a convenience for backwards compatibility and accesses the .attrs['name'] metadata. This will be set to an empty string if not provided.

Type:

str

shape

Shape of the grid as (rows, columns).

width

x dimension in number of pixels, aka number of grid columns

Type:

int

height

y dimension in number of pixels, aka number of grid rows

Type:

int

size

Number of points in grid

Type:

int

area_extent_ll

Area extent in lons lats as a tuple (lower_left_lon, lower_left_lat, upper_right_lon, upper_right_lat)

Type:

tuple

pixel_size_x

Pixel width in projection units

Type:

float

pixel_size_y

Pixel height in projection units

Type:

float

upper_left_extent

Coordinates (x, y) of upper left corner of upper left pixel in projection units

Type:

tuple

pixel_upper_left

Coordinates (x, y) of center of upper left pixel in projection units

Type:

tuple

pixel_offset_x

x offset between projection center and upper left corner of upper left pixel in units of pixels.

Type:

float

pixel_offset_y

y offset between projection center and upper left corner of upper left pixel in units of pixels.

Type:

float

crs

Coordinate reference system object similar to the PROJ parameters in proj_dict and proj_str. This is the preferred attribute to use when working with the pyproj library. Note, however, that this object is not thread-safe and should not be passed between threads.

Type:

CRS

attrs

Arbitrary metadata related to the area.

Type:

dict

to_legacy() AreaDefinition

Create a pyresample 1.x AreaDefinition object from this instance.

pyresample.future.geometry.swath module

Definitions for swath-based or non-uniform geometries.

class pyresample.future.geometry.swath.SwathDefinition(lons, lats, crs=None, attrs=None)

Bases: SwathDefinition

Swath defined by lons and lats.

Parameters:
  • lons (numpy array) –

  • lats (numpy array) –

  • crs (pyproj.CRS,) – The CRS to use. longlat on WGS84 by default.

  • attrs (dict,) – A dictionary made to store metadata.

shape

Swath shape

Type:

tuple

size

Number of elements in swath

Type:

int

ndims

Swath dimensions

Type:

int

lons

Swath lons

Type:

object

lats

Swath lats

Type:

object

cartesian_coords

Swath cartesian coordinates

Type:

object

concatenate(other)

Concatenate coordinate definitions.

Module contents

Definitions for geographic regions.