pyresample.spherical_utils module
Functions to support the calculation of a coverage of an area by a set of spherical polygons.
It can for instance be a set of satellite overpasses to be received of a given local stations over a certain time window where we want to calculate how much of an area is covered by the onboard scanning instrument(s).
- class pyresample.spherical_utils.GetNonOverlapUnions(polygons)
Bases:
GetNonOverlapUnionsBaseClassNonOverlapUnions class.
Init the GetNonOverlapUnions.
- __init__(polygons)
Init the GetNonOverlapUnions.
- _overlaps(polygon1, polygon2)
Check if two polygons overlap each other (have anything in common).
Return True if they do overlap, otherwise False.
polygon1 and polygon2 are here expected to be SphPolygon polygons. Strictly the two input objects do not need to be of type SphPolygon. The only requirement is that they have a union method with the same behaviour.
- class pyresample.spherical_utils.GetNonOverlapUnionsBaseClass(geom_objects)
Bases:
objectBase class to get the smallest set of union objects that does not overlap.
The objects are here Python sets of integers - but are abstracts for geometrical shapes on a sphere.
- __init__(geom_objects)
- _find_union_pair(geoms)
From a set of geometries find a pair that overlaps.
geoms is here expected to be a numbered dict with SphPolygon polygons. If no pair of two polygons overlap (that is the union returns something different from None or False) then return None.
Strictly the geometries/objects does not need to be a SphPolygon. The only requirement is that it has a union method with the same behaviour.
- _merge_unions(geoms)
Merge all overlapping geometry unions.
Go through the dictionary of geometries and merge overlapping ones until there is no change anymore. That is, the input dict of geometries is the same as the output:
- _overlaps(set1, set2)
Check if the two sets overlap each other (have anything in common).
- get_ids()
Get a list of identifiers identifying the gemoetry objects in each polygon union.
- get_polygons()
Get a list of all non-overlapping polygon unions.
- merge()
Merge all overlapping objects (sets or polygons).
- pyresample.spherical_utils._int_items_to_tuples(mytuple)
Turn integer scalars in a tuple into tuples.
- pyresample.spherical_utils.check_if_two_polygons_overlap(polygon1, polygon2)
Check if two SphPolygons overlaps.
- pyresample.spherical_utils.check_keys_int_or_tuple(adict)
Check if the dictionary keys are integers or tuples.
If they are not, raise a KeyError
- pyresample.spherical_utils.merge_tuples(atuple)
Take a nested tuple of integers and concatenate it to a tuple of integers.