pySwipe#

Notebook authors: Spencer M. Hatch

Package authors: Spencer M. Hatch, Karl M. Laundal

Resources#

Python package: pyswipe
Code

# Temporarily patch in fixed version
%pip install --quiet git+https://github.com/smithara/pyswipe/@hotfix-numpy-1.25
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Note: you may need to restart the kernel to use updated packages.
%load_ext watermark
%watermark -i -v -p pyswipe,numpy,matplotlib
Python implementation: CPython
Python version       : 3.11.6
IPython version      : 8.18.0

pyswipe   : 0.1.dev32+g78ac6c0
numpy     : 1.26.2
matplotlib: 3.8.2

Introduction#

In this notebook we will use pySwipe to make some simple summary plots of the high-latitude ionospheric electric potential \(\Phi\), electric field \(\mathbf{E} = -\nabla \Phi\), height-integrated electromagnetic work \(\mathbf{J}\cdot\mathbf{E}\), and Hall and Pedersen conductances \(\Sigma_H\) and \(\Sigma_P\).

Let’s start by importing pyswipe and initializing a SWIPE object.

import numpy as np 
from matplotlib import pyplot as plt

from pyswipe import SWIPE

#Define solar wind, IMF, and season
vsw = 400 # solar wind speed [km/s]
by = 3 #IMF By in GSM coordinates [nT]
bz = -3 #IMF Bz in GSM coordinates [nT]
dptilt = 0. #Dipole tilt [deg]
f107val = 120 #F10.7 [s.f.u., typical values are 60–80 and 140–220 during solar min and max, respectively]
minlat = 45 #minimum latitude for SWIPE model grid
this = SWIPE(vsw,by,bz,dptilt,f107val,
             minlat=minlat)
/opt/conda/lib/python3.11/site-packages/pyswipe/swipe.py:175: UserWarning: Selected minlat(=45) is below recommended lowest acceptable value, 47°. This will probably affect, for example, calculations of cross-polar cap potential.
  warnings.warn(f"Selected minlat(={minlat}) is below recommended lowest acceptable value, 47°. This will probably affect, for example, calculations of cross-polar cap potential.")

Electric potential and electric field#

Let’s first use this object to produce a quick plot of the electric potential in each hemisphere.

  • The plot_potential() method uses output from the get_potential() method and some plotting utilities included in pyswipe to produce this plot.

this.plot_potential()

# We could instead use the following if we wanted to get the value of the potential at each of these locations
#mlats, mlts = this.plotgrid_scalar
#phin, phis = np.split(this.get_potential(), 2)
#phin = phin - np.median(phin)
#phis = phis - np.median(phis)
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/82cf8b8190cc56752efaf6ba3bc671f344012c4b242726b28057e97963a2656d.png
(<Figure size 1500x700 with 3 Axes>,
 (<pyswipe.plot_utils.Polarplot at 0x7f96376b0e50>,
  <pyswipe.plot_utils.Polarplot at 0x7f962d4f3610>,
  <Axes: ylabel='neg    kV      pos'>))
  • The potential distributions in the Northern and Southern Hemisphere for the conditions selected by the user are shown in the left and right panels.

  • The gray quivers/arrows in each panel show the electric field.

  • The cross-polar cap potential (i.e., maximum potential - minimum potential) is shown at bottom right in each panel.

  • The contour spacing is 5 kV.

Height-integrated electromagnetic work \(\mathbf{J}\cdot\mathbf{E}\)#

Let us now plot height-integrated electromagnetic work.

this.plot_emwork()
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/81220edf671dcbd1f6c968720857f3b361c17e485eb4c4196d15e99ec14df080.png
(<Figure size 1500x700 with 3 Axes>,
 (<pyswipe.plot_utils.Polarplot at 0x7f96252c0f10>,
  <pyswipe.plot_utils.Polarplot at 0x7f96182a9990>,
  <Axes: ylabel='$W_{EM}$ [mW/m$^2$]'>))

Hall and Pedersen conductances#

Let’s now have a look at the Hall and Pedersen conductances.

this.plot_conductance(vmin=0.)
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/d3b8c78d2b598f3274ac62ac704966096d16857a615d6da548b7be04c633265a.png
(<Figure size 1500x1500 with 6 Axes>,
 (<pyswipe.plot_utils.Polarplot at 0x7f960bec8710>,
  <pyswipe.plot_utils.Polarplot at 0x7f960bf85910>,
  <Axes: ylabel='$\\Sigma_H$ [mho]'>,
  <pyswipe.plot_utils.Polarplot at 0x7f960bf3c3d0>,
  <pyswipe.plot_utils.Polarplot at 0x7f960bf2f990>,
  <Axes: ylabel='$\\Sigma_P$ [mho]'>))
  • Hall and Pedersen conductance distributions are respectively shown in the top and bottom rows

  • Q: “What’s up with the gray background?”

    • A: The gray background indicates a location where one of the following conditions is broken:

      • 0.05 mho \(< \Sigma_H < 100\) mho

      • \(\mathbf{J}\cdot\mathbf{E} < \) 0.5 mW/m²

    • When one or both of these conditions are not met, it means that output from the Swipe model may not be consistent with the assumption that the neutral wind is zero in the Earth’s rotating frame of reference. Why? Because if the neutral wind truly is zero in the Earth’s rotating frame of reference, then in that frame of reference \(\mathbf{J}\cdot\mathbf{E} > 0\).

    • Another possibility: When these conditions aren’t met, it might mean that it doesn’t make sense to speak of “average” ionospheric electrodynamics for the given solar wind conditions, or it might just be an indication that some other aspect of the Swipe model is not perfect, like our choice of a spherical harmonic representation of the electric potential and current systems)

    • So! Where model conductances are shown, they are possibly consistent with the assumption that the neutral wind is zero in the Earth’s rotating frame of reference.

Model values at user-specified coordinates#

We can also get the potential, electric field, and height-integrated electromagnetic work at selected locations.

Let’s examine the noon-midnight meridian.

mlats = np.arange(45,135.1,0.25)
mlts = np.ones_like(mlats)*12
flip = mlats > 90
mlatsnowrap = mlats.copy()
mlats[flip] = 180-mlats[flip]
mlts[flip] = (mlts[flip]+12)%24
#print(mlats)
#print(mlts)
pot = this.get_potential(mlats,mlts,grid=False)
Ed1, Ed2 = this.get_efield_MA(mlats,mlts,grid=False)
emwork = this.get_emwork(mlats,mlts,grid=False)

fig, axes = plt.subplots(4,1,figsize=(10,10),sharex=True)
fig.suptitle("Noon-midnight meridian\n("+r"$v_{sw}=$"+str(vsw)+r", $B_y=$"+str(by)+r", $B_z=$"+str(bz)+r", $\Psi=$"+str(dptilt)+")",fontsize=15)

tickmlats = np.arange(50,131,10)
tickmlatswrap = tickmlats.copy()
tickmlatswrap[tickmlats > 90] = 180-tickmlatswrap[tickmlats > 90]

#potential
plt.sca(axes[0])
plt.plot(mlatsnowrap,pot)
plt.xticks(ticks=tickmlats,labels=tickmlatswrap)
#plt.title("Potential")
plt.ylabel("Potential [kV]")

#E-field
plt.sca(axes[1])
plt.plot(mlatsnowrap,Ed1)
plt.ylabel("$E_{d1}$ [mV/m]")

plt.sca(axes[2])
plt.plot(mlatsnowrap,Ed2)
plt.ylabel("$E_{d2}$ [mV/m]")

#EM work
plt.sca(axes[3])
plt.plot(mlatsnowrap,emwork)
plt.ylabel("EM work [mW/m²]")

plt.xlabel("MLat [deg]")

#Mark 90° MLat
for ax in axes:
    ax.axvline(90,linestyle='--',color='gray',zorder=-10)
    
plt.tight_layout()
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans.
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/3ce61df6260af61f9406b0d91704ec31f1a190bda4d71ac3536d5c1de2148ff1.png
  • First panel: Potential

  • Second panel: Electric field in the (approximately) magnetic east-west direction

  • Third panel: Electric field in the (approximately) magnetic north-south direction

  • Fourth panel: Height-integrated electromagnetic work

The discontinuity in the electric field components at 90° MLat is a reflection of the fact that the angular basis vectors of a spherical coordinate system are discontinuous at the poles.

Let’s make a figure in the same layout as the one above, but this time showing these quantities along the dawn-dusk meridian

mlats = np.arange(45,135.1,0.25)
mlts = np.ones_like(mlats)*6
flip = mlats > 90
mlatsnowrap = mlats.copy()
mlats[flip] = 180-mlats[flip]
mlts[flip] = (mlts[flip]+12)%24
#print(mlats)
#print(mlts)
pot = this.get_potential(mlats,mlts,grid=False)
Ed1, Ed2 = this.get_efield_MA(mlats,mlts,grid=False)
emwork = this.get_emwork(mlats,mlts,grid=False)

fig, axes = plt.subplots(4,1,figsize=(10,10),sharex=True)
fig.suptitle("Dawn-dusk meridian\n("+r"$v_{sw}=$"+str(vsw)+r", $B_y=$"+str(by)+r", $B_z=$"+str(bz)+r", $\Psi=$"+str(dptilt)+")",fontsize=15)

tickmlats = np.arange(50,131,10)
tickmlatswrap = tickmlats.copy()
tickmlatswrap[tickmlats > 90] = 180-tickmlatswrap[tickmlats > 90]

#potential
plt.sca(axes[0])
plt.plot(mlatsnowrap,pot)
plt.xticks(ticks=tickmlats,labels=tickmlatswrap)
#plt.title("Potential")
plt.ylabel("Potential [kV]")

#E-field
plt.sca(axes[1])
plt.plot(mlatsnowrap,Ed1)
plt.ylabel("$E_{d1}$ [mV/m]")

plt.sca(axes[2])
plt.plot(mlatsnowrap,Ed2)
plt.ylabel("$E_{d2}$ [mV/m]")

#EM work
plt.sca(axes[3])
plt.plot(mlatsnowrap,emwork)
plt.ylabel("EM work [mW/m²]")

plt.xlabel("MLat [deg]")

#Mark 90° MLat
for ax in axes:
    ax.axvline(90,linestyle='--',color='gray',zorder=-10)
    
plt.tight_layout()
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/1767c2d1f788ce8dedd978442fd22655598de6a179d3ef32430431d51e96aee5.png

Along user-specified positions#

In this notebook we will use pySwipe to make plots of the Swipe high-latitude ionospheric electric potential \(\Phi\), electric field \(\mathbf{E} = -\nabla \Phi\), and height-integrated electromagnetic work \(\mathbf{J}\cdot\mathbf{E}\) along the noon-midnight and dawn-dusk meridians.

Let’s start by importing pyswipe and initializing a SWIPE object.

import numpy as np 
from matplotlib import pyplot as plt

from pyswipe import SWIPE

#Define solar wind, IMF, and season
vsw = 400 # solar wind speed [km/s]
by = 3 #IMF By in GSM coordinates [nT]
bz = -3 #IMF Bz in GSM coordinates [nT]
dptilt = 0. #Dipole tilt [deg]
f107val = 120 #F10.7 [s.f.u., typical values are 60–80 and 140–220 during solar min and max, respectively]
minlat = 45 #minimum latitude for SWIPE model grid
this = SWIPE(vsw,by,bz,dptilt,f107val,
             minlat=minlat)
/opt/conda/lib/python3.11/site-packages/pyswipe/swipe.py:175: UserWarning: Selected minlat(=45) is below recommended lowest acceptable value, 47°. This will probably affect, for example, calculations of cross-polar cap potential.
  warnings.warn(f"Selected minlat(={minlat}) is below recommended lowest acceptable value, 47°. This will probably affect, for example, calculations of cross-polar cap potential.")

Model values at user-specified coordinates#

Let’s now get the potential, electric field, and height-integrated electromagnetic work along the noon-midnight meridian.

mlats = np.arange(45,135.1,0.25)
mlts = np.ones_like(mlats)*12
flip = mlats > 90
mlatsnowrap = mlats.copy()
mlats[flip] = 180-mlats[flip]
mlts[flip] = (mlts[flip]+12)%24
#print(mlats)
#print(mlts)
pot = this.get_potential(mlats,mlts,grid=False)
Ed1, Ed2 = this.get_efield_MA(mlats,mlts,grid=False)
emwork = this.get_emwork(mlats,mlts,grid=False)
sh, sp, mask = this.get_conductances(mlats,mlts)
sh = np.ma.masked_array(sh,mask)
sp = np.ma.masked_array(sp,mask)
conmax = np.max([np.max(sh),np.max(sp)])

fig, axes = plt.subplots(6,1,figsize=(10,10),sharex=True)
fig.suptitle("Noon-midnight meridian\n("+r"$v_{sw}=$"+str(vsw)+r", $B_y=$"+str(by)+r", $B_z=$"+str(bz)+r", $\Psi=$"+str(dptilt)+")",fontsize=15)

tickmlats = np.arange(50,131,10)
tickmlatswrap = tickmlats.copy()
tickmlatswrap[tickmlats > 90] = 180-tickmlatswrap[tickmlats > 90]

#potential
plt.sca(axes[0])
plt.plot(mlatsnowrap,pot)
plt.xticks(ticks=tickmlats,labels=tickmlatswrap)
#plt.title("Potential")
plt.ylabel("Potential [kV]")

#E-field
plt.sca(axes[1])
plt.plot(mlatsnowrap,Ed1)
plt.ylabel("$E_{d1}$ [mV/m]")

plt.sca(axes[2])
plt.plot(mlatsnowrap,Ed2)
plt.ylabel("$E_{d2}$ [mV/m]")

#EM work
plt.sca(axes[3])
plt.plot(mlatsnowrap,emwork)
plt.ylabel("EM work [mW/m²]")

#Conductances
plt.sca(axes[4])
plt.plot(mlatsnowrap,sh)
plt.ylabel("$\Sigma_H$ [mho]")
plt.ylim((0,conmax))

plt.sca(axes[5])
plt.plot(mlatsnowrap,sp)
plt.ylabel("$\Sigma_P$ [mho]")
plt.ylim((0,conmax))

plt.xlabel("MLat [deg]")

#Mark 90° MLat
for ax in axes:
    ax.axvline(90,linestyle='--',color='gray',zorder=-10)
    
plt.tight_layout()
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/7eab39cdc98fcf79bda5e35d73586d677bdd5e1aa0a20f5c3500747de2166a23.png
  • First panel: Potential

  • Second panel: Electric field in the (approximately) magnetic east-west direction

  • Third panel: Electric field in the (approximately) magnetic north-south direction

  • Fourth panel: Height-integrated electromagnetic work

  • Fifth and six panels: Hall and Pedersen conductances, with conductance estimates masked where these estimates are likely to be bad. (See pyswipe_introduction.ipynb.)

The discontinuity in the electric field components at 90° MLat is a reflection of the fact that the angular basis vectors of a spherical coordinate system are discontinuous at the poles.

Let’s make a figure in the same layout as the one above, but this time showing these quantities along the dawn-dusk meridian

mlats = np.arange(45,135.1,0.25)
mlts = np.ones_like(mlats)*6
flip = mlats > 90
mlatsnowrap = mlats.copy()
mlats[flip] = 180-mlats[flip]
mlts[flip] = (mlts[flip]+12)%24
#print(mlats)
#print(mlts)
pot = this.get_potential(mlats,mlts,grid=False)
Ed1, Ed2 = this.get_efield_MA(mlats,mlts,grid=False)
emwork = this.get_emwork(mlats,mlts,grid=False)
sh, sp, mask = this.get_conductances(mlats,mlts)
sh = np.ma.masked_array(sh,mask)
sp = np.ma.masked_array(sp,mask)
conmax = np.max([np.max(sh),np.max(sp)])

fig, axes = plt.subplots(6,1,figsize=(10,10),sharex=True)
fig.suptitle("Dawn-dusk meridian\n("+r"$v_{sw}=$"+str(vsw)+r", $B_y=$"+str(by)+r", $B_z=$"+str(bz)+r", $\Psi=$"+str(dptilt)+")",fontsize=15)

tickmlats = np.arange(50,131,10)
tickmlatswrap = tickmlats.copy()
tickmlatswrap[tickmlats > 90] = 180-tickmlatswrap[tickmlats > 90]

#potential
plt.sca(axes[0])
plt.plot(mlatsnowrap,pot)
plt.xticks(ticks=tickmlats,labels=tickmlatswrap)
#plt.title("Potential")
plt.ylabel("Potential [kV]")

#E-field
plt.sca(axes[1])
plt.plot(mlatsnowrap,Ed1)
plt.ylabel("$E_{d1}$ [mV/m]")

plt.sca(axes[2])
plt.plot(mlatsnowrap,Ed2)
plt.ylabel("$E_{d2}$ [mV/m]")

#EM work
plt.sca(axes[3])
plt.plot(mlatsnowrap,emwork)
plt.ylabel("EM work [mW/m²]")

#Conductances
plt.sca(axes[4])
plt.plot(mlatsnowrap,sh)
plt.ylabel("$\Sigma_H$ [mho]")
plt.ylim((0,conmax))

plt.sca(axes[5])
plt.plot(mlatsnowrap,sp)
plt.ylabel("$\Sigma_P$ [mho]")
plt.ylim((0,conmax))

plt.xlabel("MLat [deg]")

#Mark 90° MLat
for ax in axes:
    ax.axvline(90,linestyle='--',color='gray',zorder=-10)
    
plt.tight_layout()
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
findfont: Generic family 'sans-serif' not found because none of the following families were found: Verdana
../_images/f2a1b6ec4268b9b20360d41faff3e8a4695444b3207eb4ad985a0fceadd45fe8.png