;$Id: rslice_stress_plot.pro,v 1.2 2022/01/26 05:09:54 brandenb Exp $
if !d.name eq 'PS' then begin
  device,xsize=18,ysize=15,yoffset=3
  !p.charthick=1.6 & !p.thick=1.6 & !x.thick=1.6 & !y.thick=1.6
  col0=0
endif else begin
  col0=255
end
;
!p.charsize=1.9
!x.margin=[8.0,0.3]
!y.margin=[3.2,0.3]
;
ik=125
ik=5
;
!p.multi=[0,2,3]
circ_sym,.3,1
xr=[5e-3,1.8]
col=[122,55,col0,155,122]
lct=[1,2,0,0,0]
dot='!s!9!A .!n!6!r'
tilde='!9!s!aA!n!r!6'
;
;  to run in: 2048_1e1_1e4_4e8_1em4a_early4
;
restore,'StT_and_hhT_im.sav'
;
!y.title='!9!!!6'+tilde+'!8T!6(!8k!6,!8t!6)!9!!!6'
plot_oo,tt-1.,fff1[ik,*]^2+fff2[ik,*]^2,xr=xr,yr=[1e-18,4e-10],/nodata
for dik=-2,2 do begin
  if lct[dik] eq 1 then loadct,6
  if lct[dik] eq 2 then loadct,5
  oplot,tt-1.,fff1[ik+dik,*]^2+fff2[ik+dik,*]^2,col=col[dik]   
endfor
;
!y.title='!6arg['+tilde+'!8T!6(!8k!6,!8t!6)]'
;plot_oi,tt-1.,atan(fff2[ik,*],fff1[ik,*]),xr=xr,yr=[-1.,1.]*!pi,/nodata
plot,tt-1.,atan(fff2[ik,*],fff1[ik,*]),xr=xr,yr=[-1.,1.]*!pi,/nodata
for dik=-2,2 do begin
  if lct[dik] eq 1 then loadct,6
  if lct[dik] eq 2 then loadct,5
  oplot,tt-1.,atan(fff2[ik+dik,*],fff1[ik+dik,*]),ps=8,col=col[dik]
endfor
;
;-----------------------------------------------------------------------------
!y.title='!9!!!6'+tilde+dot+'!8h!6(!8k!6,!8t!6)!9!!!6'
plot_oo,tt-1.,deriv(tt,fff3[ik,*])^2+deriv(tt,fff4[ik,*])^2,xr=xr,yr=[1e-22,1e-12],/nodata
for dik=-2,2 do begin
  if lct[dik] eq 1 then loadct,6
  if lct[dik] eq 2 then loadct,5
  oplot,tt-1.,deriv(tt,fff3[ik+dik,*])^2+deriv(tt,fff4[ik+dik,*])^2,col=col[dik]
endfor
;
!y.title='!6arg['+tilde+dot+'!8h!6(!8k!6,!8t!6)]'
plot_oi,tt-1.,atan(deriv(tt,fff4[ik,*]),deriv(tt,fff3[ik,*])),xr=xr,yr=[-1.,1.]*!pi,/nodata
for dik=-2,2 do begin
  if lct[dik] eq 1 then loadct,6
  if lct[dik] eq 2 then loadct,5
  oplot,tt-1.,atan(deriv(tt,fff4[ik+dik,*]),deriv(tt,fff3[ik+dik,*])),ps=8,col=col[dik]
endfor
;
;-----------------------------------------------------------------------------
!x.title='!8t!6-1'
!y.title='!9!!!6'+tilde+'!8h!6(!8k!6,!8t!6)!9!!!6'
plot_oo,tt-1.,fff3[ik,*]^2+fff4[ik,*]^2,xr=xr,yr=[1e-28,1e-12],/nodata
for dik=-2,2 do begin
  if lct[dik] eq 1 then loadct,6
  if lct[dik] eq 2 then loadct,5
  oplot,tt-1.,fff3[ik+dik,*]^2+fff4[ik+dik,*]^2,col=col[dik]
endfor
;
!y.title='!6arg['+tilde+'!8h!6(!8k!6,!8t!6)]'
plot_oi,tt-1.,atan(fff4[ik,*],fff3[ik,*]),xr=xr,yr=[-1.,1.]*!pi,/nodata
for dik=-2,2 do begin
  if lct[dik] eq 1 then loadct,6
  if lct[dik] eq 2 then loadct,5
  oplot,tt-1.,atan(fff4[ik+dik,*],fff3[ik+dik,*]),ps=8,col=col[dik]
endfor
;
!p.multi=0
print,'$mv idl.ps ~/GitHub/Axel/GWspectra_from_CME/fig/rslice_stress_plot.eps'
END
