skyfielders / python-skyfield

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

I'm working on a astronomy program but I found some problem with SkyField's Time #667

Closed Ram3k333 closed 2 years ago

Ram3k333 commented 2 years ago
from skyfield.api import load
ts = load.timescale()
t = ts.utc(2021, 12, 1, 00,00,00)

OutPut ----

<Time tt=2459549.500800741>

But output should be

[<Time tt=2459549.5>]
brandon-rhodes commented 2 years ago

(I've edited your text to put triple-backticks around the code and output — until I did so, the output <Time…> was invisible because it was being turned into an HTML tag. You'll probably want to read an introduction to GitHub Markdown.)

The tt= means Terrestrial Time, which is a different time scale from UTC and so is different by several dozen seconds. Try calling ts.tt(2021, 12, 1, 00,00,00) instead if you want an exact match for the TT that is output when you print it.

Ram3k333 commented 2 years ago

Thank You Sir for giving your time.

brandon-rhodes commented 2 years ago

You're welcome!