Commit a4275b60 authored by Matthias Steffen's avatar Matthias Steffen
Browse files

obsolete files removed

parent 6f8bf570
;pro test_ff1
;
; use ff1 to see how a perfect LTE Spite plateau look after non-LTE corrections
;
; --- stars with log g=4.0, Teff = 5500 ... 6500 K, [Fe/H]= -1.5 ... -3.0
;
; --- sample of metallixities ---
; --- Spite plateau ---
z_test= -3.0 + 0.01*findgen(151)
; --- Full range ---
;z_test= -3.0 + 0.02*findgen(151)
nz = n_elements(z_test)
;
; --- sample of gravities ---
; --- Spite plateau ---
g_test = [4.0]
; --- Full range ---
;g_test = [3.5,4.0,4.5]
ng = n_elements(g_test)
;
; --- sample of temperatures ---
; --- Spite plateau ---
t_test= 5500.0 + 5.0*findgen(201)
; --- Full range ---
;t_test= 5000.0 + 10.0*findgen(151)
nt= n_elements(t_test)
; --- sample of Li abundances ---
a_test = [2.2]
na= n_elements(a_test)
;
a1corr=fltarr(na,nt,ng,nz)
a3corr=fltarr(na,nt,ng,nz)
;
a1inp=fltarr(na,nt,ng,nz)
t1inp=fltarr(na,nt,ng,nz)
g1inp=fltarr(na,nt,ng,nz)
z1inp=fltarr(na,nt,ng,nz)
;
a3inp=fltarr(na,nt,ng,nz)
t3inp=fltarr(na,nt,ng,nz)
g3inp=fltarr(na,nt,ng,nz)
z3inp=fltarr(na,nt,ng,nz)
;
W1FF2=fltarr(na,nt,ng,nz)
W3FF2=fltarr(na,nt,ng,nz)
a1ff3=fltarr(na,nt,ng,nz)
a3ff3=fltarr(na,nt,ng,nz)
for iz=0,nz-1 do begin
for ig=0,ng-1 do begin
for it=0,nt-1 do begin
for ia=0,na-1 do begin
t1inp[ia,it,ig,iz]=t_test[it]
g1inp[ia,it,ig,iz]=g_test[ig]
z1inp[ia,it,ig,iz]=z_test[iz]
a1inp[ia,it,ig,iz]=a_test[ia]
corr1 = ff1z_1d(t_test[it], g_test[ig], z_test[iz], a_test[ia])
a1corr[ia,it,ig,iz] = corr1
t3inp[ia,it,ig,iz]=t_test[it]
g3inp[ia,it,ig,iz]=g_test[ig]
z3inp[ia,it,ig,iz]=z_test[iz]
a3inp[ia,it,ig,iz]=a_test[ia]
corr3 = ff1z_3d(t_test[it], g_test[ig], z_test[iz], a_test[ia])
a3corr[ia,it,ig,iz] = corr3
endfor
endfor
endfor
endfor
;
a4ps, filename='test_ff1.ps', /half
!p.font=0
!x.thick=3
!y.thick=3
;
title1='Spite plateau corrections'
xrng1=[6600,5400]
xrng2=[-3.2,-1.3]
;
;title1='Full range corrections'
;xrng1=[6600,4900]
;xrng2=[-3.2,0.2]
;
plot, [5500,6500], [1.8,2.6], xtitle='Teff [K]', ytitle='A(Li)', $
title=title1, xrange=xrng1, xstyle=1, ystyle=1, /nodata
oplot, xrng1, [2.2,2.2], line=2
oplot, t1inp, a1inp+a1corr, psym=psymuser(102,/fill), symsize=0.25,$
col=!ctv.blue
oplot, t1inp, a3inp+a3corr, psym=psymuser(102,/fill), symsize=0.25,$
col=!ctv.red
legend, ['FFI (1D_NLTE)', 'FFI (3D_NLTE)'], line=[0,0], thick=[3,1], $
psym=[8,8], color=[!ctv.blue,!ctv.red], xali=1.0, yali=0.0
;
plot, [-3.2,-1.3], [1.8,2.6], xtitle='[Fe/H]', ytitle='A(Li)', $
title=title1, xrange=xrng2, xstyle=1, ystyle=1, /nodata
oplot, xrng2, [2.2,2.2], line=2
oplot, z1inp, a1inp+a1corr, psym=psymuser(102,/fill), symsize=0.35,$
col=!ctv.blue
oplot, z1inp, a3inp+a3corr, psym=psymuser(102,/fill), symsize=0.35,$
col=!ctv.red
legend, ['FFI (1D_NLTE)', 'FFI (3D_NLTE)'], line=[0,0], thick=[3,1], $
psym=[8,8], color=[!ctv.blue,!ctv.red], xali=1.0, yali=0.0
;
!p.font=-1
!x.thick=1
!y.thick=1
;
a4ps, /close
;
;
end ; test_ff1
;pro test_ff2
;
; compare input EWs to ff2 output at all grid points
;
; --- grid of metallicities ---
z_test = [0.0, -0.5, -1.0, -2.0, -3.0]
nz = n_elements(z_test)
; --- grid of gravities ---
g_test = [3.5, 4.0, 4.5]
ng = n_elements(g_test)
; --- grid of temperatures ---
t_test = [5000.0, 5500.0, 5900.0, 6300.0, 6500.0]
nt= n_elements(t_test)
; --- grid of Li abundances ---
a_test = [1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0]
na= n_elements(a_test)
;
a1inp=fltarr(na,nt,ng,nz)
t1inp=fltarr(na,nt,ng,nz)
g1inp=fltarr(na,nt,ng,nz)
z1inp=fltarr(na,nt,ng,nz)
W1inp=fltarr(na,nt,ng,nz)
;
a3inp=fltarr(na,nt,ng,nz)
t3inp=fltarr(na,nt,ng,nz)
g3inp=fltarr(na,nt,ng,nz)
z3inp=fltarr(na,nt,ng,nz)
W3inp=fltarr(na,nt,ng,nz)
;
W1ff2=fltarr(na,nt,ng,nz)
W3ff2=fltarr(na,nt,ng,nz)
;
; --- read input EWs ---
get_lun, unit
openr, unit, 'LogEW_1DNLTE.txt'
for it=0,nt-1 do begin
for ig=0,ng-1 do begin
for iz=0,nz-1 do begin
for ia=0,na-1 do begin
readf, unit, ttab, gtab, ztab, atab, wtab
t1inp[ia,it,ig,iz]=ttab
g1inp[ia,it,ig,iz]=gtab
z1inp[ia,it,ig,iz]=ztab
a1inp[ia,it,ig,iz]=atab
W1inp[ia,it,ig,iz]=10^wtab
w1x=ff2_1d(ttab, gtab, ztab, atab)
W1ff2[ia,it,ig,iz]=10^w1x
endfor
endfor
endfor
endfor
close, unit
openr, unit, 'LogEW_3DNLTE.txt'
for it=0,nt-1 do begin
for ig=0,ng-1 do begin
for iz=0,nz-1 do begin
for ia=0,na-1 do begin
readf, unit, ttab, gtab, ztab, atab, wtab
t3inp[ia,it,ig,iz]=ttab
g3inp[ia,it,ig,iz]=gtab
z3inp[ia,it,ig,iz]=ztab
a3inp[ia,it,ig,iz]=atab
W3inp[ia,it,ig,iz]=10^wtab
w3x=ff2_3d(ttab, gtab, ztab, atab)
W3ff2[ia,it,ig,iz]=10^w3x
endfor
endfor
endfor
endfor
close, unit
free_lun, unit
;
err1 = (W1ff2-W1inp)/W1inp
err3 = (W3ff2-W3inp)/W3inp
;
a4ps, filename='test_ff2.ps', /half
!p.font=0
!x.thick=3
!y.thick=3
;
plot, 100.0*err1, xtitle='index', ytitle='EW_FF2-EW_inp [%]', thick=3
oplot, 100.0*err3, col=!ctv.red
legend, ['1D_NLTE', '3D_NLTE'], line=[0,0], thick=[3,1], $
color=[!ctv.black,!ctv.red]
;
!p.font=-1
!x.thick=1
!y.thick=1
;
a4ps, /close
;
err1rms = sqrt(avg(err1^2))
err3rms = sqrt(avg(err3^2))
; --- Maximum error ---
ix1 = where(ABS(err1) eq MAX(ABS(err1)))
ix3 = where(ABS(err3) eq MAX(ABS(err3)))
;
get_lun, unit
openw, unit, 'test_ff2.out'
;
printf, unit, 'RMS mean error of 1D EWs = ' +string(100.0*err1rms) + ' %'
printf, unit, 'Maximum error of 1D EWs = ' +string(100.0*err1[ix1]) + ' %'
printf, unit, 'at parameters'
printf, unit, 'Teff ='+ string(t1inp[ix1])
printf, unit, 'log g ='+ string(g1inp[ix1])
printf, unit, '[Fe/H]='+ string(z1inp[ix1])
printf, unit, 'A(Li) ='+ string(a1inp[ix1])
;
printf, unit, 'RMS mean error of 3D EWs = ' +string(100.0*err3rms) + ' %'
printf, unit, 'Maximum error of 3D EWs = ' +string(100.0*err3[ix3]) + ' %'
printf, unit, 'at parameters'
printf, unit, 'Teff ='+ string(t3inp[ix3])
printf, unit, 'log g ='+ string(g3inp[ix3])
printf, unit, '[Fe/H]='+ string(z3inp[ix3])
printf, unit, 'A(Li) ='+ string(a3inp[ix3])
;
close, unit
free_lun, unit
;
end ; test_ff2
;pro test_ff3
;
; compare ff3 output with known A(Li) of input EWs at all grid points
;
; --- grid of metallicities ---
z_test = [0.0, -0.5, -1.0, -2.0, -3.0]
nz = n_elements(z_test)
; --- grid of gravities ---
g_test = [3.5, 4.0, 4.5]
ng = n_elements(g_test)
; --- grid of temperatures ---
t_test = [5000.0, 5500.0, 5900.0, 6300.0, 6500.0]
nt= n_elements(t_test)
; --- grid of Li abundances ---
a_test = [1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0]
na= n_elements(a_test)
;
a1inp=fltarr(na,nt,ng,nz)
t1inp=fltarr(na,nt,ng,nz)
g1inp=fltarr(na,nt,ng,nz)
z1inp=fltarr(na,nt,ng,nz)
W1inp=fltarr(na,nt,ng,nz)
;
a3inp=fltarr(na,nt,ng,nz)
t3inp=fltarr(na,nt,ng,nz)
g3inp=fltarr(na,nt,ng,nz)
z3inp=fltarr(na,nt,ng,nz)
W3inp=fltarr(na,nt,ng,nz)
;
a1ff3=fltarr(na,nt,ng,nz)
a3ff3=fltarr(na,nt,ng,nz)
;
; --- read inout EWs ---
get_lun, unit
openr, unit, 'LogEW_1DNLTE.txt'
for it=0,nt-1 do begin
for ig=0,ng-1 do begin
for iz=0,nz-1 do begin
for ia=0,na-1 do begin
readf, unit, ttab, gtab, ztab, atab, wtab
t1inp[ia,it,ig,iz]=ttab
g1inp[ia,it,ig,iz]=gtab
z1inp[ia,it,ig,iz]=ztab
a1inp[ia,it,ig,iz]=atab
W1inp[ia,it,ig,iz]=10^wtab
a1x=ff3_1d(ttab, gtab, ztab, 10^wtab)
a1ff3[ia,it,ig,iz]=a1x
endfor
endfor
endfor
endfor
close, unit
openr, unit, 'LogEW_3DNLTE.txt'
for it=0,nt-1 do begin
for ig=0,ng-1 do begin
for iz=0,nz-1 do begin
for ia=0,na-1 do begin
readf, unit, ttab, gtab, ztab, atab, wtab
t3inp[ia,it,ig,iz]=ttab
g3inp[ia,it,ig,iz]=gtab
z3inp[ia,it,ig,iz]=ztab
a3inp[ia,it,ig,iz]=atab
W3inp[ia,it,ig,iz]=10^wtab
a3x=ff3_3d(ttab, gtab, ztab, 10^wtab)
a3ff3[ia,it,ig,iz]=a3x
endfor
endfor
endfor
endfor
close, unit
free_lun, unit
;
err1 = a1ff3-a1inp
err3 = a3ff3-a3inp
;
a4ps, filename='test_ff3.ps', /half
!p.font=0
!x.thick=3
!y.thick=3
;
plot, err1, xtitle='index', ytitle='A(Li)_FF3 - A(Li)_inp [dex]', thick=3
oplot, err3, col=!ctv.red
legend, ['1D_NLTE', '3D_NLTE'], line=[0,0], thick=[3,1], $
color=[!ctv.black,!ctv.red], xali=1.0, yali=0.0
;
!p.font=-1
!x.thick=1
!y.thick=1
;
a4ps, /close
;
;
err1rms = sqrt(avg(err1^2))
err3rms = sqrt(avg(err3^2))
; --- Maximum error ---
ix1 = where(ABS(err1) eq MAX(ABS(err1)))
ix3 = where(ABS(err3) eq MAX(ABS(err3)))
;
get_lun, unit
openw, unit, 'test_ff3.out'
;
printf, unit, 'RMS mean error of 1D A(Li) = ' +string(err1rms) + ' dex'
printf, unit, 'Maximum error of 1D A(Li) = ' +string(err1[ix1]) + ' dex'
printf, unit, 'at parameters'
printf, unit, 'Teff ='+ string(t1inp[ix1])
printf, unit, 'log g ='+ string(g1inp[ix1])
printf, unit, '[Fe/H]='+ string(z1inp[ix1])
printf, unit, 'A(Li) ='+ string(a1inp[ix1])
printf, unit, 'Ew = '+ string(w1inp[ix1])
;
printf, unit, 'RMS mean error of 3D A(Li) = ' +string(err3rms) + ' dex'
printf, unit, 'Maximum error of 3D A(Li) = ' +string(err3[ix3]) + ' dex'
printf, unit, 'at parameters'
printf, unit, 'Teff ='+ string(t3inp[ix3])
printf, unit, 'log g ='+ string(g3inp[ix3])
printf, unit, '[Fe/H]='+ string(z3inp[ix3])
printf, unit, 'A(Li) ='+ string(a1inp[ix3])
printf, unit, 'Ew = '+ string(w3inp[ix3])
;
close, unit
free_lun, unit
;
end ; test_ff3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment