def teme_to_itrs_mat(time): # Sidereal time, rotates from ITRS to mean equinox # Use 1982 model for consistency with Vallado et al (2006) # http://www.celestrak.com/publications/aiaa/2006-6753/AIAA-2006-6753.pdf gst = erfa.gmst82(*get_jd12(time, 'ut1')) # Polar Motion # Do not include TIO locator s' because it is not used in Vallado 2006 xp, yp = get_polar_motion(time) pmmat = erfa.pom00(xp, yp, 0) # rotation matrix # c2tcio expects a GCRS->CIRS matrix as it's first argument. # Here, we just set that to an I-matrix, because we're already # in TEME and the difference between TEME and CIRS is just the # rotation by the sidereal time rather than the Earth Rotation Angle return erfa.c2tcio(np.eye(3), gst, pmmat)
def _gmst82_angle(obstime): """ Universal Time to Greenwich mean sidereal time (IAU 1982 model). Parameters ---------- obstime : Time time at which the polar motion should be calculated. Returns ------- float Greenwich mean sidereal time (radians) """ # Get GMST82 angle in rad # noinspection PyArgumentList gmst82 = erfa.gmst82(*get_jd12(obstime, "ut1")) * u.rad return gmst82
# Mean obliquity EPSA = erfa.obl80(DJMJD0, TT) # Build the rotation matrix RN = erfa.numat(EPSA, DPSI, DEPS) # Combine the matrices: PN = N x P RNPB = erfa.rxr(RN, RP) print("NPB matrix, equinox based:") pprint(RNPB) # Equation of the equinoxes, including nutation correction EE = erfa.eqeq94(DJMJD0, TT) + DDP80 * math.cos(EPSA) # Greenwich apparent sidereal time (IAU 1982/1994). GST = erfa.anp(erfa.gmst82(DJMJD0 + DATE, TUT) + EE) print("GST = %.17f radians" % GST) print(" = %.17f degrees" % math.degrees(GST)) print(" = %s%dd%dm%d.%ds" % erfa.a2af(6, GST)) print(" = %s%dh%dm%d.%ds" % erfa.a2tf(6, GST)) # Form celestial-terrestrial matrix (no polar motion yet). ##RC2TI = erfa.cr(RNPB) ##RC2TI = erfa.rz(GST, RC2TI) RC2TI = erfa.rz(GST, RNPB) print("celestial to terrestrial matrix (no polar motion)") pprint(RC2TI) # Polar motion matrix (TIRS->ITRS, IERS 1996). RPOM = erfa.ir() RPOM = erfa.rx(-YP, RPOM)
# Mean obliquity EPSA = erfa.obl80(DJMJD0, TT) # Build the rotation matrix RN = erfa.numat(EPSA, DPSI, DEPS) # Combine the matrices: PN = N x P RNPB = erfa.rxr(RN, RP) print("NPB matrix, equinox based:") pprint(RNPB) # Equation of the equinoxes, including nutation correction EE = erfa.eqeq94(DJMJD0, TT) + DDP80 * math.cos(EPSA) # Greenwich apparent sidereal time (IAU 1982/1994). GST = erfa.anp(erfa.gmst82(DJMJD0+DATE, TUT) + EE) print("GST = %.17f radians"%GST) print(" = %.17f degrees"%math.degrees(GST)) print(" = %s%dd%dm%d.%ds"%erfa.a2af(6, GST)) print(" = %s%dh%dm%d.%ds"%erfa.a2tf(6, GST)) # Form celestial-terrestrial matrix (no polar motion yet). ##RC2TI = erfa.cr(RNPB) ##RC2TI = erfa.rz(GST, RC2TI) RC2TI = erfa.rz(GST, RNPB) print("celestial to terrestrial matrix (no polar motion)") pprint(RC2TI) # Polar motion matrix (TIRS->ITRS, IERS 1996). RPOM = erfa.ir() RPOM = erfa.rx(-YP, RPOM)