You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Robust implementation of point_within_gca using only Cartesian coordinates #1102
Robust implementation of point_within_gcausing only Cartesian coordinates
The current implementation of point_within_gca is not robust enough because it relies on back-and-forth conversions between longitude/latitude and Cartesian coordinates to determine the result. This approach introduces potential inaccuracies and inefficiencies.
We need to rewrite point_within_gca to exclusively use Cartesian coordinates. This will improve both robustness and performance by eliminating unnecessary conversions.
Acceptance Criteria
The point_within_gca function should be rewritten to exclusively use Cartesian coordinates.
Ensure that the implementation is robust and handles edge cases appropriately.
Maintain or improve the performance compared to the current implementation.
Add sufficient tests to validate the correctness of the rewritten function.
Just wanted to clarify that _point_within_gca_cartesian isn't the primary function we should be calling. This one was implemented for compatibility and ease of use (i.e. for basic tests and examples). I need to include this in the docstring.
We use the following primarily in our internal code, which expects both spherical and cartesian coordinates.
changed the title [-]Robust implementation of `_point_within_gca_cartesian` using only Cartesian coordinates[/-][+]Robust implementation of `point_within_gca` using only Cartesian coordinates[/+]on Dec 6, 2024
Seems like the only helper called from point_within_gca that would need to be updated is _decide_pole_latitude, which currently expects the latitude in radians.
Seems like the only helper called from point_within_gca that would need to be updated is _decide_pole_latitude, which currently expects the latitude in radians.
The entire point_within_gca function algorithm must be rewritten heavily. So we don't even know if we need _decide_pole_latitude
Activity
philipc2 commentedon Dec 6, 2024
Hi @hongyuchen1030
Just wanted to clarify that
_point_within_gca_cartesianisn't the primary function we should be calling. This one was implemented for compatibility and ease of use (i.e. for basic tests and examples). I need to include this in the docstring.We use the following primarily in our internal code, which expects both spherical and cartesian coordinates.
uxarray/uxarray/grid/arcs.py
Lines 65 to 275 in 1d20619
I am all in favor of re-writing it to only use Cartesian coordinates though, especially if it will improve the accuracy.
hongyuchen1030 commentedon Dec 6, 2024
Got it. Will change the name accordingly. What I mean is to rewrite the functionality using pure cartesian
[-]Robust implementation of `_point_within_gca_cartesian` using only Cartesian coordinates[/-][+]Robust implementation of `point_within_gca` using only Cartesian coordinates[/+]philipc2 commentedon Dec 6, 2024
Seems like the only helper called from
point_within_gcathat would need to be updated is_decide_pole_latitude, which currently expects the latitude in radians.hongyuchen1030 commentedon Dec 6, 2024
The entire
point_within_gcafunction algorithm must be rewritten heavily. So we don't even know if we need_decide_pole_latitude