uxarray.grid.intersections.gca_constLat_intersection

uxarray.grid.intersections.gca_constLat_intersection#

uxarray.grid.intersections.gca_constLat_intersection(gca_cart, constZ, fma_disabled=False, verbose=False, is_directed=False)#

Calculate the intersection point(s) of a Great Circle Arc (GCA) and a constant latitude line in a Cartesian coordinate system.

To reduce relative errors, the Fused Multiply-Add (FMA) operation is utilized. A warning is raised if the given coordinates are not in the cartesian coordinates, or they cannot be accurately handled using floating-point arithmetic.

Parameters:
  • gca_cart ([2, 3] np.ndarray Cartesian coordinates of the two end points GCA.)

  • constZ (float) – The constant latitude represented in cartesian of the latitude line.

  • fma_disabled (bool, optional (default=False)) – If True, the FMA operation is disabled. And a naive np.cross is used instead.

  • verbose (bool, optional (default=False)) – If True, the function prints out the intermediate results.

  • is_directed (bool, optional (default=False)) – If True, the GCA is considered to be directed, which means it can only from v0–>v1. If False, the GCA is undirected, and we will always assume the small circle (The one less than 180 degree) side is the GCA.

Returns:

Cartesian coordinates of the intersection point(s) the shape is [n_intersext_pts, 3].

Return type:

np.ndarray

Raises:

ValueError – If the input GCA is not in the cartesian [x, y, z] format.

Warning

If running on the Windows system with fma_disabled=False since the C/C++ implementation of FMA in MS Windows is fundamentally broken. (bug report: https://bugs.python.org/msg312480)