HAPI: Heliophysics Application Programmer's Interface

https://hapi-server.org/

Introduction

The Heliophysics Application Programmer's Interface (HAPI) facilitates simplified access to distributed time series data for research in Heliophysics. A few simple lines can retrieve standardised output from hundreds of datasets covering tens of missions. HAPI servers supply thousands of datasets, retrievable quickly and easily in very few lines of code, allowing the analysis and science to start!

Why so HAPI?

Simple:

The easiest way to demonstrate the power of HAPI is the number of lines of Python code (10!) it takes to retrieve CSA data in a standardised format and plot it → 

 

This example (which uses hapiplot to plot very quickly), OMNI, Swarm and plotting CSA data with Matplotlib are given in this Jupyter Notebook

Data can also be plotted directly from the server page, e.g., https://hapi-server.org/servers/#server=CSA&dataset=C4_CP_WHI_PASSIVE_ACTIVE&parameters=time_tags&start=2022-12-31T18:00Z&stop=2022-12-31T19:00Z&return=image&format=hapiplot&style=svg

 

ADAPTABLE

Clients are available in  IDLJavascriptJavaMATLAB, and Python clients from the github page https://github.com/hapi-server

 

Huge amounts of data:

There are 9 servers (see https://hapi-server.org/servers/), providing thousands of datasets, all retrievable in the same simple way:

Servers and number of datasets:

  • SSCWeb: 272

  • CDAWeb: 3042

  • INTERMAGNET: 2887

  • CCMC_ISWA: 271

  • LISIRD: 29

  • AMDA: 905

  • VirES for Swarm: 101

  • Helioviewer: 79

  • Cluster Science Archive: 1947

 

Python Demo page & documentation

https://colab.research.google.com/github/hapi-server/client-python-notebooks/blob/master/hapi_demo.ipynb

Using the Python client, these lines are all that is needed to retrieve and plot CSA data:

from hapiclient import hapi
from hapiplot import hapiplot

server     = 'https://csatools.esac.esa.int/HapiServer/hapi'
dataset    = 'C4_CP_FGM_SPIN'
start      = '2014-04-22T03:00:00'
stop       = '2014-04-22T06:30:00'
parameters = 'B_vec_xyz_gse'
opts       = {}
# Get data
csadata, csameta = hapi(server, dataset, parameters, start, stop, **opts)

# Plot all parameters
hapiplot(csadata, csameta)

 

Autoplot

Autoplot can access the HAPI servers directly. Just go to File > Add Plot From > hapi...