;$Id: EEGW_vs_EEKM.pro,v 1.5 2022/08/24 15:06:00 brandenb Exp $
if !d.name eq 'PS' then begin
  device,xsize=18,ysize=9,yoffset=3
  !p.charthick=3 & !p.thick=3 & !x.thick=3 & !y.thick=3
end
;
siz=1.3
!p.charsize=1.7
!x.margin=[8.2,0.5]
!y.margin=[3.2,0.2]
!x.title='!13E!6!s!dM,K!6!n!r!umax!n'
!y.title='!13E!6!s!dGW!n!r!usat!n'
si2=1.3
;
file='EEGW_vs_EEKM.dat'
a=rtable(file,head=1,9)
EEKM=reform(a[2+0,*])
EEGW=reform(a[2+1,*])
kin=reform(a[2+2,*])
hel=reform(a[2+3,*])
chi=reform(a[2+4,*])
tmax=reform(a[2+5,*])
kf=reform(a[2+6,*])
xr=[1e-3,2e-1]
yr=[5e-11,1.8e-7]
yr=[5e-11,1.8e-3]
;ora=where(kin eq 0 and tmax ge 1.002 and hel eq 1)
;ope=where(kin eq 0 and kf eq 600. and hel eq 0)
;red=where(kin eq 0 and kf eq 600. and hel eq 1)
;gre=where(kin eq 0 and kf ne 600. and hel eq 1)
;
ora=where(kin eq 0 and tmax ge 1.002 and hel eq 1 and chi eq 0)
ope=where(kin eq 0 and kf eq 600. and hel eq 0 and chi eq 0)
red=where(kin eq 0 and kf eq 600. and hel eq 1 and chi eq 0)
gre=where(kin eq 0 and kf ne 600. and hel eq 1 and chi eq 0)
blue=where(kin eq 1 and chi eq 0)
plot_oo,EEKM,EEGW,ps=3,xr=xr,yr=yr,/nodata
;
loadct,0
col0=188
circ_sym,0.8,1
oplot,EEKM(blue),EEGW(blue),ps=8,col=col0
oplot,EEKM(red),EEGW(red),ps=8,col=col0
;oplot,EEKM(ora),EEGW(ora),ps=8,col=col0
;oplot,EEKM(gre),EEGW(gre),ps=8,col=col0
;
;circ_sym,1.1,0
;oplot,EEKM(ope),EEGW(ope),ps=8,col=col0
;
ret=where(kin eq 1 and chi eq 1)
ora=where(kin eq 1 and chi eq 2)
yel=where(kin eq 1 and chi eq 3)
blu=where(kin eq 1 and chi eq 4)
gre=where(kin eq 0 and chi eq 5)
grf=where(kin eq 0 and chi eq 6)
blue=where(kin eq 1)
;
xx=[1.6e-3,1.8e-2] & oplot,xx,3.6e-4*xx^2,col=col0
xx=[3.0e-3,5e-2] & oplot,xx,9.0e-6*xx^2,col=col0
;xx=[3.0e-3,4e-2] & oplot,xx,1.5e-5*xx^2,col=col0,li=1
xx=[4.0e-3,1.5e-1] & oplot,xx,2.0e-6*xx^2,col=col0
xx=[4.0e-3,1.5e-1] & oplot,xx,2.0e-2*xx^2,col=col0  ;(new line)
xx=[4.0e-3,1.5e-1] & oplot,xx,5.0e-2*xx^2,col=col0  ;(new line)
xyouts,6.2e-3,5e-8,' !6ac',col=col0
xyouts,2.8e-2,2e-8 ,'!6hel',col=col0
xyouts,2.0e-2,4e-10,'!6ini',col=col0
;
keff=600.
loadct,5
circ_sym,1.4,1 & oplot,EEKM(ret),EEGW(ret),ps=8,col=55 & print,'A: ',keff*sqrt(EEGW(ret))/EEKM(ret)
circ_sym,1.4,0 & oplot,EEKM(ora),EEGW(ora),ps=8,col=55 & print,'B: ',keff*sqrt(EEGW(ora))/EEKM(ora)
xyouts,3.6e-3,2.3e-8,'!6A',col=55
xyouts,2.2e-3,2.3e-8,'!6B',col=55
loadct,6
circ_sym,1.4,1 & oplot,EEKM(blu),EEGW(blu),ps=8,col=122 & print,'C: ',keff*sqrt(EEGW(blu))/EEKM(blu)
circ_sym,1.4,0 & oplot,EEKM(yel),EEGW(yel),ps=8,col=122 & print,'D: ',keff*sqrt(EEGW(yel))/EEKM(yel)
xyouts,1.0e-2,9.3e-9,'!6C',col=122
xyouts,7.2e-3,6.8e-9,'!6D',col=122
loadct,5
circ_sym,1.4,1 & oplot,EEKM(gre),EEGW(gre),ps=8,col=122 & print,'E: ',keff*sqrt(EEGW(gre))/EEKM(gre)
circ_sym,1.4,0 & oplot,EEKM(grf),EEGW(grf),ps=8,col=122 & print,'F: ',keff*sqrt(EEGW(grf))/EEKM(grf)
xyouts,5.2e-3,2.2e-9,'!6E',col=122
xyouts,1.6e-2,7.7e-9,'!6F',col=122
;
file='PVtab.txt'
a=rtable(file,6,head=1)
q=reform(a[0,*])
k1=reform(a[1,*])
RR=reform(a[2,*])
EEK0=reform(a[3,*])
EEK10=reform(a[4,*])
EEGW=reform(a[5,*])
;
circ_sym,1.8,0
oplot,EEK0,EEGW,ps=8,col=155
good=where(q eq 0.)
oplot,EEK0(good),EEGW(good),ps=8,col=188
;
s=1e-3
circ_sym,.6,1
good=where(abs(k1-1.) le s and q eq 1.)
oplot,[1,1]*EEK0(good),[1,1]*EEGW(good),ps=8,col=155
good=where(abs(k1-1.) le s and q eq 0.)
oplot,[1,1]*EEK0(good),[1,1]*EEGW(good),ps=8,col=188
;
circ_sym,2.0,1
good=where(abs(k1-1.) le s and abs(q-1.) le s and abs(RR-2.) le s)
oplot,[1,1]*EEK0(good),[1,1]*EEGW(good),ps=8,col=155
print,good
;
circ_sym,2.0,1
good=where(abs(k1-1.) le s and abs(q-1.) le s and abs(RR-3.) le s)
oplot,[1,1]*EEK0(good),[1,1]*EEGW(good),ps=8,col=122
print,good
;
good=where(abs(k1-1.) le s and abs(q-0.) le s and abs(RR-2.) le s)
oplot,[1,1]*EEK0(good),[1,1]*EEGW(good),ps=8,col=188
print,good
;
print,'$mv idl.ps ~/GitHub/Axel/VortexGen/fig/EEGW_vs_EEKM.eps'
END
