#!/bin/tcsh

#This is the script which starts processing of the SCoT data
#IMPORTANT: qMDD software is required for signal reconstruction and can be downloaded for free from http://mddnmr.spektrino.com/
#The other attached files are needed to run processing and should be placed in the same directory as SCoT.sh: "proc.sh", "fidSP.com", "recFT.com", "nls.in", and "nls.hdr_3"

@ fpoint_last_frame = 1574     #First point of the last frame (eg. For 1638 acquired points and frame size of 64 points, the first point of the last frame is 1574)
@ i = 0 
@ a = 0
setenv NUS_POINTS      64	#Number of NUS points used for reconstruction of a single spectrum (frame size)


while($a<10)
setenv NUS_TABLE_OFFSET $i
setenv proc_out test000$a.dat
./proc.sh
@ i++					#Number of '@ i++' rows indicates the frames overlap
@ i++
@ a++
end

while($a<100)
setenv NUS_TABLE_OFFSET $i
setenv proc_out test00$a.dat
./proc.sh
@ i++
@ i++
@ a++
end

while($i<$fpoint_last_frame)
setenv NUS_TABLE_OFFSET $i
setenv proc_out test0$a.dat
./proc.sh
@ i++
@ i++
@ a++
end

