question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

almanac.seasons, Vernal Equinox, the Sun's declination is nonzero

See original GitHub issue

Hello Brandon

I’m getting a time of the vernal equinox and the corresponding Sun’s equatorial coordinates as follows:

#!/usr/bin/env python3
from skyfield import api, almanac
from skyfield.searchlib import find_discrete

ts = api.load.timescale()
eph = api.load('de421.bsp')
t1 = ts.utc(2021, 1, 1)
t2 = ts.utc(2021, 12, 31)
timings, seasons = find_discrete(t1, t2, almanac.seasons(eph))
for ti, si in zip(timings, seasons):
    if si == 0:  # Vernal Equinox
        e = eph['Earth'].at(ti)
        ra, dec, _ = e.observe(eph['Sun']).apparent().radec(ts.J2000)
        print(ti.utc_iso(), ra, dec)
        break

Output:

2021-03-20T09:37:29Z 23h 58m 54.91s -00deg 07' 03.8"

Shouldn’t the declination be zero?

I’d like to spare your time, just let me know if this is an expected result?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrey-nakincommented, Jan 28, 2021

Your rough_period might be a bit too aggressive

Fixed. Thank you, Brandon!

1reaction
brandon-rhodescommented, Jan 26, 2021

Thanks for jumping in with advice, @JoshPaterson!

I’m not sure why it isn’t exactly 0.

It’s because the ecliptic is merely the average plane of the Earth’s orbit, not the plane of its orbit in any given year. When Jupiter and Saturn are below the ecliptic plane, as they are this year, the Sun must balance them by riding above the plane. The Earth, having very small mass compared to the giants, rides along with the sun into positive z-axis territory above the ecliptic plane.

As it happens, the Earth is currently not quite as far above the ecliptic plane as the Sun is. Try this at the bottom of your script:

for planet in 'Sun', 'Earth', 'Jupiter barycenter', 'Saturn barycenter':
    a = eph[planet].at(ti)
    x, y, z = a.frame_xyz(framelib.ecliptic_frame).km.astype(int)
    print(planet, 'ecliptic Z coordinate:', z, 'km')

It prints:

Sun ecliptic Z coordinate: 18310 km
Earth ecliptic Z coordinate: 18090 km
Jupiter barycenter ecliptic Z coordinate: -9392393 km
Saturn barycenter ecliptic Z coordinate: -13674124 km

So the Sun is 18310 - 18090 = 220 km above us at the moment relative to the plane of the ecliptic. How big an angle does that subtend when viewed from Earth? Let’s print the Earth-Sun distance:

print(int(e.observe(eph['Sun']).apparent().distance().km))

Which is:

148985261

Dividing the Sun’s distance above us (relative to the ecliptic) by the distance between us, we should expect the Sun to have a positive ecliptic longitude of atan(220 / 148985261) / tau * 360 * 3600 = 0.30458219 arcseconds, which is the same value your program now prints.

I’ll go ahead and close this issue, as I think all your questions are now resolved, but please comment with any further responses or questions!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vernal Equinox -- from Eric Weisstein's World of Astronomy
Here is a QuickTime movie illustrating the tilt of the Earth's equatorial plane relative to the Sun which is responsible for the seasons....
Read more >
The Seasons, the Equinox, and the Solstices
The Equinox (Vernal & Autumnal). There are only two times of the year when the Earth's axis is tilted neither toward nor away...
Read more >
First Day of Spring 2022: Celebrate the Spring Equinox
Spring 2022 begins on Sunday, March 20! This date marks the spring equinox and the astronomical first day of spring around the Northern...
Read more >
Equinox - Wikipedia
In the Northern Hemisphere, the March equinox is called the vernal or spring equinox while the September equinox is called the autumnal or...
Read more >
Vernal Equinox | StarDate Online
They measure the positions of astronomical objects using coordinates called right ascension and declination — the equivalent of longitude and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found