skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.4k stars 211 forks source link

Calculate the Julian Date #683

Closed blucobalto closed 2 years ago

blucobalto commented 2 years ago

Hello, I have a problem calculating the Julian date.

In Nasa Horizons Web I enter the following data for the date -1967/05/06 16:40:00 and requesting the Julian Date and DeltaT as a result:

Time Specification:

Start = BC1967-MAY-06 16:40 UT,
Stop = BC1967-MAY-07 16:40,
Step = 1 (days)

The result is:

$$ SOE
b1967-May-06 16:40 1003102.194444444 45277.088073
b1967-May-07 16:40 1003103.194444444 45277.022772
$$ EOE

If I insert the result 1003102.194444444 in the "JD Date / Time Converter" tool I get the following result: Calendar Date / Time: -1966-05-06 16:40:00

In Skyfield I enter: jd = julian_date (-1967,5,6,16,40,0) The result of jd is: 1002754.1944444445

If I enter: jd = julian_date (-1966,5,6,16,40,0) The result of jd is: 1003119.1944444445

In any case I cannot reproduce the value of the Horizons. I don't understand where I'm wrong.

Please, any idea?

Thanks a lot, Blu

brandon-rhodes commented 2 years ago

My guess would be that NASA is using the old Julian calendar of ancient Rome, whereas the documentation of Skyfield's julian_date() states Given a proleptic Gregorian calendar date and time, build a Julian date — it uses the Gregorian calendar all the way back through history, because Skyfield is based on Naval Observatory practices more than on NASA practices. You can read about the difference in calendars here:

https://rhodesmill.org/skyfield/time.html#ancient-and-modern-dates

blucobalto commented 2 years ago

Clear documentation, thanks.

Blu

brandon-rhodes commented 2 years ago

I'm glad it helped!