Purpose

This notebook is for the exploration of the ESP 1.8-3.5 MeV electron flux data published by Reeves et al. [2011]. The data cleaning and processing were all performed by S.K. Morley (me) and those steps are described in the electronic supplement to the Reeves et al. paper.

Full citation:

Reeves, G. D., S. K. Morley, R. H. W. Friedel, M. G. Henderson, T. E. Cayton, G. Cunningham, J. B. Blake, R. A. Christensen, and D. Thomsen (2011), On the relationship between relativistic electron flux and solar wind velocity: Paulikas and Blake revisited, J. Geophys. Res., 116, A02213, doi:10.1029/2010JA015735.

Since the electronic supplement had its format mangled on archiving, and the original files weren't well organized or documented, I've re-packaged the primary dataset (daily averaged ESP 1.8-3.5 MeV electron flux), along with the daily averaged solar wind speed, in an HDF5 file.


In [1]:
import spacepy.datamodel as dm
import spacepy.time as spt


This unreleased version of SpacePy is not supported by the SpacePy team.

In [2]:
PBrev = dm.fromHDF5('PBrevisited_ESP.h5')
PBrev['time'] = spt.Ticktock(PBrev['time'], 'ISO').UTC

Since I'm hoping to use scikits-learn to do some classification, I'll also throw these data into a pandas dataframe.


In [3]:
import pandas
from pandas.core.frame import DataFrame
PBrev_df = DataFrame(PBrev, columns=PBrev.keys())

In [4]:
PBrev_df.describe()


Out[4]:
flux v_sw
count 7187.000000 7405.000000
mean 4.009896 442.252913
std 0.788676 100.343174
min 2.081483 255.240000
25% 3.403603 368.880000
50% 4.030160 422.400000
75% 4.631674 497.080000
max 5.916830 1103.000000

In [5]:
PBrev.tree(verbose=True)


+
|____flux (spacepy.datamodel.dmarray (7405,))
|____time (spacepy.datamodel.dmarray (7405,))
|____v_sw (spacepy.datamodel.dmarray (7405,))

And just to ensure that we've got the dataset imported correctly we should go ahead and reproduce the figure 1a from the paper


In [6]:
import matplotlib.pyplot as plt
%matplotlib inline

In [7]:
fig = plt.figure(figsize=(8,4.5)) #widescreen aspect ratio
ax = fig.add_subplot(111)
ax.plot(PBrev['time'][::27], PBrev['flux'][::27], 'b-')
ax1 = ax.twinx()
ax1.plot(PBrev['time'][::27], PBrev['v_sw'][::27], 'r-')
ax.set_ylabel('Log flux, 1.8-3.5 MeV')
ax1.set_ylabel('Solar wind speed [km/s]')


Out[7]:
<matplotlib.text.Text at 0x7fad4d284110>

For the sake of expediency I just plotted every 27th point, rather than doing the 27-day means that were in the paper, but it looks almost identical. So time to move on...

Let's use pandas to get a running mean, since we need that to subtract a baseline.


In [8]:
v_365 = pandas.rolling_mean(PBrev_df.v_sw, 365)

In [9]:
v_baseline = PBrev['v_sw']-v_365
plt.plot(PBrev['time'], v_365)
plt.plot(PBrev['time'], v_baseline)


Out[9]:
[<matplotlib.lines.Line2D at 0x7fad4d195e10>]

Let's do the same for the electron fluxes, after which we can start classifying events as enhancements, depletions and non-events.


In [26]:
flux_365 = pandas.rolling_mean(PBrev['flux'], 365, min_periods=1)
flux_baseline = PBrev['flux']-flux_365
plt.plot(PBrev['time'], flux_365)
plt.plot(PBrev['time'], flux_baseline)


Out[26]:
[<matplotlib.lines.Line2D at 0x7fad485e9210>]

In [29]:
plt.scatter(v_baseline, flux_baseline)
plt.xlabel('Re-baselined velocity')
plt.ylabel('Re-baselined flux')


Out[29]:
<matplotlib.text.Text at 0x7fad483dd290>

So it looks like we're still reproducing the "triangle" distribution that was discussed in Reeves et al. [2011]. There's an approximate, fixed upper limit and a velocity-dependent lower limit on the flux.


In [ ]: