Fermi-specific Plot Classes (gdt.missions.fermi.plot)¶
There are a few Fermi-specific plot classes that extend the functionality of
those provided in The Plot Package. These classes
primarily augment the orbital plotting for Fermi, with a plot class for
managing the McIlwain L heat map (McIlwainL), a plot class for implementing
this seamlessly into an orbital plot (FermiEarthPlot), and a class defining a
custom Fermi plot icon (FermiIcon).
We can initialize the FermiEarthPlot by calling it in the same way as the
base EarthPlot class:
>>> import matplotlib.pyplot as plt
>>> from gdt.missions.fermi.plot import FermiEarthPlot
>>> earthplot = FermiEarthPlot(interactive=True)
>>> plt.show()
Here we see the region of the Fermi orbit and a heatmap of the McIlwain L parameter overlaid. The heatmap object can be retrieved:
>>> earthplot.mcilwainl
<McIlwainL: color='viridis';
alpha=0.5;
num_contours=9;
colorbar=True>
We can change the color map via the GdtCmap object:
>>> earthplot.mcilwainl.color.name = 'Blues'
And we can also increase the alpha of the heatmap:
>>> earthplot.mcilwainl.alpha=1.0
We can also change the number of contours, but to do so, we must initialize
a new McIlwainL plot object and specify the contours on initialization:
>>> import numpy as np
>>> from gdt.missions.fermi.plot import McIlwain
>>> # don't create mcilwain heatmap, we will do this manually
>>> earthplot = FermiEarthPlot(interactive=True, mcilwain=False)
>>> # 50 contour levels
>>> levels = np.linspace(0.9, 1.7, 50)
>>> # add our custom McIlwainL object
>>> mcl = McIlwainL((-30.0, 30.0), (-180.0, 180.0), earthplot.geoaxes, alpha=1.0,
>>> levels=levels)
>>> plot.show()
The FermiIcon is a custom plot marker in the shape of Fermi. Although
typically used as a plot marker in FermiEarthPlot, we can view it up close:
>>> from gdt.core.plot.plot import GdtPlot
>>> from gdt.missions.fermi.plot import FermiIcon
>>> plot = GdtPlot()
>>> icon = FermiIcon(0.0, 0.0, plot.ax)
>>> plot.xlim = (-15.0, 15.0)
>>> plot.ylim = (-10.0, 10.0)
>>> plt.show()
We can add the FermiIcon to the FermiEarthPlot by giving it the East
longitude and latitude of the position and the plot axes:
>>> earthplot = FermiEarthPlot(interactive=True)
>>> # latitude -4.62, East longitude 80.88
>>> icon = FermiIcon(-4.62, 80.88, earthplot.geoaxes)
>>> plt.show()
Reference/API¶
gdt.missions.fermi.plot Module¶
Functions¶
|
Plot a McIlwain L heatmap on the Earth. |
Classes¶
|
Class for plotting Fermi's orbit, including the McIlwain L heatmap. |
|
Plot a Fermi icon on the Earth. |
|
Plot class for the McIlwain L heatmap. |
Class Inheritance Diagram¶
