Skip to content

Implement coordinates.allclose to find coordinates that are not strictly equal #2650

Closed

Description

@astrofrog

As suggested by @taldcroft in #2154 it would be nice to have a way to check that two sets of coordinates are essentially the same even if they are not exactly the same to machine precision.

Activity

  1. added this to the v1.0.0 milestone on Jun 22, 2014
  2. eteq commented on Jul 11, 2014

    @eteq
    Member

    👍 to this idea, and also re-writing the wide range of code in astropy.coordinates.test to use this uniformly.

  3. sargas commented on Nov 4, 2014

    @sargas
    Contributor

    Would it be sufficient to just check if the angle between the coordinates is below some threshold?

  4. astrofrog commented on Nov 4, 2014

    @astrofrog
    MemberAuthor

    @sargas - yes, using the angular separation functions already in astropy, so should be easy!

  5. removed this from the v1.0.0 milestone on Jan 13, 2015
  6. adrn commented on Jul 3, 2019

    @adrn
    Member

    This is simple to write with existing functions:

    import astropy.units as u
    u.allclose(c1.separation(c2), 0*u.deg)

    so I'm going to close this, but feel free to reopen if you disagree!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions