uxarray.grid.arcs._decide_pole_latitude

uxarray.grid.arcs._decide_pole_latitude#

uxarray.grid.arcs._decide_pole_latitude(lat1, lat2)#

Determine the pole latitude based on the latitudes of two points on a Great Circle Arc (GCA).

This function calculates the combined latitude span from each point to its nearest pole and decides which pole (North or South) the smaller GCA will pass. This decision is crucial for handling GCAs that span exactly or more than 180 degrees in longitude, indicating the arc might pass through or close to one of the Earth’s poles.

Parameters:
  • lat1 (float) – Latitude of the first point in radians. Positive for the Northern Hemisphere, negative for the Southern.

  • lat2 (float) – Latitude of the second point in radians. Positive for the Northern Hemisphere, negative for the Southern.

Returns:

The latitude of the pole (np.pi/2 for the North Pole or -np.pi/2 for the South Pole) the GCA is closer to.

Return type:

float

Notes

The function assumes the input latitudes are valid (i.e., between -np.pi/2 and np.pi/2) and expressed in radians. The determination of which pole a GCA is closer to is based on the sum of the latitudinal spans from each point to its nearest pole, considering the shortest path on the sphere.