Search code examples
pythonpython-2.7datetimeutcastropy

How to convert UTC and longitude to mean solar local time python


I am trying to convert my UTC time and longitude into a mean solar local time in python.

Inputs:

utc = ['2000-08-20 07:15:12.000']  #utc time

lon = [-89.91054415]               #longitude

I used astropy.time to get my utc time which is a string.


Solution

  • Explanatory Supplement to the Astronomical Almanac 3rd ed. page 239 states that the local mean solar time, LMSoT, is related to UT and the observer's east longitude by

    LMSoT = UT + ƛ

    UT is usually taken to mean UT1. To convert UTC to UT1 refer to Bulletin A at https://www.iers.org/IERS/EN/DataProducts/EarthOrientationData/eop.html

    For 2016/08/27 UT1 - UTC = -0.243031. Original poster is only working to milliseconds, so round to -0.243. 2016/08/27 19:19:00.000 UTC = 19:18:59.757 UT1.

    Boston latitude, -71.03°, converted to time, = -4 h 44 m 7.200 s

    Boston LMSoT = 19:18:59.757 - 4:44:7.2000 = 14:34:52.557

    The original poster could simplify the procedure, depending on the actual accuracy needed. In particular, UTC is always within 0.9 s of UT1, so if accuracy to the second is not required, the step of looking up UT1 - UTC could be skipped.