xoa.core.geo

xoa.core.geo#

Geographic utilities

Functions

bbox_window(lon, lat, lonmin, lonmax, ...)

Bounding window of the points of a 2D grid that are in a lon/lat box

cell_half_extents(lon, lat, elon, elat)

Half extents in longitude and latitude of the cells of a 2D grid

closest_point_fast(lons, lats, target_lon, ...)

Find the closest point of a 2D grid, without scanning large grids

closest_point_range(lons, lats, target_lon, ...)

Find indices of closest point on 2D lon/lat grid

lonlat2xyz(lon, lat)

Convert longitudes and latitudes to cartesian coordinates on the unit sphere

max_true_rectangle(mask)

Largest rectangle of a 2D boolean array that contains only true values

normalize_longitude(lon)

Normalize longitude to [-180, 180] range.

normalize_longitudes(lon)

Put longitudes in the [-180, 180] range, leaving the ones that already are

polygon_distance(poly, lon, lat)

Approximate distance in radians of points to the boundary of a polygon

relative_cell_coords(x1, x2, x3, x4, y1, y2, ...)

Compute relative cell coordinates for counter-clockwise vertex ordering.

Classes

Box([lon, lat])

A box of longitudes and latitudes, where the longitude range may cross the dateline

Circle(lon, lat, dist[, radius])

A circle of great circle distance around a point

GeoSelector(lon, lat[, kind, radius, leafsize])

Find the indices of the points of a grid or cloud that are near a point or in a shape

Polygon(poly)

A polygon, which may be concave and cross the dateline

SphericalKDTree(lon, lat[, radius, leafsize])

A KD-tree of points on a sphere, defined by their longitudes and latitudes