Utilities¶
Cythonised functions used by methods of octant.core.TrackRun
.
-
octant.utils.
great_circle
()¶ Calculate great circle distance between two points on a sphere
- Parameters
lon1 (double) – Longitude of the first point
lon2 (double) – Longitude of the second point
lat1 (double) – Latitude of the first point
lat2 (double) – Latitude of the second point
r_planet (double, optional) – Radius of the planet in metres Default: EARTH_RADIUS
- Returns
dist – Distance in metres
- Return type
double
Examples
>>> great_circle(-180.0, -170.0, 30.0, 40.0) 1435334.9068947
-
octant.utils.
mask_tracks
()¶ Count how many points of a cyclone track should be masked by their proximity to masked values in a 2D array.
- Parameters
mask (double, shape(M, N)) – Mask array with 1 for masked values
lon2d (double, shape(M, N)) – Array of longitudes corresponding to the mask
lat2d (double, shape(M, N)) – Array of latitudes corresponding to the mask
lonlat (double, shape(P, 2)) – Array of track’s longitudes and latitudes
dist (double) – Distance in metres to check proximity
r_planet (double, optional) – Radius of the planet in metres Default: EARTH_RADIUS
- Returns
- Return type
Fraction of masked points of the track