Data from the solar wind, from LEO, and from the ground
- preamble around options for accessing the different data, with links to other projects..
For this notebook we focus on:
hapiclientto access solar wind data from OMNI
viresclientto access FACs & AEJs from Swarm, and B-field from ground observatories
matplotlibfor data wrangling and plotting
Let's choose an interesting time period to study - the "St. Patrick's day storm" of 17th March 2015
You can look at the wider context of this event using the interactive Space Weather Data Portal from the University of Colorado
Part 1: solar wind data
HAPI is an access protocol supported by a wide array of heliophysics datasets. We can use the Python package "hapiclient" to retrieve data from HAPI servers. In this case we will access the OMNI HRO2 dataset which provides consolidated solar wind data, and then we will show how we can load these data into pandas and xarray objects.
To generate code snippets to use, and to see what data are available:
For more examples with hapiclient, take a look at the demonstration notebooks:
Data retrieved from HAPI are labelled numpy arrays (
data) accompanied by a metadata dictionary (
You could extract an array for a particular value like
data["BZ_GSM"], and use the metadata to get full descriptions and units for the chosen parameter.
The metadata sometimes contains fill values used during data gaps (e.g. the 9999... values appearing above). Let's use those to replace the gaps with
We can load the data into a pandas DataFrame to more readily use for analysis:
How can we get the extra information like the units from the metadata? Let's construct dictionaries,
description, that allow easier access to these:
xarray.Dataset object has advantages for handling multi-dimensional data and for attaching of metadata like units. Let's convert the data to an
Now let's plot these data:
Part 2: Swarm data
- Swarm FACs:
- Swarm AEJs:
List of all variables available through VirES:
2a: Auroral electrojet peaks from Swarm orbits
Since spacecraft move, it is difficult to extract a simple time series that can be easily tracked. From the complex Swarm product portfolio, we will pick a particular derived parameter: the peak auroral electrojet intensities derived from each pass over the current system. This signal tracks reasonably well from one orbit to the next (when separated into four orbital segments - accounting for two passes over the auroral oval in different local time sectors, and over the northern and southern hemispheres).
To keep things a bit simpler, we will retrieve data only from Swarm Alpha over the nothern hemisphere
Now we need some complex logic to plot the eastward and westward electrojet intensities, separated for each local time sector:
2b: Estimates of peak ground magnetic disturbances below satellite tracks
There are also predictions made from Swarm data of the location and strength of the peak disturbance on the ground (along the satellite ground-track) caused by the auroral electrojets. Note that this is from the
AEJ_PBS (using the SECS method) collection rather than the
AEJ_PBL (using the LC method) used above.
TODO: explain plots below
- Expected ground magnetic disturbance below SWARM Alpha (as timeseries)
- Expected ground magnetic disturbance below SWARM Alpha in northern hemisphere only
- Average ground magnetic disturbance from each SWARM A orbit (rough estimate of 'global' disturbance)
Part 3: Ground observatory data
- INTERMAGNET ground observatory data from VirES:
- Add lat/lon dimension to the observatory dataset, to collect other observatories in one big dataset? or deal with as individual datasets?