2

How to calculate postion of stars with PyEphem on particulary date. I writed code but it calculate only today

    obs = ephem.Observer()   
    obs.date = "2010/12/10"        
    Sirrah = ephem.star("Sirrah")        
    Sirrah.compute(obs)              

Thank's for help

madth3
  • 7,275
  • 12
  • 50
  • 74
useris
  • 59
  • 1
  • 4

1 Answers1

2

Maybe someone will find it usefull:

import ephem
import ephem.stars
global stars
stars = {}
obs = ephem.Observer()
obs.long =  ephem.degrees('15.17')
obs.lat = ephem.degrees('44.4')
obs.elevation = 200
obs.date = "2010/09/12"
for star in ephem.stars.db.split("\n"):    
    name = star.split(",")[0]     
    if name=="Sirrah":              
        starz = ephem.FixedBody(star.split(",")[2][:-7], star.split(",")[3][:-7])    
        starz = ephem.star(name)   
        starz.compute(obs)       
        print name+":  "+str(starz.alt)+"  "+str(starz.az)
        break    
madth3
  • 7,275
  • 12
  • 50
  • 74
useris
  • 59
  • 1
  • 4
  • If you will click the green check box to mark this as the answer to your question, then your question will no longer show up in the Stack Overflow dashboard as an unanswered question. Thanks, and I am glad that you got it working! – Brandon Rhodes Apr 20 '13 at 16:28