Data from the solar wind, from LEO, and from the ground
TODO:
- preamble around options for accessing the different data, with links to other projects..
For this notebook we focus on:
- Using
hapiclient
to access solar wind data from OMNI - Using
viresclient
to access FACs & AEJs from Swarm, and B-field from ground observatories - Using
xarray
andmatplotlib
for data wrangling and plotting
The notebook can be used to extend the PyHC example gallery and the Swarm notebook gallery
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:
http://hapi-server.org/servers/#server=CDAWeb&dataset=OMNI_HRO2_1MIN¶meters=flow_speed&start=2000-01-01T00:00:00Z&stop=2000-02-01T00:00:00Z&return=script&format=python
For more examples with hapiclient, take a look at the demonstration notebooks:
https://github.com/hapi-server/client-python-notebooks
Data retrieved from HAPI are labelled numpy arrays (data
) accompanied by a metadata dictionary (meta
):
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 NaN
values:
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, units
and description
, that allow easier access to these:
The xarray.Dataset
object has advantages for handling multi-dimensional data and for attaching of metadata like units. Let's convert the data to an xarray.Dataset
:
Now let's plot these data:
Part 2: Swarm data
See also:
- Swarm FACs:
- Swarm AEJs:
List of all variables available through VirES:
https://viresclient.readthedocs.io/en/latest/available_parameters.html
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
See also:
- INTERMAGNET ground observatory data from VirES:
TODO:
- Add lat/lon dimension to the observatory dataset, to collect other observatories in one big dataset? or deal with as individual datasets?