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
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]:
In [5]:
PBrev.tree(verbose=True)
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]:
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]:
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]:
In [29]:
plt.scatter(v_baseline, flux_baseline)
plt.xlabel('Re-baselined velocity')
plt.ylabel('Re-baselined flux')
Out[29]:
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 [ ]: