by Frederic Effenberger
Published in Effenberger et al. 2017, ApJ, http://iopscience.iop.org/article/10.3847/1538-4357/835/2/124/meta
We analyze two data sets of occulted flares from solar cycle 23 and 24 with different spectral fits, in their high and low energy spatial seperation and their light curves as correlated with the soft X-ray GOES flux. Additional STEREO height and equivalent GOES class information is included, when available.
This notebook gives the methods that were used to create the figures and do the analysis based on the results. The high level results are provided in two csv files 'Occulted_Results_23.csv' and 'Occulted_Results_24.csv'.
The quantities (columns) are:
Date Date of the fitted (non-thermal) peak of the flare
Time Time (UT) of the fitted (non-thermal) peak of the flare
GOES Observed GOES class
Pos_X RHESSI solar X position in arcsec
Pos_Y RHESSI solar Y position in arcsec
Stereo Calculated GOES class from STEREO UV flux
T_vth Temperature of the thermal component in the thermal plus broken power-law spectral fit in MK
E_break Break energy of the broken power-law spectral fit in keV
gamma High energy spectral photon index of the broken power-law
T_vth_kappa Temperature of the thermal component in the thin-target kappa spectral fit in MK
T_kappa Temperature of the kappa component in the thin-target kappa spectral fit in MK
kappa Electron kappa spectral index in the thin-target kappa spectral fit
d_max Radial separation of the high and low energy emission maxima from clean imaging
d_com Radial separation of the high and low energy emission center of mass from clean imaging
A Area of the 50% low-energy image contour in cm^2
F_th Total thermal energy flux calculated from the thermal component in the broken power-law fit in keV/cm^2/s
F_nth Total non-thermal energy flux calculated from the broken power-law component in keV/cm^2/s
tau_cross Crossing time calculated from the Area for a particle energy of 15 keV in s
tau_loss Energy loss time estimated from the density in s
n Density estimated from the emission measure and volume in 1/cm^3
goes_corr_high Correlation coefficient between the time derivative of the GOES high energy channel and RHESSI
goes_corr_low Correlation coefficient between the time derivative of the GOES low energy channel and RHESSI
goes_lag_high Lag between the time derivative of the GOES high energy channel and RHESSI
goes_lag_low Lag between the time derivative of the GOES low energy channel and RHESSI
gamma_err 1 sigma error of gamma from detector average
kappa_err 1 sigma error of kappa from detector average
level A flux level proportional to the goes class to quantify the magnitude of the flare
See the above publication for more details and please cite it if you use these results.
In [14]:
# Some packages and settings
from __future__ import print_function
%matplotlib inline
import numpy as np
import pandas as pd
from scipy.stats import linregress
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
minorLocator = AutoMinorLocator()
from datetime import datetime
matplotlib.rcParams['font.size'] = 30
matplotlib.rcParams['figure.figsize'] = (12.0, 12.0)
matplotlib.rcParams['axes.linewidth'] = 1.5
matplotlib.rcParams['xtick.major.size'] = 10
matplotlib.rcParams['xtick.minor.size'] = 6
matplotlib.rcParams['xtick.major.width'] = 2
matplotlib.rcParams['xtick.minor.width'] = 1
matplotlib.rcParams['ytick.major.size'] = 10
matplotlib.rcParams['ytick.minor.size'] = 6
matplotlib.rcParams['ytick.major.width'] = 2
matplotlib.rcParams['ytick.minor.width'] = 1
pd.set_option("display.max_columns",100)
pd.set_option("display.max_rows",200)
import scipy.io
In [15]:
fit_resK = pd.read_csv('Occulted_Results_23.csv', sep=',', index_col=0)
print("Total Flares: ", len(fit_resK))
print("Flares with gamma:", len(fit_resK.gamma[np.invert(np.isnan(fit_resK.gamma))]))
print("Flares with kappa:", len(fit_resK.kappa[np.invert(np.isnan(fit_resK.kappa))]))
print("Flares with offset:", len(fit_resK.d_max[np.invert(np.isnan(fit_resK.d_max))]))
print("Flares with GOES correlation:", len(fit_resK.goes_corr_high[np.invert(np.isnan(fit_resK.goes_corr_high))]))
print(fit_resK.describe())
print(fit_resK.head(2))
print(fit_resK.tail(2))
In [16]:
fit_resO = pd.read_csv('Occulted_Results_24.csv', sep=',', index_col=0)
print("Total Flares: ", len(fit_resO))
print("Flares with gamma:", len(fit_resO.gamma[np.invert(np.isnan(fit_resO.gamma))]))
print("Flares with kappa:", len(fit_resO.kappa[np.invert(np.isnan(fit_resO.kappa))]))
print("Flares with offset:", len(fit_resO.d_max[np.invert(np.isnan(fit_resO.d_max))]))
print("Flares with GOES correlation:", len(fit_resO.goes_corr_high[np.invert(np.isnan(fit_resO.goes_corr_high))]))
print("Flares with STEREO height:", len(fit_resO.H[np.invert(np.isnan(fit_resO.H))]))
print(fit_resO.describe())
print(fit_resO.head(2))
print(fit_resO.tail(2))
In [17]:
# combine all results into one table, fit_res
fit_res = pd.concat([fit_resK,fit_resO])
#fit_res = fit_res[pd.notnull(fit_res['temp'])] # Discard flares that have no temperature fit
print("Total Flares: ", len(fit_res))
print("Flares with gamma:", len(fit_res.gamma[np.invert(np.isnan(fit_res.gamma))]))
print("Flares with kappa:", len(fit_res.kappa[np.invert(np.isnan(fit_res.kappa))]))
print("Flares with offset:", len(fit_res.d_max[np.invert(np.isnan(fit_res.d_max))]))
print("Flares with GOES correlation:", len(fit_res.goes_corr_high[np.invert(np.isnan(fit_res.goes_corr_high))]))
print("Flares with STEREO height:", len(fit_res.H[np.invert(np.isnan(fit_res.H))]))
print(fit_res.describe())
#fit_res.to_csv(path_or_buf='full_output.csv')
In [18]:
# Ebreak
fig1 = plt.figure(1)
ax1 = fig1.add_subplot(111)
fit_res.E_break.plot(kind='hist', normed=False, alpha=1.0, ax=ax1, bins=np.arange(8.,28.,2.),
weights=np.ones_like(fit_res.E_break.dropna().values)/len(fit_res.E_break.dropna()),
fill=False, lw=5, edgecolor='black',histtype='step')
ax1.set_xlim(8,26)
ax1.set_ylim(0.0,0.35)
ax1.set_yticks([0.05,0.1,0.15,0.2,0.25,0.3,0.35])
ax1.set_xlabel("Break energy [keV]")
ax1.set_ylabel("Fraction of events")
ax1.annotate('(b)', xy=(0.93, 0.95), xycoords='axes fraction')
ax1.annotate('mean:'+ "%2.1f" % fit_res.E_break.mean(), xy=(0.03, 0.95), xycoords='axes fraction')
ax1.annotate('median:'+ "%2.1f" % fit_res.E_break.median(), xy=(0.03, 0.90), xycoords='axes fraction')
ax1.annotate('stddev:'+ "%2.2f" % fit_res.E_break.std(), xy=(0.03, 0.85), xycoords='axes fraction')
fig1.tight_layout()
fig1.savefig('ebreak_hist.pdf')
# gamma
fig2 = plt.figure(2)
ax2 = fig2.add_subplot(111)
fit_res.gamma.plot(kind='hist', normed=False, alpha=1.0, ax=ax2, bins=np.arange(2.,11.,1.),
weights=np.ones_like(fit_res.gamma.dropna().values)/len(fit_res.gamma.dropna()),
fill=False, lw=5, edgecolor='black',histtype='step')
ax2.set_xlim(2,10)
ax2.set_ylim(0.0,0.30)
ax2.set_yticks([0.05,0.1,0.15,0.2,0.25,0.3])
ax2.set_xlabel("Spectral index $\gamma$")
ax2.set_ylabel("Fraction of events")
ax2.annotate('(c)', xy=(0.93, 0.95), xycoords='axes fraction')
ax2.annotate('mean:'+ "%2.1f" % fit_res.gamma.mean(), xy=(0.03, 0.95), xycoords='axes fraction')
ax2.annotate('median:'+ "%2.1f" % fit_res.gamma.median(), xy=(0.03, 0.90), xycoords='axes fraction')
ax2.annotate('stddev:'+ "%2.2f" % fit_res.gamma.std(), xy=(0.03, 0.85), xycoords='axes fraction')
fig2.tight_layout()
fig2.savefig('gamma_hist.pdf')
# kappa
fig4 = plt.figure(4)
ax4 = fig4.add_subplot(111)
fit_res.kappa.plot(kind='hist', normed=False, alpha=1.0, ax=ax4, bins=np.arange(1.,10.,1.),
weights=np.ones_like(fit_res.kappa.dropna().values)/len(fit_res.kappa.dropna()),
fill=False, lw=5, edgecolor='black',histtype='step') #ls='dashed',))
ax4.set_xlim(1,9)
ax4.set_ylim(0.0,0.30)
ax4.set_yticks([0.05,0.1,0.15,0.2,0.25,0.3])#, labels, rotation='vertical')
ax4.set_xlabel("Spectral index $\kappa$")
ax4.set_ylabel("Fraction of events")
ax4.annotate('(d)', xy=(0.93, 0.95), xycoords='axes fraction')
ax4.annotate('mean:'+ "%2.1f" % fit_res.kappa.mean(), xy=(0.03, 0.95), xycoords='axes fraction')
ax4.annotate('median:'+ "%2.1f" % fit_res.kappa.median(), xy=(0.03, 0.90), xycoords='axes fraction')
ax4.annotate('stddev:'+ "%2.2f" % fit_res.kappa.std(), xy=(0.03, 0.85), xycoords='axes fraction')
fig4.tight_layout()
fig4.savefig('kappa_hist.pdf')
# Temp
fig6 = plt.figure(6)
ax6 = fig6.add_subplot(111)
fit_res.T_vth.plot(kind='hist', normed=False, alpha=0.8, ax=ax6, bins=np.arange(0,42.5,2.5),
weights=np.ones_like(fit_res.T_vth.dropna().values)/len(fit_res.T_vth.dropna()),
fill=False, lw=5, edgecolor='blue',histtype='step')
fit_res.T_vth_kappa.plot(kind='hist', normed=False, alpha=0.8, ax=ax6, bins=np.arange(0,42.5,2.5),
weights=np.ones_like(fit_res.T_vth_kappa.dropna().values)/len(fit_res.T_vth_kappa.dropna()),
fill=False, lw=5, edgecolor='green',histtype='step')
fit_res.T_kappa.plot(kind='hist', normed=False, alpha=0.8, ax=ax6, bins=np.arange(0,42.5,2.5),
weights=np.ones_like(fit_res.T_kappa.dropna().values)/len(fit_res.T_kappa.dropna()),
fill=False, lw=5, edgecolor='red',histtype='step')
ax6.set_xlim(0,40)
ax6.set_ylim(0.0,0.30)
ax6.set_xlabel("Temperature [MK]")
ax6.set_ylabel("Fraction of events")
ax6.annotate('(a)', xy=(0.93, 0.95), xycoords='axes fraction')
ax6.annotate('mean:', xy=(0.03, 0.95), xycoords='axes fraction')
ax6.annotate("%2.1f;" % fit_res.T_kappa.mean(), xy=(0.18, 0.95), xycoords='axes fraction', color='red')
ax6.annotate("%2.1f;" % fit_res.T_vth_kappa.mean(), xy=(0.30, 0.95), xycoords='axes fraction', color='green')
ax6.annotate("%2.1f" % fit_res.T_vth.mean(), xy=(0.42, 0.95), xycoords='axes fraction', color='blue')
ax6.annotate('median:', xy=(0.03, 0.90), xycoords='axes fraction')
ax6.annotate("%2.1f;" % fit_res.T_kappa.median(), xy=(0.22, 0.90), xycoords='axes fraction', color='red')
ax6.annotate("%2.1f;" % fit_res.T_vth_kappa.median(), xy=(0.34, 0.90), xycoords='axes fraction', color='green')
ax6.annotate("%2.1f" % fit_res.T_vth.median(), xy=(0.46, 0.90), xycoords='axes fraction', color='blue')
ax6.annotate('stddev:', xy=(0.03, 0.85), xycoords='axes fraction')
ax6.annotate("%2.1f;" % fit_res.T_kappa.std(), xy=(0.20, 0.85), xycoords='axes fraction', color='red')
ax6.annotate("%2.1f;" % fit_res.T_vth_kappa.std(), xy=(0.29, 0.85), xycoords='axes fraction', color='green')
ax6.annotate("%2.1f" % fit_res.T_vth.std(), xy=(0.39, 0.85), xycoords='axes fraction', color='blue')
fig6.tight_layout()
fig6.savefig('T_hist.pdf')
# sep
fig7 = plt.figure(7)
ax7 = fig7.add_subplot(111)
fit_res.d_max.plot(kind='hist', normed=False, alpha=0.8, ax=ax7, bins=np.arange(-23.,25.,2.),
weights=np.ones_like(fit_res.d_max.dropna().values)/len(fit_res.d_max.dropna()),
fill=False, lw=5, edgecolor='blue',histtype='step')
fit_res.d_com.plot(kind='hist', normed=False, alpha=0.8, ax=ax7, bins=np.arange(-23,25,2.),
weights=np.ones_like(fit_res.d_com.dropna().values)/len(fit_res.d_com.dropna()),
fill=False, lw=5, edgecolor='red',histtype='step')
ax7.set_xlim(-24,24)
ax7.set_yticks([0.1,0.2,0.3,0.4,0.5])
ax7.set_ylim(0.0,0.6)
ax7.set_xlabel("Separation [Mm]")
ax7.set_ylabel("Fraction of events")
ax7.annotate('mean:', xy=(0.03, 0.95), xycoords='axes fraction')
ax7.annotate("%2.1f;" % fit_res.d_max.mean(), xy=(0.17, 0.95), xycoords='axes fraction', color='blue')
ax7.annotate("%2.1f" % fit_res.d_com.mean(), xy=(0.26, 0.95), xycoords='axes fraction', color='red')
ax7.annotate('median:', xy=(0.03, 0.90), xycoords='axes fraction')
ax7.annotate("%2.1f;" % fit_res.d_max.median(), xy=(0.21, 0.90), xycoords='axes fraction', color='blue')
ax7.annotate("%2.1f" % fit_res.d_com.median(), xy=(0.30, 0.90), xycoords='axes fraction', color='red')
ax7.annotate('stddev:', xy=(0.03, 0.85), xycoords='axes fraction')
ax7.annotate("%2.1f;" % fit_res.d_max.std(), xy=(0.19, 0.85), xycoords='axes fraction', color='blue')
ax7.annotate("%2.1f" % fit_res.d_com.std(), xy=(0.28, 0.85), xycoords='axes fraction', color='red')
ax7.xaxis.set_minor_locator(AutoMinorLocator(2))
ax7.yaxis.set_minor_locator(AutoMinorLocator(2))
fig7.tight_layout()
fig7.savefig('offset_hist.pdf')
# GOES correlation coeff
fig8 = plt.figure(8)
ax8 = fig8.add_subplot(111)
fit_res.goes_corr_high.plot(kind='hist', normed=False, alpha=0.8, ax=ax8, bins=np.arange(0.3,1.1,0.1),
weights=np.ones_like(fit_res.goes_corr_high.dropna().values)/len(fit_res.goes_corr_high.dropna()),
fill=False, lw=5, edgecolor='blue',histtype='step')
fit_res.goes_corr_low.plot(kind='hist', normed=False, alpha=0.8, ax=ax8, bins=np.arange(0.3,1.1,0.1),
weights=np.ones_like(fit_res.goes_corr_low.dropna().values)/len(fit_res.goes_corr_low.dropna()),
fill=False, lw=5, edgecolor='red',histtype='step')
ax8.set_xlim(0.3,1)
ax8.set_yticks([0.05,0.1,0.15,0.2,0.25,0.3])
ax8.set_xlabel("Correlation coefficient")
ax8.set_ylabel("Fraction of events")
ax8.annotate('mean:', xy=(0.03, 0.95), xycoords='axes fraction')
ax8.annotate("%2.1f;" % fit_res.goes_corr_high.mean(), xy=(0.18, 0.95), xycoords='axes fraction', color='blue')
ax8.annotate("%2.1f" % fit_res.goes_corr_low.mean(), xy=(0.27, 0.95), xycoords='axes fraction', color='red')
ax8.annotate('median:', xy=(0.03, 0.90), xycoords='axes fraction')
ax8.annotate("%2.1f;" % fit_res.goes_corr_high.median(), xy=(0.22, 0.90), xycoords='axes fraction', color='blue')
ax8.annotate("%2.1f" % fit_res.goes_corr_low.median(), xy=(0.31, 0.90), xycoords='axes fraction', color='red')
ax8.annotate('stddev:', xy=(0.03, 0.85), xycoords='axes fraction')
ax8.annotate("%2.1f;" % fit_res.goes_corr_high.std(), xy=(0.20, 0.85), xycoords='axes fraction', color='blue')
ax8.annotate("%2.1f" % fit_res.goes_corr_low.std(), xy=(0.29, 0.85), xycoords='axes fraction', color='red')
ax8.xaxis.set_minor_locator(AutoMinorLocator(0))
ax8.yaxis.set_minor_locator(AutoMinorLocator(0))
fig8.tight_layout()
fig8.savefig('GOES_corr_hist.pdf')
# GOES lag
fig9 = plt.figure(9)
ax9 = fig9.add_subplot(111)
fit_res.goes_lag_high.plot(kind='hist', normed=False, alpha=0.8, ax=ax9, bins=np.arange(-26,30,4.),
weights=np.ones_like(fit_res.goes_lag_high.dropna().values)/len(fit_res.goes_lag_high.dropna()),
fill=False, lw=5, edgecolor='blue',histtype='step')
fit_res.goes_lag_low.plot(kind='hist', normed=False, alpha=0.8, ax=ax9, bins=np.arange(-26,30,4.),
weights=np.ones_like(fit_res.goes_lag_low.dropna().values)/len(fit_res.goes_lag_low.dropna()),
fill=False, lw=5, edgecolor='red',histtype='step')
ax9.set_xlim(-28,28)
ax9.set_ylim(0.0,0.55)
ax9.set_yticks([0.1,0.2,0.3,0.4,0.5])
ax9.set_xlabel("Lag (s)")
ax9.set_ylabel("Fraction of events")
ax9.annotate('mean:', xy=(0.03, 0.95), xycoords='axes fraction')
ax9.annotate("%2.1f;" % fit_res.goes_lag_high.mean(), xy=(0.18, 0.95), xycoords='axes fraction', color='blue')
ax9.annotate("%2.1f" % fit_res.goes_lag_low.mean(), xy=(0.27, 0.95), xycoords='axes fraction', color='red')
ax9.annotate('median:', xy=(0.03, 0.90), xycoords='axes fraction')
ax9.annotate("%2.1f;" % fit_res.goes_lag_high.median(), xy=(0.22, 0.90), xycoords='axes fraction', color='blue')
ax9.annotate("%2.1f" % fit_res.goes_lag_low.median(), xy=(0.31, 0.90), xycoords='axes fraction', color='red')
ax9.annotate('stddev:', xy=(0.03, 0.85), xycoords='axes fraction')
ax9.annotate("%2.1f;" % fit_res.goes_lag_high.std(), xy=(0.20, 0.85), xycoords='axes fraction', color='blue')
ax9.annotate("%2.1f" % fit_res.goes_lag_low.std(), xy=(0.29, 0.85), xycoords='axes fraction', color='red')
ax9.xaxis.set_minor_locator(AutoMinorLocator(0))
ax9.yaxis.set_minor_locator(AutoMinorLocator(0))
fig9.tight_layout()
fig9.savefig('GOES_lag_hist.pdf')
fig9.show()
In [19]:
col_names = ['A','E_break','F_nth','F_th','H','Pos_X','Pos_Y','T_kappa','T_vth','T_vth_kappa',\
'd_com','d_max','gamma','goes_corr_high','goes_corr_low', 'goes_lag_high', 'goes_lag_low',\
'kappa','level','n','tau_cross','tau_loss']
fit_res.corr()
Out[19]:
In [20]:
fig, ax = plt.subplots(figsize=(30, 30))
plt.imshow(fit_res[col_names].corr(), interpolation='nearest', aspect='auto', cmap='bwr')
plt.colorbar()
plt.xticks(range(fit_res[col_names].corr().shape[0]), col_names, rotation='vertical')
plt.yticks(range(fit_res[col_names].corr().shape[0]), col_names)
plt.show()
In [21]:
# plot timescales
fig = plt.figure(figsize=[12,12])
ax = fig.add_subplot(111)
ax.set_xlabel(r"$\tau_{cross} [s]$")
ax.set_ylabel(r"$\tau_{loss} [s]$")
ax.set_xlim([0.1,0.5])
ax.set_ylim([0.01,100])
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_xticks([0.1,0.2,0.3,0.4,0.5])
ax.get_xaxis().set_major_formatter(matplotlib.ticker.ScalarFormatter())
ax.scatter(fit_resK.tau_cross, fit_resK.tau_loss, c='blue', s=100, marker='*', alpha =0.7,label='$\gamma$')
ax.scatter(fit_resO.tau_cross, fit_resO.tau_loss, c='red', s=80, alpha =0.7,label='$\gamma$')
ax.legend(['Cycle 23','Cycle 24'], loc='upper left',scatterpoints = 1,prop={'size':23}, frameon=False)
ax.plot(np.arange(0.,10,0.1), np.arange(0.,10,0.1), ls='--', lw=2, c='black',alpha =0.7,label='$\gamma$')
fig.tight_layout()
fig.savefig('tau_plot_15keV.pdf')
fig.show()
In [22]:
# fit and plot total energy fluxes
mask = (~np.isnan(fit_res['F_th'].values) & ~np.isnan(fit_res['F_nth'].values))
linfit = linregress(np.log10(fit_res['F_th'][mask]),np.log10(fit_res['F_nth'][mask]))
fig = plt.figure(figsize=[12,12])
ax = fig.add_subplot(111)
ax.tick_params(axis='x', pad=15)
ax.set_xlabel(r"Total Thermal Energy Flux [keV/cm$^2$/s]")
ax.set_ylabel(r"Total Non-thermal Energy Flux [keV/cm$^2$/s]")
ax.set_xlim([1e2, 1e9])
ax.set_ylim([1e2, 1e9])
ax.set_xscale("log")
ax.set_yscale("log")
ax.scatter(fit_resK.F_th, fit_resK.F_nth, c='blue', s=100, marker='*', alpha =0.7,label='$\gamma$')
ax.scatter(fit_resO.F_th, fit_resO.F_nth, c='red', s=80, alpha =0.7,label='$\gamma$')
ax.legend(['Cycle 23','Cycle 24'], loc='upper left', scatterpoints = 1, prop={'size':23}, frameon=False)
ax.plot(np.arange(1e1,2e9,1e9), np.arange(1e1,2e9,1e9), ls='--', lw=2, c='black',alpha =0.7,label='$\gamma$')
ax.plot(np.arange(1e1,2e9,1e9), np.arange(1e1,2e9,1e9)**(linfit.slope) * 10**(linfit.intercept),\
ls='-', lw=2, c='black',alpha =0.7,label='Fit')
fig4.tight_layout()
fig4.savefig('fluxes.pdf')
fig4.show()
In [23]:
# fit and plot kappa and gamma
mask = (~np.isnan(fit_res['gamma'].values) & ~np.isnan(fit_res['kappa'].values))
linfit = linregress((fit_res['gamma'][mask]),(fit_res['kappa'][mask]))
fig = plt.figure(figsize=[12,12])
ax = fig.add_subplot(111)
ax.set_xlabel("$\gamma$")
ax.set_ylabel("$\kappa$")
ax.set_xlim([2,9])
ax.set_ylim([2,9])
ax.scatter(fit_resK.gamma, fit_resK.kappa, c='blue', s=100, marker='*',alpha =0.7,label='$\gamma$')
ax.scatter(fit_resO.gamma, fit_resO.kappa, c='red',s=80, alpha =0.7,label='$\gamma$')
ax.legend(['Cycle 23','Cycle 24'], loc='upper left',scatterpoints = 1,prop={'size':23}, frameon=False)
ax.plot(np.arange(0.,10,0.1), np.arange(0.,10,0.1)*linfit.slope + linfit.intercept, ls='-', lw=2, c='black',alpha =0.7,label='Fit')
ax.plot(np.arange(0.,10,0.1), np.arange(0.,10,0.1)-1, ls=':', lw=3, c='darkgreen',alpha =1)
#ax.plot(np.arange(0.,10,0.1), np.arange(0.,10,0.1)+1, ls='-.', lw=3, c='purple',alpha =1)
ax.annotate('$\kappa = \gamma-1$', xy=(0.75, 0.57), xycoords='axes fraction', color='darkgreen',alpha=1,size=35)
#ax.annotate("$\kappa = \gamma+1$", xy=(0.02, 0.44), xycoords='axes fraction', color='purple',alpha=1,size=35)
ax.errorbar(fit_resO.gamma, fit_resO.kappa,\
xerr=[fit_resO.gamma_err,fit_resO.gamma_err], yerr=[fit_resO.kappa_err,fit_resO.kappa_err], alpha =0.4, c='red',linestyle="None")
ax.errorbar(fit_resK.gamma, fit_resK.kappa,\
xerr=[fit_resK.gamma_err,fit_resK.gamma_err], yerr=[fit_resK.kappa_err,fit_resK.kappa_err], alpha =0.4, c='blue',linestyle="None")
fig.tight_layout()
fig.savefig('corr_gamma_kappa.pdf')
fig.show()
In [ ]: