{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Ionosphere Space Weather\n\nThis space weather example plots a filled contour of rotated pole point\ndata with a shaded relief image underlay. The plot shows aggregated\nvertical electron content in the ionosphere.\n\nThe plot exhibits an interesting outline effect due to excluding data\nvalues below a certain threshold.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nimport numpy.ma as ma\n\nimport iris\nimport iris.plot as iplt\nimport iris.quickplot as qplt\n\n\ndef main():\n    # Load the \"total electron content\" cube.\n    filename = iris.sample_data_path(\"space_weather.nc\")\n    cube = iris.load_cube(filename, \"total electron content\")\n\n    # Explicitly mask negative electron content.\n    cube.data = ma.masked_less(cube.data, 0)\n\n    # Plot the cube using one hundred colour levels.\n    qplt.contourf(cube, 100)\n    plt.title(\"Total Electron Content\")\n    plt.xlabel(\"longitude / degrees\")\n    plt.ylabel(\"latitude / degrees\")\n    plt.gca().stock_img()\n    plt.gca().coastlines()\n\n    iplt.show()\n\n\nif __name__ == \"__main__\":\n    main()"
      ]
    }
  ],
  "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.10.6"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}