Binary PCK Hands-On Lesson (IDL) |
Table of ContentsBinary PCK Hands-On Lesson (IDL) Overview Note About HTML Links References Tutorials Required Readings The Permuted Index Icy API Documentation Kernels Used Icy Modules Used Moon rotation (mrotat) Task Statement Learning Goals Approach Solution Solution Meta-Kernel Solution Source Code Solution Sample Output Earth rotation (erotat) Task Statement Learning Goals Approach Solution Solution Meta-Kernel Solution Source Code Solution Sample Output Binary PCK Hands-On Lesson (IDL)
Overview
Note About HTML Links
In order for the links to be resolved, create a subdirectory called ``lessons'' under the ``doc/html'' directory of the Toolkit tree and copy this document to that subdirectory before loading it into a Web browser. ReferencesTutorials
Name Lesson steps/routines it describes --------------- ----------------------------------------- Frames Moon Rotation, Earth Rotation PCK Moon Rotation, Earth Rotation ``High Accuracy Orientation and Body-Fixed frames for Moon and Earth'' (backup) Moon Rotation, Earth RotationThese tutorials are available from the NAIF ftp server at JPL:
http://naif.jpl.nasa.gov/naif/tutorials.html Required Readings
Name Lesson steps/routines that it describes --------------- ----------------------------------------- time.req Time Conversion spk.req Obtaining Ephemeris Data frames.req Using Reference Frames pck.req Obtaining Planetary Constants Data The Permuted Index
This text document provides a simple mechanism to discover what Icy procedures perform a particular function of interest as well as the name of the source module that contains the procedure. Icy API Documentation
For example, the document
icy/doc/html/icy/cspice_str2et.htmldescribes the cspice_str2et routine. Kernels Used
# FILE NAME TYPE DESCRIPTION -- ------------------------- ---- ------------------------ 1 naif0008.tls LSK Generic LSK 2 de414_2000_2020.bsp SPK Solar System Ephemeris 3 earthstns_itrf93_050714.bsp SPK DSN station Ephemeris 4 pck00008.tpc PCK NAIF text PCK 5 earth_000101_070725_070503.bpc PCK Earth binary PCK 6 moon_pa_de403_1950-2198.bpc PCK Moon binary PCK 7 earth_topo_050714.tf FK Earth topocentric FK 8 moon_060721.tf FK Lunar FKThese SPICE kernels are included in the lesson package available from the NAIF server at JPL:
ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Lessons/ Icy Modules Used
CHAPTER EXERCISE FUNCTIONS NON-VOID KERNELS ------- --------- ------------- ---------- ------- 1 mrotat cspice_furnsh dpr_c 1,2,4,6,8 cspice_kclear vdist_c cspice_reclat vsep_c cspice_spkpos cspice_str2et cspice_subpnt 2 erotat cspice_furnsh cspice_dpr 1-5,7 cspice_kclear cspice_spd cspice_pxform cspice_twopi cspice_reclat cspice_vdist cspice_str2et cspice_vsep cspice_spkpos cspice_subslr cspice_timoutRefer to the Icy HTML API documentation pages located under ``icy/doc/html/icy'' for detailed interface specifications of these procedures. Moon rotation (mrotat)Task Statement
Learning Goals
Approach
SolutionSolution Meta-Kernel
KPL/MK Meta-kernel for the ``Moon Rotation'' task in the Binary PCK Hands On Lesson. \begindata KERNELS_TO_LOAD = ( 'kernels/lsk/naif0008.tls' 'kernels/spk/de414_2000_2020.bsp' 'kernels/fk/moon_060721.tf' 'kernels/pck/pck00008.tpc' 'kernels/pck/moon_pa_de403_1950-2198.bpc' ) \begintext Solution Source Code
PRO mrotat ;; ;; Local parameters ;; METAKR = 'mrotat.tm' ;; ;; Load the kernels this program requires. ;; cspice_furnsh, METAKR ;; ;; Convert our UTC string to seconds past J2000 TDB. ;; timstr = '2007 jan 1 00:00:00' cspice_str2et, timstr, et ;; ;; Look up the apparent position of the Earth relative ;; to the Moon's center in the IAU_MOON frame at ET. ;; cspice_spkpos, 'earth', et, 'iau_moon', $ 'lt+s', 'moon', imoonv, ltime ;; ;; Express the Earth direction in terms of longitude ;; and latitude in the IAU_MOON frame. ;; cspice_reclat, imoonv, r, lon, lat print print, FORMAT='(A)', $ 'Moon-Earth direction using low accuracy' print, FORMAT='(A)', 'PCK and IAU_MOON frame:' print, FORMAT= '(A,F15.6)', 'Earth lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Earth lat (deg): ', $ lat*cspice_dpr() print ;; ;; Look up the apparent position of the Earth relative ;; to the Moon's center in the MOON_ME frame at ET. ;; cspice_spkpos, 'earth', et, 'moon_me', $ 'lt+s', 'moon', mmoonv, ltime ;; ;; Express the Earth direction in terms of longitude ;; and latitude in the MOON_ME frame. ;; cspice_reclat, mmoonv, r, lon, lat print, FORMAT='(A)', $ 'Moon-Earth direction using high accuracy' print, FORMAT='(A)', 'PCK and MOON_ME frame:' print, FORMAT= '(A,F15.6)', 'Earth lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Earth lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the angular separation of the Earth position ;; vectors in degrees. ;; sep = cspice_dpr() * cspice_vsep( imoonv, mmoonv ) print, 'For IAU_MOON vs MOON_ME frames:' print, FORMAT= '(A,F15.6)', $ 'Moon-Earth vector separation angle (deg): ', sep print ;; ;; Look up the apparent position of the Earth relative ;; to the Moon's center in the MOON_PA frame at ET. ;; cspice_spkpos, 'earth', et, 'moon_pa', $ 'lt+s', 'moon', pmoonv, ltime ;; ;; Express the Earth direction in terms of longitude ;; and latitude in the MOON_PA frame. ;; cspice_reclat, pmoonv, r, lon, lat print, FORMAT='(A)', $ 'Moon-Earth direction using high accuracy' print, FORMAT='(A)', 'PCK and MOON_PA frame:' print, FORMAT= '(A,F15.6)', 'Earth lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Earth lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the angular separation of the Earth position ;; vectors in degrees. ;; sep = cspice_dpr() * cspice_vsep( pmoonv, mmoonv ) print, 'For MOON_PA vs MOON_ME frames:' print, FORMAT= '(A,F15.6)', $ 'Moon-Earth vector separation angle (deg): ', sep print ;; ;; Find the apparent sub-Earth point on the Moon at ET using ;; the Moon body-fixed frame MOON_ME. ;; cspice_subpnt, 'near point: ellipsoid', $ 'moon', et, 'moon_me', 'lt+s', $ 'earth', msub, trgepc, srfvec ;; ;; Display the sub-point in latitudinal coordinates. ;; cspice_reclat, msub, r, lon, lat print, FORMAT='(A)', $ 'Sub-Earth point on Moon using high accuracy' print, FORMAT='(A)', 'PCK and MOON_ME frame:' print, FORMAT= '(A,F15.6)', 'Sub-Earth lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Sub-Earth lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the apparent sub-Earth point on the Moon at ET using ;; the Moon body-fixed frame MOON_PA. ;; cspice_subpnt, 'near point: ellipsoid', $ 'moon', et, 'moon_pa', 'lt+s', $ 'earth', psub, trgepc, srfvec ;; ;; Display the sub-point in latitudinal coordinates. ;; cspice_reclat, psub, r, lon, lat print, FORMAT='(A)', $ 'Sub-Earth point on Moon using high accuracy' print, FORMAT='(A)', 'PCK and MOON_PA frame:' print, FORMAT= '(A,F15.6)', 'Sub-Earth lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Sub-Earth lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the distance between the sub-Earth points ;; in km. ;; dist = cspice_vdist( msub, psub ) print, FORMAT= '(A,F15.6)', $ 'Distance between sub-Earth points (km): ', dist ;; ;; Unload all kernels. ;; cspice_kclear END Solution Sample Output
Moon-Earth direction using low accuracy PCK and IAU_MOON frame: Earth lon (deg): 3.613102 Earth lat (deg): -6.438342 Moon-Earth direction using high accuracy PCK and MOON_ME frame: Earth lon (deg): 3.611229 Earth lat (deg): -6.439501 For IAU_MOON vs MOON_ME frames: Moon-Earth vector separation angle (deg): 0.002194 Moon-Earth direction using high accuracy PCK and MOON_PA frame: Earth lon (deg): 3.593319 Earth lat (deg): -6.417582 For MOON_PA vs MOON_ME frames: Moon-Earth vector separation angle (deg): 0.028235 Sub-Earth point on Moon using high accuracy PCK and MOON_ME frame: Sub-Earth lon (deg): 3.611419 Sub-Earth lat (deg): -6.439501 Sub-Earth point on Moon using high accuracy PCK and MOON_PA frame: Sub-Earth lon (deg): 3.593509 Sub-Earth lat (deg): -6.417582 Distance between sub-Earth points (km): 0.856182 Earth rotation (erotat)Task Statement
For each of the two epochs ET and ET + 100 days, examine the differences between the axes of the ITRF93 and IAU_EARTH frames using the following method:
Find the azimuth and elevation of the apparent position of the Moon as seen from the DSN station DSS-13 by the following steps:
Learning Goals
Understanding of topocentric frames and computation of target geometry relative to a surface location on the Earth. Knowledge of SPICE kernels required to support such computations. Approach
SolutionSolution Meta-Kernel
KPL/MK Meta-kernel for the ``Earth Rotation'' task in the Binary PCK Hands On Lesson. \begindata KERNELS_TO_LOAD = ( 'kernels/lsk/naif0008.tls' 'kernels/spk/de414_2000_2020.bsp' 'kernels/spk/earthstns_itrf93_050714.bsp' 'kernels/fk/earth_topo_050714.tf' 'kernels/pck/pck00008.tpc' 'kernels/pck/earth_000101_070725_070503.bpc' ) \begintext Solution Source Code
PRO erotat ;; ;; Local parameters ;; METAKR = 'erotat.tm' TIMLEN = 35 ;; ;; Other constants ;; x = [ 1.d, 0.d, 0.d ] z = [ 0.d, 0.d, 1.d ] ;; ;; Load the kernels this program requires. ;; cspice_furnsh, METAKR ;; ;; Convert our UTC string to seconds past J2000 TDB. ;; timstr = '2007 jan 1 00:00:00' cspice_str2et, timstr, et ;; ;; Look up the apparent position of the Moon relative ;; to the Earth's center in the IAU_EARTH frame at ET. ;; cspice_spkpos, 'moon', et, 'iau_earth', $ 'lt+s', 'earth', lmoonv, ltime ;; ;; Express the Moon direction in terms of longitude ;; and latitude in the IAU_EARTH frame. ;; cspice_reclat, lmoonv, r, lon, lat print print, FORMAT='(A)', $ 'Earth-Moon direction using low accuracy' print, FORMAT='(A)', 'PCK and IAU_EARTH frame:' print, FORMAT= '(A,F15.6)', 'Moon lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Moon lat (deg): ', $ lat*cspice_dpr() print ;; ;; Look up the apparent position of the Moon relative ;; to the Earth's center in the ITRF93 frame at ET. ;; cspice_spkpos, 'moon', et, 'itrf93', $ 'lt+s', 'earth', hmoonv, ltime ;; ;; Express the Moon direction in terms of longitude ;; and latitude in the ITRF93 frame. ;; cspice_reclat, hmoonv, r, lon, lat print, FORMAT='(A)', $ 'Earth-Moon direction using high accuracy' print, FORMAT='(A)', 'PCK and ITRF93 frame:' print, FORMAT= '(A,F15.6)', 'Moon lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Moon lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the angular separation of the Moon position ;; vectors in degrees. ;; sep = cspice_dpr() * cspice_vsep( lmoonv, hmoonv ) print, FORMAT= '(A,F15.6)', $ 'Earth-Moon vector separation angle (deg): ', sep print ;; ;; Next, express the +Z and +X axes of the ITRF93 frame in ;; the IAU_EARTH frame. We'll do this for two times: ET ;; and ET + 100 days. ;; for i = 0, 1 do begin ;; ;; Set the time, expressing the time delta in ;; seconds. ;; t = et + i*cspice_spd()*100 ;; ;; Convert the TDB time T to a string for output. ;; cspice_timout, T, $ 'YYYY-MON-DD HR:MN:SC.### (UTC)', $ TIMLEN, $ OUTSTR print, 'Epoch: ', OUTSTR ;; ;; Find the rotation matrix for conversion of position ;; vectors from the IAU_EARTH to the ITRF93 frame. ;; cspice_pxform, 'iau_earth', 'itrf93', t, rmat itrfx = rmat[*,0] itrfz = rmat[*,2] ;; ;; Display the angular offsets of the ITRF93 +X and +Z ;; axes from their IAU_EARTH counterparts. ;; sep = cspice_vsep ( itrfx, x ) print, FORMAT= '(A,F13.6)', $ 'ITRF93 - IAU_EARTH +X axis separation angle ' + $ '(deg): ', sep * cspice_dpr() sep = cspice_vsep ( itrfz, z ) print, FORMAT= '(A,F13.6)', $ 'ITRF93 - IAU_EARTH +Z axis separation angle ' + $ '(deg): ', sep * cspice_dpr() print endfor ;; ;; Find the azimuth and elevation of the apparent ;; position of the Moon in the local topocentric ;; reference frame at the DSN station DSS-13. ;; First look up the Moon's position relative to the ;; station in that frame. ;; cspice_spkpos, 'moon', et, 'dss-13_topo', $ 'lt+s', 'dss-13', topov, ltime ;; ;; Express the station-Moon direction in terms of ;; longitude and latitude in the DSS-13_TOPO frame. ;; cspice_reclat, topov, r, lon, lat ;; ;; Convert to azimuth/elevation. ;; az = -lon if az LT 0 then begin az += cspice_twopi() endif el = lat print, FORMAT='(A)', $ 'DSS-13-Moon az/el using high accuracy ' + $ 'PCK and DSS-13_TOPO frame:' print, FORMAT= '(A,F15.6)', 'Moon Az (deg): ', $ az * cspice_dpr() print, FORMAT= '(A,F15.6)', 'Moon El (deg): ', $ el * cspice_dpr() print ;; ;; Find the sub-solar point on the Earth at ET using the ;; Earth body-fixed frame IAU_EARTH. Treat the Sun as ;; the observer. ;; cspice_subslr, 'near point: ellipsoid', $ 'earth', et, 'iau_earth', 'lt+s', $ 'sun', lsub, trgepc, srfvec ;; ;; Display the sub-point in latitudinal coordinates. ;; cspice_reclat, lsub, r, lon, lat print, FORMAT='(A)', $ 'Sub-Solar point on Earth using low accuracy' print, FORMAT='(A)', 'PCK and IAU_EARTH frame:' print, FORMAT= '(A,F15.6)', 'Sub-Solar lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Sub-Solar lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the sub-solar point on the Earth at ET using the ;; Earth body-fixed frame ITRF93. Treat the Sun as ;; the observer. ;; cspice_subslr, 'near point: ellipsoid', $ 'earth', et, 'itrf93', 'lt+s', $ 'sun', hsub, trgepc, srfvec ;; ;; Display the sub-point in latitudinal coordinates. ;; cspice_reclat, hsub, r, lon, lat print, FORMAT='(A)', $ 'Sub-Solar point on Earth using high accuracy' print, FORMAT='(A)', 'PCK and ITRF93 frame:' print, FORMAT= '(A,F15.6)', 'Sub-Solar lon (deg): ', $ lon*cspice_dpr() print, FORMAT= '(A,F15.6)', 'Sub-Solar lat (deg): ', $ lat*cspice_dpr() print ;; ;; Find the distance between the sub-solar point ;; vectors in km. ;; dist = cspice_vdist( lsub, hsub ) print, FORMAT= '(A,F15.6)', $ 'Distance between sub-solar points (km): ', dist ;; ;; Unload all kernels. ;; cspice_kclear END Solution Sample Output
Earth-Moon direction using low accuracy PCK and IAU_EARTH frame: Moon lon (deg): -35.496272 Moon lat (deg): 26.416959 Earth-Moon direction using high accuracy PCK and ITRF93 frame: Moon lon (deg): -35.554286 Moon lat (deg): 26.419156 Earth-Moon vector separation angle (deg): 0.052002 Epoch: 2007-JAN-01 00:00:00.000 (UTC) ITRF93 - IAU_EARTH +X axis separation angle (deg): 0.057677 ITRF93 - IAU_EARTH +Z axis separation angle (deg): 0.002326 Epoch: 2007-APR-10 23:59:59.998 (UTC) ITRF93 - IAU_EARTH +X axis separation angle (deg): 0.057787 ITRF93 - IAU_EARTH +Z axis separation angle (deg): 0.002458 DSS-13-Moon az/el using high accuracy PCK and DSS-13_TOPO frame: Moon Az (deg): 72.169006 Moon El (deg): 20.689488 Sub-Solar point on Earth using low accuracy PCK and IAU_EARTH frame: Sub-Solar lon (deg): -177.100621 Sub-Solar lat (deg): -22.910377 Sub-Solar point on Earth using high accuracy PCK and ITRF93 frame: Sub-Solar lon (deg): -177.157963 Sub-Solar lat (deg): -22.912593 Distance between sub-solar points (km): 5.881861 |