# Mars ephemeris validation against JPL Horizons **Result: from 13 sites on Mars (1971-2040), our Sun and Earth directions agree with JPL Horizons to 0.0029 arcsec at worst (Sun 0.0010", Earth 0.0029") over 322 rows with the rigorous skyfield chain, and to 0.0055 arcsec with the browser tables. The target was 1 arcsec.** The only larger values (5 rows, up to 1.31") are the Earth and the Moon at the 2023-11-18 solar conjunction, when they are behind the solar disk as seen from Mars (not visible; see finding 3). ![Mars vs Horizons](../figures/mars_vs_horizons.png) *Left: per-row differences, ours − Horizons, in milliarcseconds. Right: why the up convention matters on Mars: the Sun's elevation with radial up minus the elevation over the ellipsoid normal (Horizons, a spirit level, and Moonat's Mars default since phase 2a), over one sol.* ## What was compared - **Ours (direct):** skyfield 1.55 + JPL DE421 (Mars = segment 4 -> 499) + the IAU 2015 Mars rotation (Archinal et al. 2018, coded in `moonat.ephem.iau`, every coefficient checked against NAIF `pck00011.tpc`). The site is fixed in IAU_MARS; skyfield computes the apparent position from the site itself (light time, deflection by the Sun, Jupiter and Saturn, aberration with the site's barycentric velocity including Mars' rotation). Code: `moonat.ephem.direct.sky_state(body="mars")`. - **Ours (table):** the browser tables `web/data/ephem/mars/` (C1, 1971, 1976-1982, 1997-1998 and 2004-2040, 6 h step) + the topocentric transform of `moonat.ephem.table`, which is exactly what the JavaScript does (web/tests/physics_mars.test.mjs: JS = Python to 2.8e-10 deg). - **Horizons:** `CENTER='coord@499'`, `COORD_TYPE='CYLINDRICAL'`, `SITE_COORD='-E-lon,Dxy,Dz'`, `QUANTITIES='4,10,13,20,21,23,24'`, `APPARENT='AIRLESS'`, UT time scale, `EXTRA_PREC='YES'`. Cached responses: `tests/fixtures/horizons_mars/` (45 files, `scripts/fetch_horizons_mars.py`). **Like-for-like check (from the Horizons response headers):** `Center pole/equ : IAU_MARS {West-longitude positive}`, `Center radii : 3396.19, 3396.19, 3376.2 km`, Mars centre from `mar099`, target from DE441, `Rel. light bend : Sun`, `Atmos refraction: NO (AIRLESS)`. Three conventions differ from ours and were matched: 1. **Longitude:** Horizons takes Mars longitudes **west-positive**; an east longitude is entered as a negative number (77.45°E -> `-77.45`, echoed as `282.55` W-lon). 2. **Site position:** we send our planetocentric site as cylindrical coordinates (Dxy = r cos lat, Dz = r sin lat), so Horizons uses exactly our point. 3. **Up:** Horizons measures elevation from "a plane perpendicular to the reference surface local zenith direction", i.e. the normal of the 3396.19 x 3376.2 km ellipsoid (planetographic up). Since phase 2a this is also Moonat's default on Mars (the Moon keeps radial up), and the comparison uses `up="geodetic"`; the radial result is the same direction expressed in a frame tilted by the latitude gap (tested: 1e-9 deg). Horizons echoes the planetographic latitude and height of each site; ours (`topo.planetographic_from_vector`) agree to its printed 1e-7 deg and 10 m: | site | planetocentric lat (ours) | E lon | radius (km) | planetographic lat (Horizons echo) | gap (deg) | |---|---|---|---|---|---| | Jezero | 18.4446 | 77.4509 | 3391.95 | 18.6487299 | +0.2041 | | Gale | -4.5895 | 137.4417 | 3391.49 | -4.6438454 | -0.0543 | | Hellas Planitia | -42.4000 | 70.5000 | 3380.09 | -42.7377156 | -0.3377 | | Planum Boreum | 86.0000 | 20.0000 | 3373.79 | 86.0468341 | +0.0468 | | Viking 1 | 22.2697 | 312.0486 | 3390.19 | 22.5081598 | +0.2385 | | Mars | -45.0000 | 202.0000 | 3394.69 | -45.3373812 | -0.3374 | | Viking | 47.6673 | 134.2809 | 3391.69 | 48.0032412 | +0.3359 | | Mars | 19.0972 | 326.7461 | 3392.49 | 19.3074123 | +0.2102 | | Spirit | -14.5719 | 175.4785 | 3394.29 | -14.7375060 | -0.1656 | | Opportunity | -1.9483 | 354.4742 | 3394.79 | -1.9714309 | -0.0231 | | Phoenix | 68.2184 | 234.2487 | 3392.09 | 68.4496099 | +0.2312 | | InSight | 4.5024 | 135.6234 | 3393.59 | 4.5556895 | +0.0533 | | Zhurong | 25.0660 | 109.9250 | 3392.09 | 25.3266258 | +0.2606 | Sites: Jezero (Perseverance), Gale (Curiosity), Hellas Planitia (mid-latitude, the largest latitude gap), Planum Boreum (north polar cap), Viking 1 at its 1976 landing, and (phase 2a) nine more landing sites at their landing epochs and half a sol later (Mars 3 1971, Viking 2 1976, Pathfinder 1997, Spirit and Opportunity 2004, Phoenix 2008, Curiosity 2012, InSight 2018, Zhurong 2021), plus Gale at seven times inside leap-second intervals. Heights are rough local surface radii relative to the 3396.19 km sphere. Epochs: 2021-02-18 20:55 (Perseverance landing), 2023-11-18 (solar conjunction), 2025-01-16 (opposition), 2026-11-15 12:00, 2030-05-25 12:00 (conjunction), 2033-06-27, 2040-12-31 21:00, plus one sol at 1 h steps from 2026-11-15 00:00 per site and body. Planets: Jezero at the seven epochs. ## Maximum differences (ours − Horizons), bodies visible from the site "Sky error" is the great-circle angle between the two directions. | method | body | rows | max sky error (arcsec) | max \|Δel\| (arcsec) | max \|Δdist\| (km) | max \|Δdiam\| (arcsec) | max \|Δphase\| | |---|---|---|---|---|---|---|---| | direct | sun | 163 | 0.0010 | 0.0010 | 0.072 | 0.0005 | – | | direct | earth | 159 | 0.0029 | 0.0029 | 0.479 | 0.0000 | 4.5e-05 | | direct | mercury | 7 | 0.0039 | 0.0031 | 0.903 | – | – | | direct | venus | 7 | 0.0009 | 0.0008 | 0.520 | – | – | | direct | moon | 6 | 0.0029 | 0.0029 | 0.480 | – | – | | direct | jupiter | 7 | 0.0416 | 0.0413 | 171.456 | – | – | | direct | saturn | 7 | 0.0293 | 0.0287 | 303.311 | – | – | | table | sun | 163 | 0.0045 | 0.0044 | 0.514 | 0.0005 | – | | table | earth | 159 | 0.0055 | 0.0055 | 2.327 | 0.0000 | 4.5e-05 | | table | mercury | 7 | 3.5400 | 3.5399 | – | – | – | | table | venus | 7 | 3.5811 | 3.5811 | – | – | – | | table | moon | 6 | 7.6745 | 7.6745 | – | – | – | | table | jupiter | 7 | 1.1940 | 1.1940 | – | – | – | | table | saturn | 7 | 0.6243 | 0.6236 | – | – | – | ## The epochs (Sun and Earth, direct) | site | body | UTC | Horizons az (°) | Horizons el (°) | Δaz·cos el (arcsec) | Δel (arcsec) | table Δsky (arcsec) | |---|---|---|---|---|---|---|---| | jezero | sun | 2021-02-18T20:55 | 258.53972 | 36.96733 | -0.0000 | -0.0004 | 0.0006 | | jezero | sun | 2023-11-18T00:00 | 5.68402 | -58.98355 | +0.0003 | +0.0003 | 0.0002 | | jezero | sun | 2025-01-16T00:00 | 265.55857 | 54.58241 | +0.0001 | -0.0005 | 0.0007 | | jezero | sun | 2026-11-15T12:00 | 76.39759 | -10.41397 | +0.0004 | +0.0006 | 0.0007 | | jezero | sun | 2030-05-25T12:00 | 262.62875 | -5.78470 | -0.0002 | -0.0009 | 0.0009 | | jezero | sun | 2033-06-27T00:00 | 78.36487 | -43.04254 | +0.0000 | +0.0009 | 0.0007 | | jezero | sun | 2040-12-31T21:00 | 226.43268 | 58.73105 | +0.0010 | -0.0004 | 0.0014 | | jezero | earth | 2021-02-18T20:55 | 255.08992 | -1.43003 | -0.0002 | -0.0004 | 0.0006 | | jezero | earth (behind the Sun) | 2023-11-18T00:00 | 5.84618 | -59.01948 | +1.2005 | -0.5145 | 1.3050 | | jezero | earth | 2025-01-16T00:00 | 261.11149 | 54.96491 | +0.0001 | -0.0013 | 0.0011 | | jezero | earth | 2026-11-15T12:00 | 44.71545 | -35.01284 | +0.0004 | +0.0006 | 0.0007 | | jezero | earth | 2030-05-25T12:00 | 262.81495 | -5.80901 | -0.0002 | -0.0006 | 0.0018 | | jezero | earth | 2033-06-27T00:00 | 74.06283 | -44.16040 | +0.0001 | +0.0029 | 0.0029 | | jezero | earth | 2040-12-31T21:00 | 221.34673 | 58.89820 | +0.0006 | -0.0002 | 0.0012 | | gale | sun | 2021-02-18T20:55 | 270.73865 | -21.70971 | -0.0002 | -0.0004 | 0.0004 | | gale | sun | 2023-11-18T00:00 | 78.62549 | -27.36350 | -0.0003 | +0.0003 | 0.0003 | | gale | sun | 2025-01-16T00:00 | 282.14149 | -7.13920 | -0.0001 | -0.0006 | 0.0005 | | gale | sun | 2026-11-15T12:00 | 72.48261 | 43.61131 | -0.0000 | +0.0007 | 0.0008 | | gale | sun | 2030-05-25T12:00 | 243.33401 | -60.05066 | -0.0008 | -0.0005 | 0.0007 | | gale | sun | 2033-06-27T00:00 | 93.35692 | 16.15973 | -0.0004 | +0.0008 | 0.0010 | | gale | sun | 2040-12-31T21:00 | 266.85227 | 8.13107 | +0.0003 | -0.0010 | 0.0012 | | gale | earth | 2021-02-18T20:55 | 239.36302 | -51.64583 | -0.0004 | -0.0001 | 0.0004 | | gale | earth (behind the Sun) | 2023-11-18T00:00 | 78.67674 | -27.28443 | +0.6490 | +1.1282 | 1.3050 | | gale | earth | 2025-01-16T00:00 | 279.84079 | -5.91592 | -0.0004 | -0.0012 | 0.0013 | | gale | earth | 2026-11-15T12:00 | 67.68584 | 5.95751 | -0.0002 | +0.0006 | 0.0009 | | gale | earth | 2030-05-25T12:00 | 243.56918 | -60.19610 | -0.0005 | -0.0003 | 0.0009 | | gale | earth | 2033-06-27T00:00 | 90.99754 | 13.75891 | -0.0013 | +0.0025 | 0.0028 | | gale | earth | 2040-12-31T21:00 | 265.37214 | 10.32820 | +0.0002 | -0.0006 | 0.0010 | | hellas | sun | 2021-02-18T20:55 | 306.15696 | 29.57705 | -0.0004 | -0.0001 | 0.0006 | | hellas | sun | 2023-11-18T00:00 | 187.59132 | -59.29748 | -0.0003 | -0.0003 | 0.0002 | | hellas | sun | 2025-01-16T00:00 | 327.03051 | 28.47520 | -0.0005 | -0.0002 | 0.0007 | | hellas | sun | 2026-11-15T12:00 | 97.75495 | -21.91775 | -0.0003 | +0.0006 | 0.0006 | | hellas | sun | 2030-05-25T12:00 | 266.03829 | 8.72984 | -0.0009 | -0.0003 | 0.0009 | | hellas | sun | 2033-06-27T00:00 | 132.98011 | -31.07458 | -0.0009 | +0.0002 | 0.0008 | | hellas | sun | 2040-12-31T21:00 | 336.63783 | 48.74748 | -0.0008 | -0.0006 | 0.0014 | | hellas | earth | 2021-02-18T20:55 | 266.03159 | 17.42146 | -0.0004 | -0.0000 | 0.0006 | | hellas | earth (behind the Sun) | 2023-11-18T00:00 | 187.42778 | -59.26128 | -1.1962 | +0.5197 | 1.3050 | | hellas | earth | 2025-01-16T00:00 | 327.06634 | 31.06706 | -0.0013 | -0.0002 | 0.0012 | | hellas | earth | 2026-11-15T12:00 | 119.04640 | -56.40660 | -0.0006 | +0.0004 | 0.0006 | | hellas | earth | 2030-05-25T12:00 | 266.10981 | 8.55719 | -0.0006 | -0.0001 | 0.0016 | | hellas | earth | 2033-06-27T00:00 | 133.67535 | -34.33308 | -0.0028 | +0.0005 | 0.0029 | | hellas | earth | 2040-12-31T21:00 | 339.05709 | 50.87478 | -0.0005 | -0.0003 | 0.0012 | | boreum | sun | 2021-02-18T20:55 | 174.12165 | 6.33222 | +0.0004 | -0.0002 | 0.0005 | | boreum | sun | 2023-11-18T00:00 | 306.16948 | 9.91036 | +0.0003 | +0.0003 | 0.0004 | | boreum | sun | 2025-01-16T00:00 | 158.48014 | 16.27752 | +0.0006 | -0.0001 | 0.0006 | | boreum | sun | 2026-11-15T12:00 | 18.00211 | 5.52748 | +0.0007 | -0.0001 | 0.0007 | | boreum | sun | 2030-05-25T12:00 | 215.42962 | -5.59562 | +0.0008 | -0.0005 | 0.0009 | | boreum | sun | 2033-06-27T00:00 | 348.35364 | -8.38096 | +0.0009 | +0.0003 | 0.0009 | | boreum | sun | 2040-12-31T21:00 | 144.77646 | -0.53596 | +0.0009 | +0.0004 | 0.0012 | | boreum | earth | 2021-02-18T20:55 | 208.64124 | -11.11604 | +0.0003 | -0.0003 | 0.0006 | | boreum | earth (behind the Sun) | 2023-11-18T00:00 | 306.24761 | 9.86216 | +1.1083 | -0.6939 | 1.3052 | | boreum | earth | 2025-01-16T00:00 | 157.42085 | 13.89346 | +0.0013 | -0.0003 | 0.0012 | | boreum | earth | 2026-11-15T12:00 | 341.30651 | 17.85106 | +0.0007 | +0.0001 | 0.0008 | | boreum | earth | 2030-05-25T12:00 | 215.51757 | -5.43017 | +0.0005 | -0.0004 | 0.0015 | | boreum | earth | 2033-06-27T00:00 | 346.13652 | -5.91126 | +0.0027 | +0.0011 | 0.0029 | | boreum | earth | 2040-12-31T21:00 | 142.75295 | -2.22911 | +0.0006 | +0.0002 | 0.0009 | ## Mission years and leap seconds (phase 2a) Each landing site at its landing epoch (UTC at Mars) and half a sol later, and Gale at seven times inside the 6 h intervals that end at a leap second. Every row is inside a table year. Without the leap-second correction the worst table row here would be off by 14.6". | case | UTC | Horizons az (°) | Horizons el (°) | direct Δsky (arcsec) | table Δsky (arcsec) | |---|---|---|---|---|---| | mars3_sun_mission | 1971-12-02T13:50:35 | 278.01293 | 37.46220 | 0.0004 | 0.0006 | | mars3_sun_mission | 1971-12-03T02:10:00 | 127.85026 | -6.07831 | 0.0004 | 0.0008 | | mars3_earth_mission | 1971-12-02T13:50:35 | 242.19843 | 8.53764 | 0.0004 | 0.0005 | | mars3_earth_mission | 1971-12-03T02:10:00 | 99.42756 | 27.48640 | 0.0004 | 0.0007 | | viking2_sun_mission | 1976-09-03T22:37:50 | 118.67794 | 51.12564 | 0.0003 | 0.0003 | | viking2_sun_mission | 1976-09-04T10:58:00 | 325.72563 | -12.68334 | 0.0004 | 0.0004 | | viking2_earth_mission | 1976-09-03T22:37:50 | 138.44233 | 62.43720 | 0.0003 | 0.0003 | | viking2_earth_mission | 1976-09-04T10:58:00 | 341.49475 | -14.60552 | 0.0004 | 0.0005 | | pathfinder_sun_mission | 1997-07-04T16:56:55 | 55.31090 | -34.26014 | 0.0002 | 0.0003 | | pathfinder_sun_mission | 1997-07-05T05:17:00 | 271.26492 | 47.06786 | 0.0002 | 0.0001 | | pathfinder_earth_mission | 1997-07-04T16:56:55 | 64.55636 | 5.35770 | 0.0003 | 0.0003 | | pathfinder_earth_mission | 1997-07-05T05:17:00 | 293.57774 | 11.12992 | 0.0003 | 0.0002 | | spirit_sun_mission | 2004-01-04T04:26:00 | 268.40293 | 56.83138 | 0.0002 | 0.0003 | | spirit_sun_mission | 2004-01-04T16:46:00 | 127.70034 | -46.18484 | 0.0002 | 0.0003 | | spirit_earth_mission | 2004-01-04T04:26:00 | 247.61477 | 18.18261 | 0.0003 | 0.0001 | | spirit_earth_mission | 2004-01-04T16:46:00 | 118.04509 | -5.40900 | 0.0003 | 0.0003 | | opportunity_sun_mission | 2004-01-25T04:54:22 | 248.70937 | 70.79740 | 0.0001 | 0.0002 | | opportunity_sun_mission | 2004-01-25T17:14:00 | 120.75595 | -69.12932 | 0.0001 | 0.0002 | | opportunity_earth_mission | 2004-01-25T04:54:22 | 244.07594 | 30.85358 | 0.0003 | 0.0002 | | opportunity_earth_mission | 2004-01-25T17:14:00 | 117.90234 | -29.18846 | 0.0003 | 0.0004 | | phoenix_sun_mission | 2008-05-25T23:38:24 | 259.33582 | 30.55482 | 0.0003 | 0.0002 | | phoenix_sun_mission | 2008-05-26T11:58:00 | 61.24998 | 15.22100 | 0.0003 | 0.0003 | | phoenix_earth_mission | 2008-05-25T23:38:24 | 288.45681 | 11.42230 | 0.0002 | 0.0002 | | phoenix_earth_mission | 2008-05-26T11:58:00 | 95.50876 | 20.96373 | 0.0003 | 0.0002 | | gale_sun_mission | 2012-08-06T05:17:57 | 287.78681 | 33.71940 | 0.0002 | 0.0001 | | gale_sun_mission | 2012-08-06T17:38:00 | 78.62745 | -36.00218 | 0.0002 | 0.0002 | | gale_earth_mission | 2012-08-06T05:17:57 | 293.87691 | -2.58526 | 0.0003 | 0.0002 | | gale_earth_mission | 2012-08-06T17:38:00 | 66.08017 | -1.18813 | 0.0003 | 0.0003 | | insight_sun_mission | 2018-11-26T19:44:52 | 218.57165 | 54.85154 | 0.0005 | 0.0008 | | insight_sun_mission | 2018-11-27T08:05:00 | 131.13175 | -61.49658 | 0.0005 | 0.0006 | | insight_earth_mission | 2018-11-26T19:44:52 | 243.33078 | 15.10184 | 0.0005 | 0.0007 | | insight_earth_mission | 2018-11-27T08:05:00 | 114.20337 | -19.01715 | 0.0006 | 0.0004 | | zhurong_sun_mission | 2021-05-14T23:18:00 | 258.61633 | 63.32417 | 0.0005 | 0.0006 | | zhurong_sun_mission | 2021-05-15T11:38:00 | 34.77669 | -39.31701 | 0.0005 | 0.0003 | | zhurong_earth_mission | 2021-05-14T23:18:00 | 260.58103 | 35.91256 | 0.0003 | 0.0005 | | zhurong_earth_mission | 2021-05-15T11:38:00 | 65.07203 | -28.21634 | 0.0003 | 0.0001 | | gale_sun_leap | 1978-12-31T23:59:59 | 260.14236 | -2.02381 | 0.0002 | 0.0002 | | gale_sun_leap | 1981-06-30T22:00:00 | 99.86933 | -11.90352 | 0.0001 | 0.0011 | | gale_sun_leap | 1997-06-30T23:59:30 | 343.21532 | -78.56222 | 0.0002 | 0.0002 | | gale_sun_leap | 2015-06-30T23:59:59 | 95.53011 | -71.23191 | 0.0002 | 0.0000 | | gale_sun_leap | 2016-12-31T21:00:00 | 114.62775 | -8.88159 | 0.0004 | 0.0045 | | gale_sun_leap | 2016-12-31T23:59:59 | 114.64637 | 31.11942 | 0.0004 | 0.0005 | | gale_sun_leap | 2017-01-01T00:00:00 | 114.64775 | 31.12677 | 0.0004 | 0.0005 | | gale_earth_leap | 1978-12-31T23:59:59 | 260.62457 | -5.33869 | 0.0002 | 0.0002 | | gale_earth_leap | 1981-06-30T22:00:00 | 94.76185 | -24.98397 | 0.0001 | 0.0015 | | gale_earth_leap | 1997-06-30T23:59:30 | 56.08151 | -47.29826 | 0.0003 | 0.0003 | | gale_earth_leap | 2015-06-30T23:59:59 | 90.37031 | -73.76679 | 0.0001 | 0.0002 | | gale_earth_leap | 2016-12-31T21:00:00 | 115.90878 | 27.75604 | 0.0004 | 0.0055 | | gale_earth_leap | 2016-12-31T23:59:59 | 141.94852 | 63.44434 | 0.0004 | 0.0006 | | gale_earth_leap | 2017-01-01T00:00:00 | 141.96059 | 63.44931 | 0.0004 | 0.0006 | ## Findings 1. **The rotation model is the one Horizons uses.** With the IAU 2015 model (Archinal et al. 2018) the Sun agrees to a few milliarcseconds. Mars turns 14.6 arcsec per second, so this also confirms the time scales (UTC -> TT -> TDB) to well under 1 ms. The IAU 2009 model would differ by about 6.6 arcsec in prime meridian at J2000 alone. 2. **Radial up vs the ellipsoid normal.** Mars is flattened (1/170): the normal of the IAU ellipsoid differs from the radial direction by up to 0.338 deg (at 45° latitude; 0.20 deg at Jezero, 0.06 deg at 86°N). The right panel shows the effect on the Sun's elevation: up to ±0.34 deg, i.e. twice the Sun's angular radius seen from Mars (0.17 deg). Both are available: `up="geodetic"` (Horizons, a spirit level and what a lander's inclinometer sees; the Mars default since phase 2a) and `up="radial"` (the Moon's convention). See docs/research/mars.md §3.1. 3. **Behind the Sun.** On 2023-11-18 the Earth and the Moon were behind the solar disk as seen from Mars (Sun-Earth-Probe angle 0.13 deg: the line of sight passes 0.5 solar radii from the Sun's centre). There skyfield and Horizons treat the light bending through the Sun differently: 1.31 arcsec. The Earth is not visible then, so these rows are reported but not counted. On 2030-05-25 the line of sight grazes the limb at 1.04 solar radii and the agreement is back to milliarcseconds. 4. **Sun-Earth-Probe angle** (the direct-to-Earth link limit near solar conjunction): our SEP from the Mars-side apparent vectors agrees with Horizons' S-O-T for an observer at the Earth's centre to 0.0131 deg over 39 epochs (2030 conjunction daily). The difference is the aberration of the two observers and does not matter for a threshold of 2 deg. 5. **Distances and sizes.** Sun range within 0.1 km, Earth within 0.5 km (DE421 vs DE441 and mar099). Angular diameters agree to Horizons' printed 0.001 arcsec with R_sun = 695 700 km and R_earth = 6378.137 km (the C6 radii). The Earth's disk from Mars spans 6.5 arcsec (2.68 au, superior conjunction near aphelion) to 47 arcsec (0.37 au). 6. **Phase.** The Earth's illuminated fraction (1 + cos a)/2 agrees with `Illu%` within 1e-4; Horizons' S-T-O includes the down-leg aberration, so it differs from our phase angle by a few arcsec. 7. **Planets from the tables** are unit vectors from Mars' centre (no parallax): up to 8 arcsec for the Earth's Moon, 3.6 arcsec for Venus. Far below a pixel of the sky view. ## Table interpolation (C1, Mars) Step 6.0 h, years 1971-2040, 9.62 MB. The Sun and Earth are stored in ICRS (Mars turns 88 deg in 6 h, so body-fixed vectors would not interpolate) with the ICRS -> IAU_MARS quaternion; slerp is exact for a uniform spin about a fixed axis. Measured against direct skyfield (5038 times, including the first and last interval of every year and every interval that holds a leap second): Sun 0.0045", Earth 0.0058" (more than 0.5 deg from the Sun; 0.98" when it is behind the solar disk, 1998-05-12), rotation 0.0075". The topocentric directions from the tables agree with direct skyfield within 0.01 arcsec at random sites and times (`tests/test_mars_ephem.py`), including the site's diurnal aberration (Mars' equator moves at 0.24 km/s: up to 0.17 arcsec, applied in the table path). ## Known approximations (for the consumers) - **No refraction.** Mars' atmosphere bends light by about 0.005 deg at the horizon (0.009 deg on the floor of Hellas; docs/research/mars.md §2.1); like Horizons (AIRLESS) we do not model it. - **Leap seconds.** POSIX time (JS `Date`) has no 23:59:60, so the 6 h interval that ends at the midnight after a leap second lasts 6 h + 1 s. The manifest lists these 14 intervals (`leap_seconds`: 13 leap seconds and the 1972-01-01 UTC step of 0.107758 s) and both readers use the interval's true length there (`moonat.ephem.table.leap_fraction`): 0.006 arcsec instead of up to 14.6 arcsec (Mars turns 14.6 arcsec per second). None fall in 2020-2040 as known in 2026; a new one needs a rebuild. - **Heights** are relative to the 3396.19 km sphere, not to the areoid that MOLA "elevations" use; the difference reaches about 20 km at the poles (it moves the Sun by less than 0.02 arcsec of parallax, but terrain must use radii; docs/research/mars.md). ## Reproduce ``` uv run python scripts/fetch_horizons_mars.py # only for missing responses uv run python scripts/build_ephem_tables.py --body mars --check-per-year 100 uv run python scripts/validate_mars_ephem.py # this page and the figure uv run pytest tests/test_mars_ephem.py ```