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 8376497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:26:42+00:00 2026-06-09T15:26:42+00:00

I am trying to locate the moon positons (Altitude and Azimuth) using python’s ephem

  • 0

I am trying to locate the moon positons (Altitude and Azimuth) using python’s ephem module and comparing it to a lookup table for apparent moon positions for my location. I am noticing a significant difference in the values that i obtain for the angles. Here is my test code.

>>> o = ephem.Observer()
>>> o.lat = 39.2545
>>> o.lon = -76.7095
>>> o.elevation = 80
>>> o.date = datetime.datetime.utcnow()
>>> print o.date
2012/8/13 21:00:55
>>> m = ephem.Moon(o)
>>> import math
>>> azimuth = math.degrees(m.az)
>>> azimuth
286.2894281178355
>>> alt = math.degrees(m.alt)
>>> alt
19.35235063580148

Now, compare these angles to the lookup table values:

       Date/Time             Zenith         Azimuth
2012 Aug 13 21:00:00.0      88.45125       294.56966
2012 Aug 13 21:20:00.0      91.82583       297.59090

Note: Alt = 90 – Zenith. So our zenith value would be: 70.64764

My question is, why is there a difference? The lookup table gives the apparent angles. Does that have anything to do with it?

  • 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-06-09T15:26:43+00:00Added an answer on June 9, 2026 at 3:26 pm

    Your problem is that you are accidentally offering the lat and lon values in radians, because when PyEphem is given a floating-point number it always assumes that you are doing “raw math” and submitting values in radians:

    >>> o.lat = 39.2545
    >>> o.lon = -76.7095
    

    If you instead want to provide degrees and have PyEphem translate, you can either provide strings:

    >>> o.lat = '39.2545'
    >>> o.lon = '-76.7095'
    

    Or you can provide numbers that you compute using a math function, if that helps you keep everything straight, since the PyEphem practice of converting strings to numbers is not a standard Python idiom, whereas everyone will understand math.radians() when reading your code:

    >>> o.lat = math.radians(39.2545)
    >>> o.lon = math.radians(-76.7095)
    

    The observer that you were actually asking about with those large radian values was at the location 89:07:01.8° N, 284:52:09.8° E which is extremely near the North Pole.

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

Sidebar

Related Questions

Using Selenium IDE, I am trying to locate a link within a table row.
I am trying to locate leaks using instruments, but the leaks I see there
I am trying to locate dependencies of each EmguCv dll using a decompiler. However
im trying to locate the position of the minimum value in a vector, using
I am trying to locate the first <th> element under a <table> element. The
Using the following Powershell code, I'm trying to locate folders which do NOT contain
I am trying to locate in the HL7 Stream for the segment that will
I am trying to locate a key in a HashMap. I can print the
I'm trying to locate the number of matches in a relative path for directory
Im trying to parse the string located in /proc/stat in a linux filesystem using

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.