Skip to content

Add planetary maps and geometry improvements

Benoit Seignovert requested to merge geometry-improvements into main

Added

  • New MARS, SATURN, ENCELADUS, TITAN, URANUS, NEPTUNE, PLUTO and CHARON planetary maps.
from moon_coverage import MARS, SATURN, ENCELADUS, TITAN, URANUS, NEPTUNE, PLUTO, CHARON

The new maps are also available in MAPS:

from moon_coverage import MAPS

MAPS
{'MERCURY': <Map> Mercury | Radius 2439.7 km,
 'VENUS': <Map> Venus | Radius 6051.8 km,
 'EARTH': <Map> Earth | Radius 6371.0 km,
 'MOON': <Map> Moon | Radius 1737.4 km,
 'MARS': <Map> Mars | Radius 3389.5 km,
 'JUPITER': <Map> Jupiter | Radius 69911.3 km,
 'IO': <Map> Io | Radius 1821.5 km,
 'EUROPA': <Map> Europa | Radius 1560.8 km,
 'GANYMEDE': <Map> Ganymede | Radius 2631.2 km,
 'CALLISTO': <Map> Callisto | Radius 2410.3 km,
 'SATURN': <Map> Saturn | Radius 58232.0 km,
 'ENCELADUS': <Map> Enceladus | Radius 252.1 km,
 'TITAN': <Map> Titan | Radius 2574.8 km,
 'URANUS': <Map> Uranus | Radius 25362.2 km,
 'NEPTUNE': <Map> Neptune | Radius 24622.2 km,
 'PLUTO': <Map> Pluto | Radius 1195.0 km,
 'CHARON': <Map> Charon | Radius 605.0 km}

All theses maps are featured in the documentation. The text and notes were updated as well.

  • In Jupyter/IPython environment, all the planetary maps have a PNG representation (_repr_png_()) to be displayed directly.

  • New west longitude ticks representation (ax.set_lon_ticks('west')) and secondary axis ticks display (ax.set_lon_ticks(secondary=True) and ax.set_lat_ticks(secondary=True)).

fig = plt.figure(figsize=(12, 9))
ax = fig.add_subplot(projection=MARS)

ax.plot([180, 150, 120, 150, 180], [30, 50, 30, 10, 30], 'o-')  # Always east longitude

ax.set_lon_ticks('west')
ax.set_lon_ticks('east', secondary=True)
ax.set_lat_ticks(secondary=True)

Mars with secondary axis

Note: the input values in ax.plot(lons_e, lats) must be in east longitudes, even if the required ticks representation is 'west'.

  • New planetographic() and ocentric2ographic() helper functions to compute planetographic coordinates from cartesian and planetocentric coordinates:
from moon_coverage.spice import ocentric2ographic

lon_w, lat = ocentric2ographic('MARS', 90, 45)  # east longitude, latitude

lon_w, lat  # west longitudes for MARS
(270.0, 45.33789641791753)

Comments on planetocentric vs. planetographic coordinates were reported in the docs.

  • SpiceRef objects now expose an .encode() function.
>>> SpiceRef('MARS').encode()
b'MARS'

Changed

  • Map.map() no longer support Matplotlib axes input to use build-in projection system.

Fixed

  • Path projection with crossing the pole on the edge of equirectangular maps.
  • Solar longitude now supports SpiceBody objects input (fix #47 (closed) error).

Close #46 (closed), #47 (closed) and #48 (closed).

Merge request reports