;$Id: ppower_comp_hel.pro,v 1.1 2026/10/26 08:21:10 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=2.3
si2=1.4
!p.charsize=1.8
!x.margin=[8.0,2.1]
!y.margin=[3.2,0.3]
;
;  sample to compare time series form different directories
;
dir1='2048_e1em5_k180c'
dir2='2048_k1_e1em5_k180a'
;
dir1='2048_k1_e1em6_k60a_h2em13_hel'
dir2='2048_k1_e1em6_k60a_h1em14_hel'
; pc_diffruns 2048_e1em5_k180c 2048_k1_e1em5_k180a
;
xout=3e-6
yout=2e-23
fo="(e8.1)"
;
;  times must come after parameters, because it overwrites t1 and t2.
;
power,'_mag','_mag',k=k,spec1=magn1,spec2=spec2,i=n,tt=t1,/noplot,/lks,datatopdir='../'+dir1+'/data'
power,'_mag','_mag',k=k,spec1=magn2,spec2=spec2,i=n,tt=t2,/noplot,/lks,datatopdir='../'+dir2+'/data'
nk=n_elements(k)
nt=n_elements(t1)
;!p.multi=[0,1,2]
!p.multi=0
yr=[2d-13,3d-5]
yr=[2d-11,3d-2]
;
;-----------------------------------------------------------------------------
!x.title='!6'
;it1=findex(t1,t)
;print,it1,t[it1]-t1, t[it1-1]-t1, t1
it1=30
it1=29
it2=24
it3=18
it4=12
it5=0
;
;it1=22 & it2=22
;
print,t1[it1],t1[it2],t1[it3],t1[it4],t1[it5]
;print,t2[it1],t2[it2],t2[it3],t2[it4],t2[it5]
!x.title='!8k!6'
!y.title='!8E!6!dM!n(!8k!6)'
plot_oo,k[1:*],magn1[1:*,it1],yr=yr,/data
  oplot,k[1:*],magn1[1:*,it2],li=2
  oplot,k[1:*],magn1[1:*,it3],li=1
  oplot,k[1:*],magn1[1:*,it4],li=3
  oplot,k[1:*],magn1[1:*,it5],li=4
;xx=[20.,80.] & oplot,xx,1e-6/xx^(7./3.) & xyouts,70.,5e-11,siz=siz,'!9A!8k!6!u-7/3!n'
;xx=[4.,20.] & oplot,xx,5e-15*xx^4 & xyouts,11.,1e-11,siz=siz,'!9A!8k!6!u4!n'
;xx=[1.2,5.] & oplot,xx,2e-10*xx^5 & xyouts,1.7,2e-7,siz=siz,'!9A!8k!6!u5!n'
;
xx=[5.,20.] & oplot,xx,3e-2/xx^(7./3.) & xyouts,18.,3e-6,siz=si2,'!9A!8k!6!u-7/3!n'
xx=[1.6,12.] & oplot,xx,1e-9*xx^3 & xyouts,4.,8e-9,siz=si2,'!9A!8k!6!u3!n'
xx=[1.9,7.] & oplot,xx,4e-8*xx^5 & xyouts,1.8,1e-5,siz=si5,'!9A!8k!6!u5!n'
;
print,"$mv -i idl.ps ~/Overleaf/Vinay/Helicity-Gauge/figs/ppower_comp_hel.eps"
END
