Debian Codegraph @

docs/faq/iers.rst

raw ◀ ▶
1 Debian patch touch this file
1 .. doctest-skip-all
2
3 .. _iers:
4
5 **************************************************
6 What are the IERS tables and how do I update them?
7 **************************************************
8
9 Contents
10 ========
11
12 * :ref:`iers-Background`
13 * :ref:`iers-What_are_IERS_Bulletins_A_and_B`
14 * :ref:`iers-How_do_I_get_IERS_Bulletin_A_for_astroplan?`
15
16 .. _iers-Background:
17
18 Background
19 ==========
20
21 Keeping accurate, consistent time systems is rough. We intuitively want
22 time to be described by a continuous cyclic clock like the clock on your
23 wall or the calendar, but the Earth's rate of rotation varies measurably
24 on human timescales. As a result, the time measured by an atomic clock and
25 the time that you would infer from measuring how long it has been since the
26 last solar noon are constantly becoming offset from one another with
27 stochastic changes in Earth's moment of inertia and slowly acting tidal forces.
28
29 For this reason, there is a time system that keeps track of seconds like an
30 atomic clock, TAI, a more commonly used one that works like an atomic clock
31 with a varying offset of some integer number of seconds, UTC, and one that
32 matches up with the Earth's rotation, UT1. The difference between UT1 and UTC is
33 constantly changing as the Earth's rotation changes and as leap seconds get
34 added to UTC to compensate.
35
36 In order to accurately predict the apparent position of a celestial object from
37 the Earth, for example in altitude and azimuth coordinates, one needs to know
38 the orientation of the Earth at any point in time, and since the Earth's
39 rotation does not change in a predictable way, we must rely on observations
40 of the Earth's orientation as a function of time to accurately calculate
41 UT1-UTC.
42
43 .. _iers-What_are_IERS_Bulletins_A_and_B:
44
45 What are IERS Bulletins A and B?
46 ================================
47
48 The `International Earth Rotation and Reference Systems Service (IERS)
49 <http://www.iers.org/>`_ is responsible for measuring the Earth's orientation as
50 a function of time, and making predictions for the Earth's orientation in the
51 near future (accounting for scheduled leap seconds). The data products released
52 by the IERS used by astroplan are the IERS Bulletins A and B.
53
54 * IERS Bulletin B is a table with Earth orientation observations from the last
55 few decades up through nearly the present time. `Astropy <https://astropy.org>`__ relies on IERS B to
56 compute UT1-UTC, and by default will raise an error if you try to compute
57 UT1-UTC for a time that is outside the bounds of the IERS Bulletin B table
58 (see the `Astropy <https://astropy.org>`__ docs on the `UT1/UTC transformation offsets
59 <http://astropy.readthedocs.io/en/latest/time/index.html?highlight=iers#transformation-offsets>`_
60 for more details), like this::
61
62 >>> from astropy.time import Time
63 >>> Time('2040-01-01', scale='utc').ut1 # Convert from UTC to UT1
64 IndexError: (some) times are outside of range covered by IERS table.
65
66 * IERS Bulletin A encompasses the observations of recent Earth orientation
67 contained in Bulletin B, while also making extrapolations into the past,
68 before the Bulletin B tables begin, and into the future, after the Bulletin
69 B tables end. The future predictions include leap second additions scheduled
70 to be added.
71
72 Let's plot the UT1-UTC from IERS Bulletins A and B to show the difference using
73 astropy's IERS machinery:
74
75 .. plot::
76
77 import matplotlib.pyplot as plt
78 import numpy as np
79 import astropy.units as u
80 from astropy.time import Time
•81 from urllib.error import HTTPError
82
83 # Download and cache the IERS Bulletins A and B using astropy's machinery
84 # (reminder: astroplan has its own function for this: `download_IERS_A`)
85 from astropy.utils.iers import (IERS_A, IERS_A_URL, IERS_B, IERS_B_URL,
86 FROM_IERS_B, IERS_Auto)
87 from astropy.utils.data import download_file
88 # Workaround until astropy/astropy#5194 is solved
89 iers_a = IERS_Auto.open()
90 iers_b = IERS_B.open(download_file(IERS_B_URL, cache=True))
91
92 # Get a range of times to plot from 1990-2022
93 time_range = Time("1990-01-01") + np.arange(0, 30, 0.2)*u.year
94
95 # Calculate the difference between UTC and UT1 at those times,
96 # allowing times "outside of the table"
97 DUT1_a, success_a = time_range.get_delta_ut1_utc(return_status=True,
98 iers_table=iers_a)
99 DUT1_b, success_b = time_range.get_delta_ut1_utc(return_status=True,
100 iers_table=iers_b)
101
102 # Compare input times to the times available in the table. For details, see
103 # https://docs.astropy.org/en/stable/utils/iers.html
104 measurements_from_b = (success_b == FROM_IERS_B)
105
106 # Make a plot of the time difference
107 fig, ax = plt.subplots(figsize=(10,8))
108 ax.axhline(0, color='gray', ls='--', lw=2)
109
110 ax.plot_date(time_range.plot_date,
111 DUT1_a, '-', lw=2, label='IERS Bulletin A + extrapolation')
112 ax.plot_date(time_range.plot_date[measurements_from_b],
113 DUT1_b[measurements_from_b], 'r--', lw=2, label='IERS Bulletin B')
114 ax.set(xlabel='Year', ylabel='UT1-UTC [seconds]')
115 ax.legend(loc='upper right')
116 plt.show()
117
118
119 .. _iers-How_do_I_get_IERS_Bulletin_A_for_astroplan?:
120
121 How do I get IERS Bulletin A for astroplan?
122 ===========================================
123
124 Without downloading IERS Bulletin A, astroplan simply approximates UT1-UTC=0
125 always. This will lead to lower precision position and time calculations
126 on the order of arcseconds or seconds, and allow you to handle times in the
127 far future and distant past.
128
129 To download the IERS Bulletin A table for the first time, or to refresh the
130 cached version that you already have, simply run::
131
132 from astroplan import download_IERS_A
133 download_IERS_A()
134