{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# This example is part of the planetary-coverage examples gallery.\n# More examples can be found here: https://docs.planetary-coverage.org"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "JUICE cruise trajectory\n=======================\n\nExample of interplanetary cruise trajectory.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n\nfrom planetary_coverage import TourConfig\nfrom planetary_coverage.ticks import date_ticks, km_ticks"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Compute the distance to Jupiter during the cruise phase\n=======================================================\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "tour = TourConfig(mk='5.1 150lb', spacecraft='JUICE', target='JUPITER', version='v400')\n\ntraj = tour['2023-04-06': '2031-06-01': '1 day']\n\ntraj"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig = plt.figure(figsize=(10, 7))\nax = fig.add_subplot()\n\nax.plot(traj.utc, traj.dist)\n\nax.set_ylabel('JUICE distance to JUPITER')\nax.xaxis.set_major_formatter(date_ticks)\nax.yaxis.set_major_formatter(km_ticks)\n\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "::: {.admonition}\nDownload\n\n-   `juice_cruise.ipynb`{.interpreted-text role=\"download\"}\n-   `juice_cruise.py`{.interpreted-text role=\"download\"}\n:::\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.8.15"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}