{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Magnetic Poles\n", "## drift between 2010-01-01 and 2020-01-01\n", "\n", "The calucation uses the Fortran libraty of Emmert et al.[2010[1] and wrapped by the [apexpy](https://apexpy.readthedocs.io/en/latest/readme.html) Python package.\n", "\n", "[1] Emmert, J. T., A. D. Richmond, and D. P. Drob (2010),\n", " A computationally compact representation of Magnetic-Apex\n", " and Quasi-Dipole coordinates with smooth base vectors,\n", " J. Geophys. Res., 115(A8), A08322,\n", " [doi:10.1029/2010JA015326](http://dx.doi.org/10.1029/2010JA015326)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from apexpy import Apex\n", "\n", "def qd2geo(time, qdlat, qdlon, height=0, precision=1e-5):\n", " \"\"\" Get geographic coordinates for the given QD coordinates. \"\"\"\n", " apex = Apex(time)\n", " lat, lon, error = apex.qd2geo(qdlat, qdlon, height, precision)\n", " if error > precision:\n", " raise RuntimeError(\n", " \"The result precision %gdeg is not within the required limit %gdeg!\"\n", " \"\" % (error, precision)\n", " )\n", " return lat, lon" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime\n", "from itertools import product\n", "\n", "start_year = 2010\n", "end_year = 2020\n", "\n", "times = [datetime(year, 1, 1) for year in range(start_year, end_year + 1)]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [], "source": [ "magnetic_poles = [\n", " (time, qd2geo(time, 90, 0), qd2geo(time, -90, 0))\n", " for time in times\n", "]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | date | \n", "northMagPoleLat | \n", "northMagPoleLon | \n", "southMagPoleLat | \n", "southPoleLon | \n", "
---|---|---|---|---|---|
0 | \n", "2010-01-01 | \n", "82.627205 | \n", "-83.919785 | \n", "-74.283615 | \n", "126.011719 | \n", "
1 | \n", "2011-01-01 | \n", "82.716835 | \n", "-84.043762 | \n", "-74.303459 | \n", "125.956863 | \n", "
2 | \n", "2012-01-01 | \n", "82.806381 | \n", "-84.168839 | \n", "-74.323334 | \n", "125.902046 | \n", "
3 | \n", "2013-01-01 | \n", "82.895844 | \n", "-84.295052 | \n", "-74.343239 | \n", "125.847267 | \n", "
4 | \n", "2014-01-01 | \n", "82.985222 | \n", "-84.422462 | \n", "-74.363159 | \n", "125.792534 | \n", "
5 | \n", "2015-01-01 | \n", "83.074516 | \n", "-84.551102 | \n", "-74.383118 | \n", "125.737839 | \n", "
6 | \n", "2016-01-01 | \n", "83.158089 | \n", "-84.696404 | \n", "-74.400307 | \n", "125.661491 | \n", "
7 | \n", "2017-01-01 | \n", "83.241623 | \n", "-84.842804 | \n", "-74.417557 | \n", "125.585182 | \n", "
8 | \n", "2018-01-01 | \n", "83.325127 | \n", "-84.990356 | \n", "-74.434868 | \n", "125.508926 | \n", "
9 | \n", "2019-01-01 | \n", "83.408600 | \n", "-85.139091 | \n", "-74.452225 | \n", "125.432732 | \n", "
10 | \n", "2020-01-01 | \n", "83.492035 | \n", "-85.289047 | \n", "-74.469643 | \n", "125.356590 | \n", "