-- Dinit.lua semi-automatic deconvolution of a kinetic experiment -- DEFINITIONS HOME = HOME or "/Users/GB/" -- define here your home directory -- never forget the initial slash ! filename = "dec_table.txt" --here we save the table of integrals NumSpectra = 32 -- number of points for the kinetic study NumRegions = 5 -- regions to deconvolute P = 1 -- first spectrum to process R = 1 -- first region to process -- you can start from higher values, if you wish F = {} -- central frequencies par = {} -- parameter for the deconvolution -- they must be obtained from a preliminary deconvolution performed on the first spectrum dx = 0.05 -- (constant) region to zoom in, in ppm units, based upon experience and observation local i = 1 -- progressive index, simplifies the editing of this script -- for example, you can reorder the definitions below and they will still work -- proton 4 F[i] = 3.711 par[i] = [[ Parameters for 1 peaks frequency (Hz) intensity width (Hz) Lorentzian % 1855.4433 150.0000 1.9975 100.0000 ]] i = i + 1 -- proton 5 F[i] = 3.927 par[i] = [[ Parameters for 2 peaks frequency (Hz) intensity width (Hz) Lorentzian % 1963.1406 0.5000 4.7583 100.0000 1955.7102 0.5000 4.8810 100.0000 ]] i = i + 1 -- proton 6 F[i] = 5.667 par[i] = [[ Parameters for 1 peaks frequency (Hz) intensity width (Hz) Lorentzian % 2828.0753 2.0000 2.5857 100.0000 ]] i = i + 1 -- proton 7 F[i] = 5.00 par[i] = [[ Parameters for 2 peaks frequency (Hz) intensity width (Hz) Lorentzian % 2512.4897 1.0000 4.0698 100.0000 2505.4187 1.0000 3.7240 100.0000 ]] i = i + 1 -- proton 8 F[i] = 3.76 par[i] = [[ Parameters for 1 peaks frequency (Hz) intensity width (Hz) Lorentzian % 1874.5991 8.000 3.6089 100.0000 ]] i = i + 1 -- end of definitions ---------------------------------------- -- ************-> HERE WE GO: <-*************** io.output(HOME..filename) -- create/open the file were the results will be stored io.write("point") -- header for i = 1,NumRegions do io.write("\tppm\t\tarea") end io.write("\n") spectral = getf("x") -- read some experimental parameters conversion = 1.0 / spectral.MHz -- useful to convert from Hz to ppm spectral = getf("y") step = spectral.width / spectral.size Y = spectral.start + step * (spectral.size -0.1 -P+1) -- position of the first row on its dummy ppm scale io.write( string.format("\n\t%02d\t", P ) ) -- report the experiment no. mark('h', Y ) -- choose a row extract() -- extract the coresponding 1D spectrum delint() -- we need to normalize the intensities region( 2.4, 2.6 ) -- region containing protons no. 1 and 9 press 'i' -- first integral, automatically set to 1 intreg( 1, 300 ) -- we set it to 300 to have manageable numbers (>1 and <300) region( F[R] + dx, F[R] - dx ) press "z" adj() print("select the signal, then run D_STEP") selection = true