This page was generated by nbsphinx from docs/examples/AMDA.ipynb.
Interactive online version: Binder badge Google Colab badge

AMDA first steps

The Automated Multi-Dataset Analysis (AMDA) web service, run by the CDPP (Centre de Données de la Physique des Plasmas), gives access to a large catalog of space physics data: magnetic field, plasma and particle measurements from dozens of missions, plus derived products such as catalogs of events and timetables.

This notebook shows the basics: browsing the AMDA inventory and fetching your first time series.

Only for Google Colab users:

[ ]:
%pip install --upgrade ipympl speasy
[ ]:
try:
    from google.colab import output
    output.enable_custom_widget_manager()
except:
    print("Not running inside Google Collab")

For all users:

[1]:
import speasy as spz
%matplotlib widget
amda_tree = spz.inventories.tree.amda
# Use this instead if you are not using jupyterlab yet
#%matplotlib notebook
import matplotlib.pyplot as plt
from datetime import datetime

Finding products: the inventory tree

Everything AMDA offers is mirrored in Speasy’s inventory tree, spz.inventories.tree.amda. The tree is organized by product type (Parameters, Catalogs, TimeTables), then mission, instrument and dataset. You don’t have to guess the names: type part of the path and press Tab to get completion, e.g. spz.inventories.tree.amda.Parameters.ACE.MFI. + Tab. The setup cell above already keeps a shortcut to the tree in the amda_tree variable.

Referring to products by string ID

Every product also has a string identifier like "amda/imf", and spz.get_data() accepts either form. So the call below:

spz.get_data(amda_tree.Parameters.ACE.MFI.ace_imf_all.imf, start, stop)

could also be written spz.get_data("amda/imf", start, stop). String IDs are handy when you copy a product name from the AMDA website or share a script.

For more about AMDA in Speasy, see the AMDA user guide.

A simple example with ACE IMF data

[2]:
plt.figure()
ace_mag = spz.get_data(amda_tree.Parameters.ACE.MFI.ace_imf_all.imf, datetime(2016,6,2), datetime(2016,6,5))
ace_mag.plot()
plt.tight_layout()
plt.show()