;$Id: pspecm_scl5_compb.pro,v 1.2 2019/03/03 05:40:05 brandenb Exp $
if !d.name eq 'PS' then begin
  ;device,xsize=18,ysize=8,yoffset=3
  device,xsize=18,ysize=16,yoffset=3
  !p.charthick=3 & !p.thick=3 & !x.thick=3 & !y.thick=3
end
;
dir1='F288a_sig1_t11b'
dir2='F288a_sig1'
dir3='F288a_sig0_t11b'
;dir3='M1152e_exp6k4'
;
yr_pspecm_scl3=[1d-16,5d-10]
yr_pspechm_scl3=[2d-24,2.2d-20]
;
yr_pspecm_scl3=[1d-19,5d-12]
yr_pspechm_scl3=[2d-26,2.2d-21]
;
siz=1.3
!p.charsize=1.7
!x.margin=[7.3,0.5]
!y.margin=[3.2,0.2]
!p.multi=[0,1,2]
fac_h=1.263e-18
fac2=2.
half='!s!u 1!n!r!s-!r!d 2!n'
specm='/specm.sav'
label=''
;
;  determine normalization
;
default,maglabel,'mag'
default,green_lines,0
default,plot_polarization,1
ytickf='logticks_exp'
yr=yr_pspecm_scl3
;
Hstar=2.066d10
a0=1.2545d15
freq=Hstar/(2.*!pi*a0)
H0=3.24d-18
rhocrit_fac=3./(8.*!pi)
fac=(Hstar/H0)^2/rhocrit_fac*(1./a0)^4
facGW=1./(16.*!pi)
xr=[2.4e-4,2.3e-2]
circ_sym,0.7,1
mixed=0.
;
;  1st panel
;
!p.title='!6';+run
!x.title='!6'
!y.title='!6!8h!6!s!d0!n!r!u2!n!7X!6!dGW!n(!8f!6)'
;
restore,'../'+dir1+specm
grav_tot=grav1m+grah1m/tm^2+mixed
OmegaGW=facGW*fac*k*grav_tot
plot_oo,freq*k,OmegaGW,xr=xr,yr=yr,ytickf=ytickf
print,'AXEL1: facGW,fac=',facGW,fac,facGW*fac
;
;restore,'../'+dir0+specm
;grav_tot=grav1m+grah1m/tm^2+mixed
;OmegaGW=facGW*fac*k*grav_tot
;;oplot,freq*k,OmegaGW,li=2,col=155
;
restore,'../'+dir2+specm
grav_tot=grav1m+grah1m/tm^2+mixed
OmegaGW=facGW*fac*k*grav_tot
oplot,freq*k,OmegaGW,col=122
;
restore,'../'+dir3+specm
grav_tot=grav1m+grah1m/tm^2+mixed
OmegaGW=facGW*fac*k*grav_tot
oplot,freq*k,OmegaGW,col=55
;
;xyouts,7.0e-3,1.0e-15,'!6hel2',siz=siz
;xyouts,1.6e-2,1.3e-15,'!6hel3',siz=siz,col=122
;xyouts,2.8e-3,4.3e-16,'!6noh2',siz=siz,col=55
;
xyouts,7.0e-3,1.0e-18,'!6hel2',siz=siz
xyouts,2.8e-3,1.3e-16,'!6hel3',siz=siz,col=122
xyouts,1.0e-2,1.3e-16,'!6noh2',siz=siz,col=55
;
if green_lines then begin
  loadct,6
  xx=6*[1.6e-3,0.7e-2] & oplot,xx,6*4.0e-7/(xx/.001)^0.667,col=122
  xx=6*[2.0e-3,1.0e-2] & oplot,xx,2.0e-7/(xx/.001)^2.667,col=122
  xyouts,.05,1e-7,'!9A!8f!6!u-2/3!n',col=122,siz=siz
  xyouts,.04,5e-13,'!9A!8f!6!u-8/3!n',col=122,siz=siz
  ;
  xx=[5e-4,1.4e-3] & oplot,xx,2e-7*(xx/.001)^5.,col=122
  xx=[5e-4,2.4e-3] & oplot,xx,1e-9*(xx/.001)^2.2,col=122
  xyouts,4e-4,5e-8,'!9A!8f!6!u5!n',col=122,siz=siz
  xyouts,2.7e-4,4e-11,'!9A!8f!6!u2.2!n',col=122,siz=siz
  loadct,5
endif
;
;  Caprini+16, Cornish, Maggiore00 points
;
loadct,6
dir='~/tex/roper/PencilGW/data/'
file=dir+'Cornish.rtf'
c1=rtable(file,2,head=1)
;oplot,10^c1[0,*],((10^c1[1,*]/fac_h)*10^c1[0,*])^2,li=4,col=122
;
file=dir+'Cornish20Yrs.dat'
c2=rtable(file,2,head=1)
;oplot,10^c2[0,*],((10^c2[1,*]/fac_h)*10^c2[0,*])^2,li=3,col=122
;
file=dir+'Maggiore.rtf'
m1=rtable(file,2,head=1)
;
file=dir+'Caprini-C3.rtf'
a3=rtable(file,2,head=1)
oplot,10^a3[0,*],10^a3[1,*],li=2,col=122
;
file=dir+'Caprini-C1.rtf'
a1=rtable(file,2,head=1)
oplot,10^a1[0,*],10^a1[1,*],li=1,col=122
;
xyouts,1.5e-2,1.2e-13,'!6(i)',siz=siz,col=122
xyouts,7.0e-3,4.5e-13,'!6(ii)',siz=siz,col=122
;xyouts,9e-3,3.4e-10,'!6(iii)',siz=siz,col=122
;xyouts,4e-3,3.8e-10,'!6(iv)',siz=siz,col=122
;
loadct,5
;
;  2nd panel
;
!y.title='!8h!6!dc!n(!8f!6)'
!x.title='!8f!6 [Hz]'
default,kin,0
default,hdone,1
ytickf='logticks_exp'
yr=yr_pspechm_scl3
circ_sym,0.7,1
;
restore,'../'+dir1+specm
fach=1.263e-18/(freq*k[1:*])
grav_tot=grav1m+grah1m/tm^2+mixed
OmegaGW=facGW*fac*k*grav_tot
plot_oo,freq*k[1:*],fach*sqrt(OmegaGW[1:*]),xr=xr,yr=yr,ytickf=ytickf
;- oplot,freq*k,8e-16*sqrt(k*grah1m),li=1
;
;  0th line
;
;restore,'../'+dir0+specm
;fach=1.263e-18/(freq*k[1:*])
;grav_tot=grav1m+grah1m/tm^2+mixed
;OmegaGW=facGW*fac*k*grav_tot
;;oplot,freq*k[1:*],fach*sqrt(OmegaGW[1:*]),col=155
;;oplot,freq*k,8e-16*sqrt(k*grah1m),co=155,li=1
;
;  2nd line
;
restore,'../'+dir2+specm
fach=1.263e-18/(freq*k[1:*])
grav_tot=grav1m+grah1m/tm^2+mixed
OmegaGW=facGW*fac*k*grav_tot
oplot,freq*k[1:*],fach*sqrt(OmegaGW[1:*]),col=122
;- oplot,freq*k,8e-16*sqrt(k*grah1m),co=122,li=1
;
;  3rd line
;
restore,'../'+dir3+specm
fach=1.263e-18/(freq*k[1:*])
grav_tot=grav1m+grah1m/tm^2+mixed
OmegaGW=facGW*fac*k*grav_tot
oplot,freq*k[1:*],fach*sqrt(OmegaGW[1:*]),col=55
;- oplot,freq*k,8e-16*sqrt(k*grah1m),co=55,li=1
;
;xyouts,7.0e-3,6.0e-24,'!6hel2',siz=siz
;xyouts,1.5e-2,4.3e-24,'!6hel3',siz=siz,col=122
;xyouts,2.8e-3,4.3e-24,'!6noh2',siz=siz,col=55
;
xyouts,6.0e-3,2.5e-25,'!6hel2',siz=siz
xyouts,2.8e-3,1.3e-24,'!6hel3',siz=siz,col=122
xyouts,1.0e-2,1.3e-24,'!6noh2',siz=siz,col=55
;
;  continous limits
;
loadct,6
;oplot,10^c1[0,*],10^c1[1,*],li=4,col=122
;oplot,10^c2[0,*],10^c2[1,*],li=3,col=122
oplot,10^a3[0,*],fac_h*sqrt(10^a3[1,*])/10^a3[0,*],li=2,col=122
oplot,10^a1[0,*],fac_h*sqrt(10^a1[1,*])/10^a1[0,*],li=1,col=122
;
xyouts,1.6e-2,2.4e-23,'!6(i)',siz=siz,col=122
xyouts,1.2e-2,5.2e-22,'!6(ii)',siz=siz,col=122
;xyouts,9.0e-3,1.9e-21,'!6(iii)',siz=siz,col=122
;xyouts,5.0e-3,5.3e-21,'!6(iv)',siz=siz,col=122
;
loadct,5
;
if green_lines then begin
  loadct,6
  xx=6*[2.0e-3,1.8e-2] & oplot,xx,5.0e-19/(xx/.001)^(7./3.),col=122
  xyouts,.02,2e-23,'!9A!8f!6!u-7/3!n',col=122,siz=siz
  ;
  xx=[5e-4,2.4e-3] & oplot,xx,7e-21*(xx/.001)^(.1),col=122
  xyouts,2.7e-4,1e-21,'!9A!8f!6!u0.1!n',col=122,siz=siz
  loadct,5
endif
;
print,'$mv idl.ps ~/tex/roper/GW/fig/pspecm_scl5_compb.ps'
END
