Commit 4e1d161c authored by Matthias Steffen's avatar Matthias Steffen
Browse files

ff1.pro, ff2.pro, ff3.pro are now functions, test_ff123.pro is

modified accordingly.
parent 26c8e01a
pro ff1, t, glog, z, ALi, qiso, ff1_out
function ff1, t, glog, z, ALi, qiso
;
; Coefficients based on re-computed 1D NLTE corrections by mst
; Cijk mm00 mm05 mm10 mm20 mm30
......@@ -74,31 +74,31 @@ if (t lt 4900.0 or t gt 6600.0) then begin
print, '% FF123: Teff out of range: ' + string(t,format='(F8.2)') + ' K'
print, '% FF123: must be in the range 5000 .. 6500 K'
ff1_out = [-99.9,-99.9]
return
return, ff1_out
endif
if (glog lt 3.4 or glog gt 4.6) then begin
print, '% FF123: log g out of range: ' + string(glog,format='(F5.2)')
print, '% FF123: must be in the range 3.5 .. 4.5'
ff1_out = [-99.9,-99.9]
return
return, ff1_out
endif
if (z lt -3.2 or z gt 0.2) then begin
print, '% FF123: [Fe/H] out of range: ' + string(z,format='(F5.2)')
print, '% FF123: must be in the range -3.0 .. 0.0'
ff1_out = [-99.9,-99.9]
return
return, ff1_out
endif
if (ALi lt 0.9 or ALi gt 3.1) then begin
print, '% FF123: A(Li) out of range: ' + string(Ali,format='(F5.2)')
print, '% FF123: must be in the range 1.0 .. 3.0'
ff1_out = [-99.9,-99.9]
return
return, ff1_out
endif
if (qiso lt 0.0 or qiso gt 0.1) then begin
print, '% FF123: 6Li/7Li out of range: ' + string(qiso,format='(F5.2)')
print, '% FF123: must be in the range 0.0 .. 0.082'
ff1_out = [-99.9,-99.9]
return
return, ff1_out
endif
;normalization of the T and log g
......@@ -147,5 +147,6 @@ c = ALi + d1
ff1_3dz = mcubic(ff1_3d,z_grid,z)
;
ff1_out = [ff1_1dz,ff1_3dz]
return, ff1_out
;
end
pro ff2, t, glog, z, ALi, qiso, ff2_out
function ff2, t, glog, z, ALi, qiso
;
; Coefficients based on original 1D NLTE equivalent widths by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
......@@ -74,31 +74,31 @@ if (t lt 4900.0 or t gt 6600.0) then begin
print, '% FF123: Teff out of range: ' + string(t,format='(F8.2)') + ' K'
print, '% FF123: must be in the range 5000 .. 6500 K'
ff2_out = [-99.9,-99.9]
return
return, ff2_out
endif
if (glog lt 3.4 or glog gt 4.6) then begin
print, '% FF123: log g out of range: ' + string(glog,format='(F5.2)')
print, '% FF123: must be in the range 3.5 .. 4.5'
ff2_out = [-99.9,-99.9]
return
return, ff2_out
endif
if (z lt -3.2 or z gt 0.2) then begin
print, '% FF123: [Fe/H] out of range: ' + string(z,format='(F5.2)')
print, '% FF123: must be in the range -3.0 .. 0.0'
ff2_out = [-99.9,-99.9]
return
return, ff2_out
endif
if (ALi lt 0.9 or ALi gt 3.1) then begin
print, '% FF123: A(Li) out of range: ' + string(Ali,format='(F5.2)')
print, '% FF123: must be in the range 1.0 .. 3.0'
ff2_out = [-99.9,-99.9]
return
return, ff2_out
endif
if (qiso lt 0.0 or qiso gt 0.1) then begin
print, '% FF123: 6Li/7Li out of range: ' + string(qiso,format='(F5.2)')
print, '% FF123: must be in the range 0.0 .. 0.082'
ff2_out = [-99.9,-99.9]
return
return, ff2_out
endif
;normalization of the T and log g
......@@ -147,5 +147,6 @@ c = ALi + d2
ff2_3dz = mcubic(ff2_3d,z_grid,z) - d2
;
ff2_out = [ff2_1dz,ff2_3dz]
return, ff2_out
;
end
pro ff3, t, glog, z, EW, qiso, ff3_out
function ff3, t, glog, z, EW, qiso, ff3_out
;
; Coefficients based on original 1D NLTE equivalent widths by A. Mott
; Cijk mm00 mm05 mm10 mm20 mm30
......@@ -106,25 +106,25 @@ if (t lt 4900.0 or t gt 6600.0) then begin
print, '% FF123: Teff out of range: ' + string(t,format='(F8.2)') + ' K'
print, '% FF123: must be in the range 5000 .. 6500 K'
ff3_out = [-99.9,-99.9]
return
return, ff3_out
endif
if (glog lt 3.4 or glog gt 4.6) then begin
print, '% FF123: log g out of range: ' + string(glog,format='(F5.2)')
print, '% FF123: must be in the range 3.5 .. 4.5'
ff3_out = [-99.9,-99.9]
return
return, ff3_out
endif
if (z lt -3.2 or z gt 0.2) then begin
print, '% FF123: [Fe/H] out of range: ' + string(z,format='(F5.2)')
print, '% FF123: must be in the range -3.0 .. 0.0'
ff3_out = [-99.9,-99.9]
return
return, ff3_out
endif
if (qiso lt 0.0 or qiso gt 0.1) then begin
print, '% FF123: 6Li/7Li out of range: ' + string(qiso,format='(F5.2)')
print, '% FF123: must be in the range 0.0 .. 0.082'
ff3_out = [-99.9,-99.9]
return
return, ff3_out
endif
;normalization of the T and log g
......@@ -185,5 +185,6 @@ c = EW + d3
if (ff3_3dz lt 0.9 or ff3_3dz gt 3.1) then ff3_3dz = -99.9
;
ff3_out = [ff3_1dz,ff3_3dz]
return, ff3_out
;
end
......@@ -38,16 +38,16 @@ for iz=0,nz-1 do begin
printf, unit, ll
for ia=0,na-1 do begin
ainp=a_tab[ia]
ff1, tinp, ginp, zinp, ainp, qiso, ff1_out
ff1_out=ff1(tinp, ginp, zinp, ainp, qiso)
aa1=ainp+ff1_out[0]
ff2, tinp, ginp, zinp, aa1, qiso, ff2_out
ff2_out=ff2(tinp, ginp, zinp, aa1, qiso)
ew1=ff2_out[0]
ff3, tinp, ginp, zinp, ew1, qiso, ff3_out
ff3_out=ff3(tinp, ginp, zinp, ew1, qiso)
aa1_inv=ff3_out[0]
aa3=ainp+ff1_out[1]
ff2, tinp, ginp, zinp, aa3, qiso, ff2_out
ff2_out=ff2(tinp, ginp, zinp, aa3, qiso)
ew3=ff2_out[1]
ff3, tinp, ginp, zinp, ew3, qiso, ff3_out
ff3_out=ff3(tinp, ginp, zinp, ew3, qiso)
aa3_inv=ff3_out[1]
printf, unit, ainp, ff1_out[0], aa1, ew1, aa1_inv, $
ff1_out[1], aa3, ew3, aa3_inv, format='(9F8.4)'
......@@ -78,16 +78,16 @@ for ix=0,ntst-1 do begin
printf, unit, ll
for ia=0,na-1 do begin
ainp=a_tst[ia]
ff1, tinp, ginp, zinp, ainp, qiso, ff1_out
ff1_out=ff1(tinp, ginp, zinp, ainp, qiso)
aa1=ainp+ff1_out[0]
ff2, tinp, ginp, zinp, aa1, qiso, ff2_out
ff2_out=ff2(tinp, ginp, zinp, aa1, qiso)
ew1=ff2_out[0]
ff3, tinp, ginp, zinp, ew1, qiso, ff3_out
ff3_out=ff3(tinp, ginp, zinp, ew1, qiso)
aa1_inv=ff3_out[0]
aa3=ainp+ff1_out[1]
ff2, tinp, ginp, zinp, aa3, qiso, ff2_out
ff2_out=ff2(tinp, ginp, zinp, aa3, qiso)
ew3=ff2_out[1]
ff3, tinp, ginp, zinp, ew3, qiso, ff3_out
ff3_out=ff3(tinp, ginp, zinp, ew3, qiso)
aa3_inv=ff3_out[1]
printf, unit, ainp, ff1_out[0], aa1, ew1, aa1_inv, $
ff1_out[1], aa3, ew3, aa3_inv, format='(9F8.4)'
......
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