Space Physics made EASY
Speasy is an open source Python client for Space Physics web services such as CDAWEB or AMDA. Most space physics data analysis starts with finding which server provides which dataset then figuring out how to download them. This can be difficult specially for students or newcomers, Speasy try to remove all difficulties by providing an unique and simple API to access them all. Speasy aims to support as much as possible web services and also cover a maximum of features they propose.
Installing Speasy with pip (more details here):
$ python -m pip install speasy # or $ python -m pip install --user speasy
Getting data is as simple as:
Where amda is the webservice and imf is the product id you will get with this request.
Using the dynamic inventory this can be even simpler:
Will produce the exact same result than previous example but has the advantage to be easier to manipulate since you can discover available data from your favourite Python environment completion such as IPython or notebooks (might not work from IDEs).
This also works with SSCWEB, you can easily download trajectories:
More complex requests like this one are supported:
import speasy as spz products = [ spz.inventories.tree.amda.Parameters.Wind.SWE.wnd_swe_kp.wnd_swe_vth, spz.inventories.tree.amda.Parameters.Wind.SWE.wnd_swe_kp.wnd_swe_pdyn, spz.inventories.tree.amda.Parameters.Wind.SWE.wnd_swe_kp.wnd_swe_n, spz.inventories.tree.cda.Wind.WIND.MFI.WI_H2_MFI.BGSE, spz.inventories.tree.ssc.Trajectories.wind, ] intervals = [["2010-01-02", "2010-01-02T10"], ["2009-08-02", "2009-08-02T10"]] data = spz.get_data(products, intervals)
Simple and intuitive API (spz.get_data to get them all)
Pandas DataFrame like interface for variables
Quick functions to convert a variable to a Pandas DataFrame
Local cache to avoid repeating twice the same request
Can take advantage of SciQLop dedicated proxy as a community backed ultra fast cache
Full support of AMDA API
See here for a complete list of examples.