ephem.separation returns radians not degrees
Bug #774177 reported by
psismurf
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyEphem |
Fix Released
|
Medium
|
Brandon Rhodes |
Bug Description
I've just noticed that ephem.separation returns the angular separation in radians, not in degrees as stated in the docstring. Not a huge issue, but an annoying one to finally figure out (or maybe I'm just daft!)
Running PyEphem 3.7.2.4 under Python 2.5.2.
# should return 10 degrees
In [87]: ephem.separatio
Out[87]: 0.17453292519943317
# in fact it returns radians which must be converted to degrees
In [88]: degrees(
Out[88]: 10.000000000000012
Cheers,
Simon
To post a comment you must log in.
Well, this brings up a thorny issue. PyEphem intends that all angles be floating-point radians, but which will “print themselves out” in a more convenient format like angles of RA or degrees of pretty much anything else. In addition, when setting an angle, you can pass a string with RA or degrees, like “3:14:58.8” and PyEphem will convert it for you.
So the intention, when the docstring says “(degrees)”, is to define what format the *string* version takes. For people who encounter the idea in the tutorial first, this has been working. But I'd not thought about people who encounter the docstring first; obviously, it can confuse them!
I could expand all of those parenthetics to say something like “(radians printed as degrees)” or “displayed as degrees” or something like that, but let me think for a few days about what way of putting it might cause the least confusion — and let me know if you yourself have any ideas!