;$Id: pcomp_ts_k0.pro,v 1.14 2026/08/03 14:23:28 brandenb Exp $
if !d.name eq 'PS' then begin
  device,xsize=18,ysize=18,yoffset=3
  !p.charthick=3 & !p.thick=3 & !x.thick=3 & !y.thick=3
end
;
!p.charsize=1.7
!x.margin=[9.6,.5]
!y.margin=[3.2,.5]
;
;  sample to compare time series form different directories
;
dir1='Hy512d_noshock'     & nu1=2e-2 & k0_1=5.
dir2='Hy512d_noshock_k10' & nu1=2e-2 & k0_2=10.
dir3='Hy512d_noshock_k20' & nu2=2e-2 & k0_3=20.
;
dir01='Hy512h_noshock_G0_k5'  & nu1=2e-2 & k0_1=5.
dir02='Hy512h_noshock_G0_k10' & nu1=2e-2 & k0_2=10.
dir03='Hy512h_noshock_G0_k20' & nu2=2e-2 & k0_3=20.
dir04='Hy512h_noshock_G0_k50' & nu2=2e-2 & k0_4=50.
;
dir01='Hy512h_noshock_G0_k5_kcut100'  & nu1=2e-2 & k0_1=5.
dir02='Hy512h_noshock_G0_k10_kcut100' & nu1=2e-2 & k0_2=10.
dir03='Hy512h_noshock_G0_k20_kcut100' & nu2=2e-2 & k0_3=20.
dir04='Hy512h_noshock_G0_k50_kcut100' & nu2=2e-2 & k0_4=50.
;
dir0='Hy512h_noshock_k2'  & nu0=1e-2 & k0_0=2.  ;(black)
dir1='Hy512h_noshock2'    & nu1=1e-2 & k0_1=5.  ;(black)
dir2='Hy512h_noshock_k10' & nu2=1e-2 & k0_2=10. ;(blue)
dir3='Hy512h_noshock_k20' & nu3=1e-2 & k0_3=20. ;(red)
;
pc_read_ts,o=ts0,datadir='../'+dir0+'/data'
pc_read_ts,o=ts1,datadir='../'+dir1+'/data'
pc_read_ts,o=ts2,datadir='../'+dir2+'/data'
pc_read_ts,o=ts3,datadir='../'+dir3+'/data'
;
pc_read_ts,o=ts01,datadir='../'+dir01+'/data'
pc_read_ts,o=ts02,datadir='../'+dir02+'/data'
pc_read_ts,o=ts03,datadir='../'+dir03+'/data'
pc_read_ts,o=ts04,datadir='../'+dir04+'/data'
;
!p.multi=[0,1,2]
!x.range=[0,3.2]
!x.title='!6'
!y.title='!6<(!9G.!8u!6)!u2!n>/!8c!6!s!ds!n!r!u2!n!8k!6!s!d0!n!r!u2!n'
;
cs=1.
k1=1.
k0=5.*k1
;
li=2
s=1./(cs)
yr=[1e-4,1.]
s=1./(cs*k0_1)^2 & plot_io,ts1.t,s*ts1.divu2m,yr=yr,li=li
s=1./(cs*k0_2)^2 & oplot,ts2.t,s*ts2.divu2m,col=55,li=li
s=1./(cs*k0_3)^2 & oplot,ts3.t,s*ts3.divu2m,col=122,li=li
;
s=1./(cs*k0_1)^2 & oplot,ts01.t,s*ts01.divu2m
s=1./(cs*k0_2)^2 & oplot,ts02.t,s*ts02.divu2m,col=55
s=1./(cs*k0_3)^2 & oplot,ts03.t,s*ts03.divu2m,col=122
;
siz=1.7
xyouts,siz=siz,0.1,2e-4,'!6(a)'
xyouts,siz=siz,2.0,1.2e-1,'!8k!6!d0!n=2.5'
xyouts,siz=siz,1.5,4.0e-3,'!8k!6!d0!n=5',col=55
xyouts,siz=siz,1.0,5.4e-4,'!8k!6!d0!n=10',col=122
xyouts,siz=siz,2.5,5.4e-4,'!8G!6!dN!n!9=!60',col=122
xyouts,siz=siz,1.9,2.0e-4,'!8G!6!dN!n!6=0',col=122
;
;-----------------------------------------------------------------------------
li=2
yr=[5e-7,3e-3]
!x.title='!8t!6'
!y.title='!6<(!9GX!8u!6)!u2!n>/!8c!6!s!ds!n!r!u2!n!8k!6!s!d0!n!r!u2!n'
s=1./(cs*k0_1)^2 & plot_io,ts1.t,s*ts1.orms^2,yr=yr,li=li
s=1./(cs*k0_2)^2 & oplot,ts2.t,s*ts2.orms^2,col=55,li=li
s=1./(cs*k0_3)^2 & oplot,ts3.t,s*ts3.orms^2,col=122,li=li
s=1./(cs*k0_3)^2 & oplot,ts3.t,s*ts3.orms^2,col=122,li=li
;s=1./(cs*k0_0)^2 & oplot,ts0.t,s*ts0.orms^2,col=155
;
s=1./(cs*k0_1)^2 & oplot,ts01.t,s*ts01.orms^2
s=1./(cs*k0_2)^2 & oplot,ts02.t,s*ts02.orms^2,col=55
s=1./(cs*k0_3)^2 & oplot,ts03.t,s*ts03.orms^2,col=122
s=1./(cs*k0_4)^2 & oplot,ts04.t,s*ts04.orms^2,col=122
;
tcrit=2.0
print,'tcrit=',tcrit
fo="(4f10.6,2x,a)"
print,k0_0,ts0.divu2m(findex(tcrit,ts0.t)),ts0.orms(findex(tcrit,ts0.t))^2,ts0.epsK(findex(tcrit,ts0.t)),dir0,fo=fo
print,k0_1,ts1.divu2m(findex(tcrit,ts1.t)),ts1.orms(findex(tcrit,ts1.t))^2,ts1.epsK(findex(tcrit,ts1.t)),dir1,fo=fo
print,k0_2,ts2.divu2m(findex(tcrit,ts2.t)),ts2.orms(findex(tcrit,ts2.t))^2,ts2.epsK(findex(tcrit,ts2.t)),dir2,fo=fo
print,k0_3,ts3.divu2m(findex(tcrit,ts3.t)),ts3.orms(findex(tcrit,ts3.t))^2,ts3.epsK(findex(tcrit,ts3.t)),dir3,fo=fo
;print,k0_4,ts4.divu2m(findex(tcrit,ts4.t)),ts4.orms(findex(tcrit,ts4.t))^2,ts4.epsK(findex(tcrit,ts4.t)),dir4,fo=fo
;
print,k0_1,ts01.divu2m(findex(tcrit,ts01.t)),ts01.orms(findex(tcrit,ts01.t))^2,ts01.epsK(findex(tcrit,ts01.t)),dir01,fo=fo
print,k0_2,ts02.divu2m(findex(tcrit,ts02.t)),ts02.orms(findex(tcrit,ts02.t))^2,ts02.epsK(findex(tcrit,ts02.t)),dir02,fo=fo
print,k0_3,ts03.divu2m(findex(tcrit,ts03.t)),ts03.orms(findex(tcrit,ts03.t))^2,ts03.epsK(findex(tcrit,ts03.t)),dir03,fo=fo
print,k0_4,ts04.divu2m(findex(tcrit,ts04.t)),ts04.orms(findex(tcrit,ts04.t))^2,ts04.epsK(findex(tcrit,ts04.t)),dir04,fo=fo
;
xyouts,siz=siz,.1,1e-6,'!6(b)'
;
!p.multi=0
print,"$mv idl.ps ~/Overleaf/Eva/BE_collapse/fig/pcomp_ts_k0.eps"
END
