brandon-rhodes / pyephem

Scientific-grade astronomy routines for Python
Other
766 stars 121 forks source link

mismatch position of planets with other sources #233

Closed dave-sdt closed 2 years ago

dave-sdt commented 2 years ago

i am trying to calculate the exact degree of planets on the zodiac by pyephem but i faced with some problems. i need to extract the amounts with high accuracy . i made it better by changing Epoch value to now , but there are diffrents in second(degree an minutes are same as another valid source), is there any other factors to consider to make it more accurate? as we know results are different in each source, what is the exact position of planets and how we can calculate that?

i made this code better with applying epoch= ephem.now()

pl= ephem.Pluto() pl.compute('2022/4/18 16:42:00') print("coordinates:", ephem.Ecliptic(pl).lon) print(ephem.constellation(pl)) pl.compute('2022/4/18 16:48:00', epoch= ephem.now()) print("coordinates:", ephem.Ecliptic(pl).lon , math.degrees(ephem.Ecliptic(pl).lon) ) print(ephem.constellation(pl))

coordinates: 298:15:33.9 ('Sgr', 'Sagittarius') coordinates: 298:34:15.4 298.57095635169946 ('Sgr', 'Sagittarius') but in my source it is 298(deg)34(min)08(sec) in capricorn . . . p.s : time zones are same. i used this Android app link this app In addition to degree and minute shows the second and but this site link did not shows second. in compare of the Android app my codes results are few second(deg,min,second) different (Pluto in code 298:34:18.0 _ Pluto in app 298:34:11.0) that (18.0-11.0) 7 second cause more than 10 hours different in time for slow moving objects like Pluto

brandon-rhodes commented 2 years ago

Alas, the old libastro library that PyEphem uses for its calculations is based on the VSOP87 planetary theory, which by this point is several decades old. You will probably want to look for a library or table that uses more recent observations to predict Pluto's position. Have you tried out the JPL "HORIZONS" tool? Maybe you could ask it for a big ephemeris of Pluto positions, and use that.

drbitboy commented 2 years ago

https://naif.jpl.nasa.gov/

There is also (still, I assume) a telnet (TCP/IP port 23) interface to HORIZONS; it's a little messy to do programmatically, but I once wrote an eXcel macro to populate a worksheet.