Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Point on GCA helper function #357

Merged

Conversation

hongyuchen1030
Copy link
Contributor

@hongyuchen1030 hongyuchen1030 commented Jun 23, 2023

Closes #356 #312

Overview

a feature that determines whether a given point lies within a great circle arc. The great circle arc should be restricted to a span of less than 180 degrees, and the implementation should handle cases where the arc crosses the antimeridian (the 0-degree meridian).

And a global error tolerance constant described in #312 is set

Expected Usage

import uxarray as ux

        gcr_same_lon_cart = [
            ux.utils.helpers.node_lonlat_rad_to_xyz([0.0, 1.5]),
            ux.utils.helpers.node_lonlat_rad_to_xyz([0.0, -1.5])
        ]
        pt_same_lon_in = ux.utils.helpers.node_lonlat_rad_to_xyz([0.0, 0.0])
        self.assertTrue(
            ux.utils.helpers.point_within_GCR(pt_same_lon_in,
                                              gcr_same_lon_cart))

        pt_same_lon_out = ux.utils.helpers.node_lonlat_rad_to_xyz(
            [0.0, 1.500000000000001])
        res = ux.utils.helpers.point_within_GCR(pt_same_lon_out,
                                                gcr_same_lon_cart)
        self.assertFalse(res)

PR Checklist

General

  • An issue is linked created and linked
  • Add appropriate labels
  • Filled out Overview and Expected Usage (if applicable) sections

Testing

  • Adequate tests are created if there is new functionality
  • Tests cover all possible logical paths in your function
  • Tests are not too basic (such as simply calling a function and nothing else)

Documentation

  • Docstrings have been added to all new functions
  • Docstrings have updated with any function changes
  • Internal functions have a preceding underscore (_) and have been added to docs/internal_api/index.rst
  • User functions have been added to docs/user_api/index.rst

@hongyuchen1030 hongyuchen1030 self-assigned this Jun 23, 2023
@hongyuchen1030 hongyuchen1030 added the new feature New feature or request label Jun 23, 2023
@philipc2
Copy link
Member

Hi @hongyuchen1030

Can you untrack all the files under docs/internal_api/_autosummary

@hongyuchen1030
Copy link
Contributor Author

Hi @hongyuchen1030

Can you untrack all the files under docs/internal_api/_autosummary

You mean deleting all lines after docs/internal_api/_autosummary? I am a bit clueless about what to do

uxarray/utils/helpers.py Outdated Show resolved Hide resolved
uxarray/utils/helpers.py Outdated Show resolved Hide resolved
uxarray/utils/helpers.py Outdated Show resolved Hide resolved
Copy link
Member

@philipc2 philipc2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

docs/user_api/index.rst Outdated Show resolved Hide resolved
docs/user_api/index.rst Outdated Show resolved Hide resolved
docs/user_api/index.rst Outdated Show resolved Hide resolved
uxarray/grid/coordinates.py Outdated Show resolved Hide resolved
uxarray/grid/lines.py Show resolved Hide resolved
uxarray/grid/lines.py Show resolved Hide resolved
uxarray/grid/lines.py Outdated Show resolved Hide resolved
uxarray/grid/lines.py Outdated Show resolved Hide resolved
@hongyuchen1030 hongyuchen1030 merged commit bbb9033 into UXARRAY:main Aug 14, 2023
10 checks passed
@hongyuchen1030 hongyuchen1030 deleted the point_on_GCR_helper_function branch September 18, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove "Redirected" Edge in the Project Detect if a point on a great circle arc
5 participants