astropy/astropy — pull request #1397 by mhvk (2013-09-02 20:09:57+00:00)
Title: Remove less accurate/computationally stable angular distances

In #1389, it struck me that `angle_utilities` includes multiple routines to estimate angular distances, with varying degrees of sophistication. This PR removes all but the one actually used, as it seems to me a bad idea to include unused code, especially if it gives less accurate results, and does not even result in significant speedup:
```
from astropy.coordinates import Angle
from astropy.coordinates.angle_utilities import *
from numpy.random import uniform
n=10000
l1,b1 = Angle(uniform(0.,360.,n), "deg"), Angle(uniform(-90,90.,n),"deg")
l2,b2 = Angle(uniform(0.,360.,n), "deg"), Angle(uniform(-90,90.,n),"deg")
for dist in (small_angle_sphere_dist, simple_sphere_dist,
haversine_sphere_dist, haversine_atan_sphere_dist,
vincenty_sphere_dist):
%timeit dist(l1,b1,l2,b2)

```
yields
```
100 loops, best of 3: 2.68 ms per loop
100 loops, best of 3: 6.7 ms per loop
100 loops, best of 3: 6.19 ms per loop
100 loops, best of 3: 6.68 ms per loop
100 loops, best of 3: 8.86 ms per loop
```
One sees that only `small_angle_sphere_dist` has a significant speed advantage, but to my own detriment I know that this becomes inaccurate even on the angular scales covered by a typical ground-based CCD image.

(Note: replacing a `**0.5` with `sqrt` leads to a slight speed-up of `vincenty_sphere_dist`, to 8.09 ms per loop.)