{
  "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": [
        "Callisto flybys groundtrack\n===========================\n\nExample of representation of all the groundtrack during the Callisto\nflybys.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n\nfrom planetary_coverage import CALLISTO, TourConfig"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Search all the Callisto flybys between 2032 and 2034\n====================================================\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "tour = TourConfig(mk='5.1 150lb', spacecraft='JUICE', target='Callisto', version='v400')\n\nflybys = tour['2032-06-01':'2034-06-30':'6 h'].flybys\n\nflybys"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Represent the flybys on a map\n=============================\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig = plt.figure(figsize=(12, 9))\nax = fig.add_subplot(projection=CALLISTO)\n\nfor flyby in flybys:\n    ax.plot(flyby.where(flyby.alt < 20_000), 'inc', lw=3, vmin=0, vmax=90, cbar=False)\n\n    ax.plot(flyby.ca, 'o', color='lightgrey')\n    ax.text(*flyby.ca.lonlat, f'{flyby.date_ca}\\n',\n            color='lightgrey', va='baseline', ha='center')\n\nax.colorbar(vmin=0, vmax=90, label='inc', extend='max')\nax.set_title('Callisto flybys in 2032 and 2034')\n\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "::: {.admonition}\nDownload\n\n-   `callisto_flybys.ipynb`{.interpreted-text role=\"download\"}\n-   `callisto_flybys.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
}