Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:09:15+00:00 2026-05-28T08:09:15+00:00

This looks quite a basic task, but I cannot sort it out. The PyEphem

  • 0

This looks quite a basic task, but I cannot sort it out.

The PyEphem documentation:

http://rhodesmill.org/pyephem/radec.html

describes how to perform the conversion the other way around, from a Body and an Observer objects to Apparent Topocentric Position, with elevation and azimuth in the .alt and .az attributes.

However how should I, instead, start from Elevation and Azimuth and get RA and Dec?

For example here is one set of coordinates for which I’d like to get RA and Dec in Equatorial reference frame:

az = 3.30084818 #rad
el = 0.94610742 #rad
lat = 34.64 #deg
lon = -103.7 #deg
alt = 35800.26 #m
ut = 2455822.20000367 #julian date

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:09:16+00:00Added an answer on May 28, 2026 at 8:09 am

    There are two subtleties here. First, you have happened to use “elevation” and “altitude” to mean the opposite of what the two terms mean in the PyEphem library — so you are calling the spot in the sky its “elevation / azimuth” position instead of its “altitude / azimuth” position. Second, it appears that PyEphem has forgotten to provide an easy way to convert dates from Julian to its own format. While there is a function julian_date() that will go the other direction, we will have to do a bit of work ourselves to go the other direction by figuring out what ephem‘s name is for.

    With those stipulations in mind, I think this script might answer your question:

    import ephem
    
    az = 3.30084818 #rad
    el = 0.94610742 #rad
    lat = 34.64 #deg
    lon = -103.7 #deg
    alt = 35800.26 #m
    ut = 2455822.20000367 #julian date
    
    # Which Julian Date does Ephem start its own count at?
    J0 = ephem.julian_date(0)
    
    observer = ephem.Observer()
    observer.lon = str(lon)  # str() forces deg -> rad conversion
    observer.lat = str(lat)  # deg -> rad
    observer.elevation = alt
    observer.date = ut - J0
    
    print observer.date
    print observer.radec_of(az, el)
    

    Does the answer it produces look correct for this particular observation? Here is what the script prints for me:

    2011/9/17 16:48:00
    (9:16:24.95, -0:45:56.8)
    

    Let me know if that makes physical sense for this particular observation, or if one of the numbers is wrong here and still needs to be tweaked!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I guess this is quite basic, but I am struggling with getting data (in
I have quite a few RewriteRules in my .htaccess that looks like this RewriteRule
This looks simple but I am confused: The way I create a vector of
This looks like a long shot, but does anyone know of a way to:
Has anyone used TUDBC ? This looks interesting, but I wonder how valuable it
Not quite sure how to phrase this, but will do my best. I have
This question is related to (but perhaps not quite the same as): Does Django
Have a look a this simple example. I don't quite understand why o1 prints
I want to know what this looks like. I don't have any ideas about
Okay. I know this looks like the typical Why didn't he just Google it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.