from numpy import *
from matplotlib.pyplot import *

import matplotlib as mpl
mpl.rcParams['xtick.major.size'] = 8
mpl.rcParams['xtick.minor.size'] = 4
mpl.rcParams['xtick.major.width'] = 1.5
mpl.rcParams['xtick.minor.width'] = 1.5
mpl.rcParams['ytick.major.size'] = 8
mpl.rcParams['ytick.minor.size'] = 4
mpl.rcParams['ytick.major.width'] = 1.5
mpl.rcParams['ytick.minor.width'] = 1.5

import matplotlib.pylab as plt
plt.rc('pdf', fonttype=42)
plt.rc('ps',  fonttype=42)


cir1f1h  =loadtxt('2000_chotoo.CIR1F1_h.dat')
cir1f1he2 =loadtxt('2000_chotoo.CIR1F1_he2.dat')
cir1f1he1=loadtxt('2000_chotoo.CIR1F1_he1.dat')

markers=5
labels=16
figure()
subplot(221)
errorbar(cir1f1h[::2,0],cir1f1h[::2,1],yerr=cir1f1h[1::2,1]-cir1f1h[::2,1],fmt='ks-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir1f1he2[::2,0],cir1f1he2[::2,1],yerr=cir1f1he2[1::2,1]-cir1f1he2[::2,1],fmt='gs-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir1f1he1[::2,0],cir1f1he1[::2,1],yerr=cir1f1he1[1::2,1]-cir1f1he1[::2,1],fmt='rs-',markersize=markers,capsize=4, elinewidth=2)
xscale('log')
yscale('log')
#xlabel('v\'/Vsw',fontsize=labels)
ylabel('f(v\')(s$^3$/km$^6$)',fontsize=labels)
xticks([1,10],['1','10'],fontsize=labels)
xlim(0.5,20)
ylim(1e-4,1e7)
yticks([1e-4,1e-2,1e0,1e2,1e4,1e6],fontsize=labels)
text(4.5,1e5,'CIR 1, F\'',fontsize=labels+1)
text(2.8,200,'H$^+$',fontsize=labels,color='k')
text(0.7,5000,'He$^{2+}$',fontsize=labels,color='g')
text(2.3,0.005,'He$^+$',fontsize=labels,color='r')


cir1fh  =loadtxt('2000_chotoo.CIR1F_h.dat')
cir1fhe2 =loadtxt('2000_chotoo.CIR1F_he2.dat')
cir1fhe1=loadtxt('2000_chotoo.CIR1F_he1.dat')
subplot(223)
errorbar(cir1fh[::2,0],cir1fh[::2,1]*7e12,yerr=(cir1fh[1::2,1]-cir1fh[::2,1])*7e12,fmt='ks-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir1fhe2[::2,0],cir1fhe2[::2,1]*7e12,yerr=(cir1fhe2[1::2,1]-cir1fhe2[::2,1])*7e12,fmt='gs-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir1fhe1[::2,0],cir1fhe1[::2,1]*7e12,yerr=(cir1fhe1[1::2,1]-cir1fhe1[::2,1])*7e12,fmt='rs-',markersize=markers,capsize=4, elinewidth=2)
xscale('log')
yscale('log')
xlabel('v\'/Vsw',fontsize=labels)
ylabel('f(v\')(s$^3$/km$^6$)',fontsize=labels)
xticks([1,10],['1','10'],fontsize=labels)
xlim(0.5,20)
ylim(1e-4,1e7)
yticks([1e-4,1e-2,1e0,1e2,1e4,1e6],fontsize=labels)
text(4.5,1e5,'CIR 1, F',fontsize=labels+1)
text(2.8,20,'H$^+$',fontsize=labels,color='k')
text(0.6,5000,'He$^{2+}$',fontsize=labels,color='g')
text(1.8,0.005,'He$^+$',fontsize=labels,color='r')



cir2sh  =loadtxt('2000_chotoo.CIR2S_h.dat')
cir2she2 =loadtxt('2000_chotoo.CIR2S_he2.dat')
cir2she1=loadtxt('2000_chotoo.CIR2S_he1.dat')
subplot(222)
errorbar(cir2sh[::2,0]/720.,cir2sh[::2,1],yerr=cir2sh[1::2,1]-cir2sh[::2,1],fmt='ks-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir2she2[::2,0]/720.,cir2she2[::2,1],yerr=cir2she2[1::2,1]-cir2she2[::2,1],fmt='gs-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir2she1[::2,0]/720.,cir2she1[::2,1],yerr=cir2she1[1::2,1]-cir2she1[::2,1],fmt='rs-',markersize=markers,capsize=4, elinewidth=2)
xscale('log')
yscale('log')
xticks([1,10],['1','10'],fontsize=labels)
xlim(0.5,20)
ylim(1e-4,1e7)
yticks([1e-4,1e-2,1e0,1e2,1e4,1e6],fontsize=labels)
text(4.5,1e5,'CIR 2, S\'',fontsize=labels+1)
text(4.5,20,'H$^+$',fontsize=labels,color='k')
text(1.5,4800,'He$^{2+}$',fontsize=labels,color='g')
text(1.8,0.04,'He$^+$',fontsize=labels,color='r')



cir2fh  =loadtxt('2000_chotoo.CIR2F_h.dat')
cir2fhe2 =loadtxt('2000_chotoo.CIR2F_he2.dat')
cir2fhe1=loadtxt('2000_chotoo.CIR2F_he1.dat')
subplot(224)
errorbar(cir2fh[::2,0],cir2fh[::2,1],yerr=cir2fh[1::2,1]-cir2fh[::2,1],fmt='ks-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir2fhe2[::2,0],cir2fhe2[::2,1],yerr=cir2fhe2[1::2,1]-cir2fhe2[::2,1],fmt='gs-',markersize=markers,capsize=4, elinewidth=2)
errorbar(cir2fhe1[::2,0],cir2fhe1[::2,1],yerr=cir2fhe1[1::2,1]-cir2fhe1[::2,1],fmt='rs-',markersize=markers,capsize=4, elinewidth=2)
xscale('log')
yscale('log')
xlabel('v\'/Vsw',fontsize=labels)
#ylabel('f(v\')(s$^3$/km$^6$)',fontsize=labels)
xticks([1,10],['1','10'],fontsize=labels)
xlim(0.5,20)
ylim(1e-4,1e7)
yticks([1e-4,1e-2,1e0,1e2,1e4,1e6],fontsize=labels)
text(4.5,1e5,'CIR 2, F\'',fontsize=labels+1)
text(2.6,20,'H$^+$',fontsize=labels,color='k')
text(0.6,5000,'He$^{2+}$',fontsize=labels,color='g')
text(1.6,0.005,'He$^+$',fontsize=labels,color='r')

tight_layout()




show()
