hypso.grid.areas#
pyresample geometry for hypso products: the swath a product was imaged in, the grid a regridded product is on, and new grids to regrid onto.
Grids from grid_area() have their extent snapped to whole multiples of the pixel size, so two captures regridded to the same CRS and resolution share pixel boundaries and can be compared pixel by pixel.
Functions#
|
AreaDefinition of a gridded product, from its x/y coordinates |
|
AreaDefinition from a CF grid-mapping variable's attributes, the x/y |
|
CF attributes for the x and y coordinate variables of a grid in crs. |
|
(latitude, longitude) arrays of a product; ValueError if it has none. |
|
A grid covering the given coordinates, snapped to the pixel size. |
|
File-name token for a grid (io/naming.py GRID_TOKEN): utm33n_880m, |
|
Ground resolution (m): a gridded product's pixel size (converted from |
|
What to resample from: a gridded product's AreaDefinition, else its |
|
SwathDefinition of a product's per-pixel geolocation (direct or not). |
|
The WGS84 UTM CRS of the zone containing the scene centre. |
Module Contents#
- hypso.grid.areas.area_definition(tree)[source]#
AreaDefinition of a gridded product, from its x/y coordinates (pixel centres) and crs grid-mapping variable.
- Parameters:
tree (xarray.DataTree)
- Return type:
- hypso.grid.areas.area_from_grid(crs_attrs, x, y, size_x, size_y, name='hypso_grid')[source]#
AreaDefinition from a CF grid-mapping variable’s attributes, the x/y pixel-centre coordinates and the pixel size - what a gridded product file holds (also used by the Satpy readers).
- Parameters:
- Return type:
- hypso.grid.areas.coordinate_attrs(crs)[source]#
CF attributes for the x and y coordinate variables of a grid in crs.
- Return type:
- hypso.grid.areas.geolocation(tree, direct=False)[source]#
(latitude, longitude) arrays of a product; ValueError if it has none.
- Parameters:
tree (xarray.DataTree)
direct (bool)
- Return type:
- hypso.grid.areas.grid_area(crs, resolution, latitudes, longitudes, area_id='hypso_grid')[source]#
A grid covering the given coordinates, snapped to the pixel size.
- Parameters:
- Returns:
Extent snapped to whole multiples of
resolution, so grids of two captures in the same CRS and resolution share pixel boundaries.- Return type:
- hypso.grid.areas.grid_name(crs, size_x, size_y)[source]#
File-name token for a grid (io/naming.py GRID_TOKEN): utm33n_880m, epsg4326_0p01deg, custom_30m; “AxB” for non-square pixels.
- hypso.grid.areas.resolution(tree)[source]#
Ground resolution (m): a gridded product’s pixel size (converted from degrees for a geographic grid), else the larger of the mean along- and across-track GSD.
- Parameters:
tree (xarray.DataTree)
- Return type:
- hypso.grid.areas.source_definition(tree)[source]#
What to resample from: a gridded product’s AreaDefinition, else its swath (as numpy arrays, which pyresample’s kd-tree needs).
- Parameters:
tree (xarray.DataTree)
- hypso.grid.areas.swath_definition(tree, direct=False)[source]#
SwathDefinition of a product’s per-pixel geolocation (direct or not).
- Parameters:
tree (xarray.DataTree)
direct (bool)
- Return type:
- hypso.grid.areas.utm_crs(latitudes, longitudes)[source]#
The WGS84 UTM CRS of the zone containing the scene centre.
EPSG 326xx (north) or 327xx (south); standard 6-degree zones, without the Norway and Svalbard exceptions.
- Parameters:
latitudes (array_like)
longitudes (array_like)
- Return type:
pyproj.CRS