Precession not being applied correctly in epoch calculation

Bug #1169224 reported by Sherry Towers
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyEphem
Invalid
Undecided
Unassigned

Bug Description

Hi,

I have very recently downloaded pyephem. I like the user interface a lot.

However, I am getting very flaky results from it, specifically when I try to obtain the estimates of a star's declination at some point in the past. I have used exactly the code described in http://rhodesmill.org/brandon/projects/pyephem-manual.html#FixedObjects,Precession,andEpochs and I get completely different results. I am wondering if there is something else that needs to be added to my script to make things work, or if there is a new bug in pyephem.

My script looks like this:

import ephem
import ephem.stars

polaris = ephem.readdb("Polaris,f|M|F7,2:31:48.704,89:15:50.72,2.02,2000")
polaris.compute() # uses the current time by default

print 'my result for current polaris dec',polaris.dec
print 'webpage result 89:15:50.73\n'

polaris.compute(epoch='2100')
print 'my result for polaris dec in 2100',polaris.dec
print 'webpage result 89:32:26.08\n'

thuban = ephem.readdb("Thuban,f|V|A0,14:4:23.3,64:22:33,3.65,2000")
thuban.compute()

print 'my result for current thuban dec',thuban.dec
print 'webpage result 64:22:32.99\n'

print 'my result for thuban dec in -2800',thuban.dec
print 'webpage result 89:54:34.97\n'

polaris.compute(epoch='-2800')
print 'my result for polaris dec in -2800',polaris.dec
print 'webpage result 63:33:17.63\n'

And outputs this:
my result for current polaris dec 89:19:19.8
webpage result 89:15:50.73

my result for polaris dec in 2100 89:19:19.8
webpage result 89:32:26.08

my result for current thuban dec 64:18:39.2
webpage result 64:22:32.99

my result for thuban dec in -2800 64:18:39.2
webpage result 89:54:34.97

my result for polaris dec in -2800 89:19:19.8
webpage result 63:33:17.63

Revision history for this message
Sherry Towers (sherrytowers) wrote :
Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

May I designate your five results as (1) through (5) to make it easier to reference them? From what I can tell, here is what happened each time.

(1) You are printing out Polaris's position using today's coordinates (“epoch of today” is what a professional astronomer might call it) by saying “.ra” — but if you will double check the tutorial, it uses “.a_ra” which is the “astrometric position” which uses the sky coordinate system of the year 2000 as an unchanging standard. If you will change your own code to use this, then I think you will find that the results agree!

Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

(2) This seems to result from the same difference in spelling that affected (1) so if you change “.dec” to “.a_dec” then you should get close agreement with the tutorial. PLEASE NOTE that I wrote the wrong attribute in my answer to (1), and it looks like Launchpad is too primitive to let me edit it. I meant to name “.dec” up in that comment as well, and typed “.ra” out of habit by mistake.

Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

(3-5) Okay, I think I see the pattern: the next few examples from the tutorial also reference the astrometric declination “.a_dec” and if you will switch to printing it out, then you should get agreement between your code and the tutorial. Please let me know if you have any further problems!

Note that the successor library to PyEphem that I am writing, called Skyfield, will not have magically named obscure attributes like “.ra” and “.a_ra” which will hopefully avoid the annoyance of little misspellings like this!

Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

Since PyEphem appears to be behaving correctly in this instance, I am setting this bug to “invalid” since I am not planning any modifications to PyEphem based on this report.

Changed in pyephem:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.