Пример #1
0
def test_polar_motion_unsupported_dates():
    msg = r'Tried to get polar motions for times {} IERS.*'

    with pytest.warns(AstropyWarning, match=msg.format('before')):
        get_polar_motion(Time('1900-01-01'))

    with pytest.warns(AstropyWarning, match=msg.format('after')):
        get_polar_motion(Time('2100-01-01'))
Пример #2
0
def cirs_to_gcrs(time):
    # compute the polar motion p-matrix
    xp, yp = get_polar_motion(time)
    sp = erfa.sp00(*get_jd12(time, "tt"))
    pmmat = erfa.pom00(xp, yp, sp)

    # now determine the Earth Rotation Angle for the input obstime
    # era00 accepts UT1, so we convert if need be
    era = erfa.era00(*get_jd12(time, "ut1"))

    # c2tcio expects a GCRS->CIRS matrix, but we just set that to an I-matrix
    # because we're already in CIRS
    return erfa.c2tcio(np.eye(3), era, pmmat)
Пример #3
0
def _polar_mot_matrix(obstime):
    """
    Form the matrix of polar motion for a given date, IAU 2000.

    The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning that it is the final rotation when computing the
    pointing direction to a celestial source.

    Parameters
    ----------
    obstime : Time
        time at which the polar motion should be calculated.
    Returns
    -------
        3x3 rotation matrix due to polar motion
    """
    # compute the polar motion p-matrix
    xp, yp = get_polar_motion(obstime)
    sp = erfa.sp00(*get_jd12(obstime, 'tt'))
    polar_mot_mat = erfa.pom00(xp, yp, sp)

    return polar_mot_mat
Пример #4
0
from astropy.coordinates.builtin_frames.utils import get_polar_motion
from astropy.time import Time
import astropy.units as u
import numpy as np
import matplotlib.pyplot as plt

t = Time('2010-01-01T00:00') + np.linspace(0, 10 * 365, 5000) * u.day
xp, yp = get_polar_motion(t)

fig = plt.figure(figsize=(6, 5))
ax = fig.add_subplot(111, projection='3d')

ax.plot(np.rad2deg(xp) * 3600, np.rad2deg(yp) * 3600, t.mjd)

ax.set_xlabel(r'$x_p \,\,/\,\, \mathrm{as}$')
ax.set_ylabel(r'$y_p \,\,/\,\, \mathrm{as}$')

years = np.arange(2010, 2021, 1)
ticks = Time([f'{y}-01-01T00:00' for y in years])
ax.set_zticks(ticks.mjd)
ax.set_zticklabels(years.astype(str))

ax.view_init(elev=20, azim=45)

fig.tight_layout()
fig.savefig('build/polar_motion.pdf')