Timezone in get_body()

Hi!
It’s not so clear for me: should I use local time or UTC time for Time of observation in astropy.coordinates.get_body() when I point out my location?

Example: get coordinates of Jupiter, Mexico City at local time 2024-02-29 at 18:00 (UTC-6)

body = ‘jupiter’

lon = -99.133209
lat = 19.432608
location = EarthLocation.from_geodetic(lon, lat)

loc_time = 2024-02-29T18:00:00.000 (UTC/GMT -6 hours)
utc_time = 2024-03-01T00:00:00.000

What is correct:
get_body(body , loc_time , location)
or
get_body(body , utc_time , location)
?

When using astropy.coordinates.get_body() , it’s typically best to provide the time in UTC. Astropy’s time handling is generally based on UTC, which helps maintain consistency across different systems and avoids potential confusion with time zones. So, in your case, you should use get_body(body, utc_time, location) to get the coordinates of Jupiter for Mexico City at the specified time.

2 Likes