hypso.grid.areas ================ .. py:module:: hypso.grid.areas .. autoapi-nested-parse:: 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 --------- .. autoapisummary:: hypso.grid.areas.area_definition hypso.grid.areas.area_from_grid hypso.grid.areas.coordinate_attrs hypso.grid.areas.geolocation hypso.grid.areas.grid_area hypso.grid.areas.grid_name hypso.grid.areas.resolution hypso.grid.areas.source_definition hypso.grid.areas.swath_definition hypso.grid.areas.utm_crs Module Contents --------------- .. py:function:: area_definition(tree) AreaDefinition of a gridded product, from its x/y coordinates (pixel centres) and `crs` grid-mapping variable. .. py:function:: area_from_grid(crs_attrs, x, y, size_x, size_y, name = 'hypso_grid') 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). .. py:function:: coordinate_attrs(crs) CF attributes for the x and y coordinate variables of a grid in `crs`. .. py:function:: geolocation(tree, direct = False) (latitude, longitude) arrays of a product; ValueError if it has none. .. py:function:: grid_area(crs, resolution, latitudes, longitudes, area_id = 'hypso_grid') A grid covering the given coordinates, snapped to the pixel size. :param crs: Anything pyproj accepts, e.g. ``"EPSG:32633"``. :type crs: str, int or pyproj.CRS :param resolution: Square pixel size in the CRS's units. :type resolution: float :param latitudes: Coordinates to cover (NaN ignored). :type latitudes: array_like :param longitudes: Coordinates to cover (NaN ignored). :type longitudes: array_like :param area_id: :type area_id: str, default "hypso_grid" :returns: Extent snapped to whole multiples of ``resolution``, so grids of two captures in the same CRS and resolution share pixel boundaries. :rtype: pyresample.geometry.AreaDefinition .. py:function:: grid_name(crs, size_x, size_y) File-name token for a grid (io/naming.py GRID_TOKEN): utm33n_880m, epsg4326_0p01deg, custom_30m; "AxB" for non-square pixels. .. py:function:: resolution(tree) 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. .. py:function:: source_definition(tree) What to resample from: a gridded product's AreaDefinition, else its swath (as numpy arrays, which pyresample's kd-tree needs). .. py:function:: swath_definition(tree, direct = False) SwathDefinition of a product's per-pixel geolocation (direct or not). .. py:function:: utm_crs(latitudes, longitudes) 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. :param latitudes: :type latitudes: array_like :param longitudes: :type longitudes: array_like :rtype: pyproj.CRS