pyephem | Scientific-grade astronomy routines for Python | Dataset library
kandi X-RAY | pyephem Summary
kandi X-RAY | pyephem Summary
Scientific-grade astronomy routines for Python
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pyephem
pyephem Key Features
pyephem Examples and Code Snippets
Community Discussions
Trending Discussions on pyephem
QUESTION
I'm refactoring some old code that used PyEphem to use Skyfield, and I'm getting a slight difference in the results of the GHA/dec of a body.
...ANSWER
Answered 2022-Apr-11 at 18:34It looks like you are asking Skyfield for astrometric positions, but PyEphem for apparent positions. According to the PyEphem documentation:
"g_ra and ra — Apparent geocentric right ascension for the epoch-of-date"
https://rhodesmill.org/pyephem/quick.html#body-compute-date
Whereas with Skyfield, you have to call the .apparent()
method on a position to learn the corresponding apparent position; it does not happen automatically:
https://rhodesmill.org/skyfield/positions.html#barycentric-astrometric-apparent
See if that change eliminates most of the difference between coordinates.
QUESTION
I copied the script from this post and modified it for a location near me. But when I run it, I'm getting nonsense times for sunrise, sunset, and astronomical twilight even after adjusting for the local UTC offset (-7h). For example, it's reporting sunrise at 03:34:51 UTC, which would be 20:34:51 the previous day. In reality, sunrise at this lat/long should be 06:37 PDT (UTC - 7h).
I've included my modified code below. What am I doing wrong?
...ANSWER
Answered 2022-Mar-31 at 13:06Check whether you have reversed your latitude and longitude. By swapping those numbers, you have asked about a different location on the Earth’s surface than you intended.
QUESTION
i generate random positions above the horizon(az=0-360,alt=0-90)in az/alt and calculate them withradec_to()
to RA and DEC. to check the result i retransform them.
so what i don't understand is, why i get around half of coordinates back under the horizon?
...ANSWER
Answered 2021-Jun-09 at 16:10You are providing floating point numbers to radec_of()
, and PyEphem interprets floating point numbers as radians, not degrees. Only when numbers are supplied as strings does it interpret them as degrees. So you could try either:
QUESTION
I am following these instructions on measuring crater height in my own moon images: http://www.astro.ex.ac.uk/obs/experiments/lunar/script.html
They require me to calculate the sub-Earth and sub-Solar points on the Moon when the image was taken. Is there a way to do this in Skyfield? I can only find reference to this being done for sub-Solar points on the Earth using pyephem.
...ANSWER
Answered 2020-Nov-10 at 02:26The Skyfield documentation describes getting the lunar longitude and latitude of the sub-Earth point here:
https://rhodesmill.org/skyfield/planetary.html#computing-lunar-libration
It looks like if instead of (earth - moon)
you also did the same thing but with the difference (sun - moon)
, you would get the sub-solar point on the Moon. I’d suggest trying each of those out, and seeing if the values you get back match example values from some other authority you could check against to make sure you're getting values that mean the same thing.
(And, if that approach works, let me know by responding here with a comment, and I'll update the documentation to add a heading to that page of the docs that explicitly mentions the word “sub-Earth point” or “sub-solar point” — since I don’t think the word “libration” makes it obvious to folks needing sub-points that the section will answer their question.)
QUESTION
I'm trying to calculate ancient phenomena for Babylon before the year 0. And I'm able to get something that aligns with known records from Pyephem, but I'd like to use Skyfield since that seems to be the more modern library. However, when I try and translating working code from Pyephem to Skyfield I get radically different results. I'm not sure if there's an issue with the dates themselves, or if the calculations are wrong.
A quick Jupyter Notebook of the to procedures can be found here: https://gist.github.com/willismonroe/ae49480cd4cb1c21c5a214a70eb6f3d6
...ANSWER
Answered 2020-Sep-12 at 23:05A rough back-of-the-envelope calculation would suggest that the Moon, circling the sky in 29 days, moves about 360° ÷ 29 ≈ 12½ degrees per day.
Your Skyfield script therefore has a problem: it only prints the date if the Moon’s longitude relative to the sun is between 6° and 14°, a range only 14 − 6 = 8° wide. In some months, its 12½° jump happens to land in that narrow 8° range, and some months it jumps entirely over it instead. That is why the Skyfield script only prints some months but not others.
The PyEphem script, by contrast, takes the angle in radians and multiplies by 30, turning the range 0…6.28 into the range 0…188.4. Very roughly, the unit of measure you are using is a “double degree” with 188 of them to the full circle. The Moon only jumps about 6¼ “double degrees” per day, so it is guaranteed to land in your 6-to-14 range at least once each month, because a jump of 6¼ is not enough to jump fully over the range.
My guess is that you should try an approach of choosing an exact degree angle that’s of interest to you, like 6°, and then write a little routine to find exactly the date and time it crosses that threshold each month. Here’s an example that should hopefully get you started:
QUESTION
I cannot resolve why I am getting a different azimuth/altitude for a comet calculation between PyEphem and Skyfield, yet the right ascension and declination match.
Code example:
...ANSWER
Answered 2020-Jul-22 at 13:46If you try printing out the PyEphem observer location:
QUESTION
I've only begun using PyEphem today so I'm at a bit of a loss as to why I get such incredibly incorrect results when I try to calculate the solar altitude and azimuth from an observer point. The code is really simple so I can't imagine where it's going wrong:
...ANSWER
Answered 2020-Jun-26 at 21:45Set your lat
& lon
as strings and format the alt
& az
as strings:
QUESTION
I'm trying to figure out the position of the moon given an observer in a lunar orbit. I have searched the internet already, but cannot find if PyEphem has this capability. Any suggestions?
...ANSWER
Answered 2020-Jun-15 at 11:45PyEphem does not, alas, have that capability.
QUESTION
I have a daily time series with DateTime
index. I want to calculate the sunrise and sunset times for each day in the DataFrame. The result will be presented in columns rise
and set
. Below is my script using pyephem:
ANSWER
Answered 2020-Jan-03 at 23:19From the front page of the docs:
PyEphem does not interoperate with NumPy and so is awkward to use in a modern IPython Notebook.
This basically means that the next_rising
and next_setting
methods can only operate on scalars. The quick and dirty solution is to write a loop to convert each element of your index to a compatible format and compute the values that way:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyephem
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page