FTIR1.txt
# b--Number of Background Scans per Block
# d--Starting Wavenumber
# e--Ending Wavenumber
# f--Filename of Spectrum
# k--Number of Blocks
# p--Parameter File Number
# s--Number of Sample Scans per Block
# t--Title of Spectrum
# z--File Exist?
label begin
clrscr
comment Enter a Filename
enter f
exist &f.ras
if &z = 1
goto begin
exist &f.bkg
if &z = 1
goto begin
exist &f.sbm
if &z = 1
goto begin
comment
comment Enter the Spectrum Title
enter t
comment
comment Enter a Parameter File Number
enter p
comment
comment Enter the Number of Blocks
enter k
comment
comment Enter the Number of Background Scans per Block
enter b
comment
comment Enter the Number of Sample Scans per Block
enter s
comment
comment Enter Starting Wavenumber
enter d
comment
comment Enter Ending Wavenumber
enter e
clrscr
comment Filename: &f
comment
comment Title: &t
comment
comment Parameter File: pm&p.dat
comment
comment Number of Blocks
comment &k
comment
comment Number of Background Scans per Block
comment &b
comment
comment Number of Sample Scans per Block
comment &s
comment
comment Total Number of Background Scans
* &b &k
comment
comment Total Number of Sample Scans
* &s &k
comment
comment Region
comment &d to &e
comment
ask Are These Conditions Correct (y or n)?
goto begin
system putextio switch=1 value=0 port=2
mattscan parms=pm&p.dat action=iq
mattscan parms=pm&p.dat bkgscans=&b quiet=1 irdatatype=big action=sq
mattproc parms=pm&p.dat s=tmp.big o=tmp.bkg
load tmp.bkg
truncate &d &e
copy tmp.bkg &f.bkg
system putextio switch=1 value=1 port=2
mattscan parms=pm&p.dat sampscans=&s quiet=1 irdatatype=igm action=sq
mattproc parms=pm&p.dat s=tmp.igm o=tmp.sbm
load tmp.sbm
truncate &d &e
copy tmp.sbm &f.sbm
comment 1
let a 1.0
label top
test &a < &k
goto done
system putextio switch=1 value=0 port=2
mattscan parms=pm&p.dat bkgscans=&b quiet=1 irdatatype=big action=sq
mattproc parms=pm&p.dat s=tmp.big o=tmp.bkg
load tmp.bkg
truncate &d &e
add &f.bkg
save &f.bkg
system putextio switch=1 value=1 port=2
mattscan parms=pm&p.dat sampscans=&s quiet=1 irdatatype=igm action=sq
mattproc parms=pm&p.dat s=tmp.igm o=tmp.sbm
load tmp.sbm
truncate &d &e
add &f.sbm
save &f.sbm
increment a
comment &a
goto top
label done
load &f.sbm
ratio &f.bkg
save &f.ras
erase &f.sbm
erase &f.bkg
comment done