astromodels.utils.angular_distance module

astromodels.utils.angular_distance.angular_distance(ra1, dec1, ra2, dec2)[source]

Returns the angular distance between two points, two sets of points, or a set of points and one point.

Parameters
  • ra1 – array or float, longitude of first point(s)

  • dec1 – array or float, latitude of first point(s)

  • ra2 – array or float, longitude of second point(s)

  • dec2 – array or float, latitude of second point(s)

Returns

angular distance(s) in degrees

astromodels.utils.angular_distance.angular_distance_fast(ra1, dec1, ra2, dec2)[source]

Compute angular distance using the Haversine formula. Use this one when you know you will never ask for points at their antipodes. If this is not the case, use the angular_distance function which is slower, but works also for antipodes.

Parameters
  • lon1

  • lat1

  • lon2

  • lat2

Returns

astromodels.utils.angular_distance.spherical_angle(ra0, dec0, ra1, dec1, ra2, dec2)[source]

Returns the spherical angle distance between two sets of great circles defined by (ra0, dec0), (ra1, dec1) and (ra0, dec0), (ra2, dec2)

Parameters
  • ra0 – array or float, longitude of intersection point(s)

  • dec0 – array or float, latitude of intersection point(s)

  • ra1 – array or float, longitude of first point(s)

  • dec1 – array or float, latitude of first point(s)

  • ra2 – array or float, longitude of second point(s)

  • dec2 – array or float, latitude of second point(s)

Returns

spherical angle in degrees