-- projxyplus.lua -- creates 2 projections from a 2D hetero-nuclear spectrum and shows them -- after chnaging the sign of negative peaks function make_positive() region( -9999, 9999 ) -- select all local S = copy() -- the data points local n = S.x for i = 1, n do if (S[i] < 0) then -- all the negative points S[i] = - S[i] -- become positive end end paste( S ) -- the positive points are pasted into the spectrum end -- The Main Program Starts Here path = pathtofile() -- path of the 2D spectrum vp = path.."v" -- where we'll store the vertical projection os.execute("rm -rf \""..vp.."\"") -- delets the old projections, if they already exist mark "h" -- deletes the horizontal marks mark( 0 ) -- vertical mark extract( 1 ) -- Collapse make_positive() export( vp ) -- we store the projection closex() -- and close the extract -- if you delete the following optional block, the script becomes valid for the homonuclear case hp = path.."h" -- where we'll store the horizonal projection os.execute("rm -rf \""..hp.."\"") mark( "h", 0 ) -- horizontal mark extract( 1 ) -- another Collapse make_positive() export( hp ) -- we store this projection too closex() -- and close the extract open( hp ) -- end of the optional block open( vp ) -- reopen the files containing the projections repeat next_window() until path == pathtofile() -- returns to the 2D spectrum ovly( "ALLW" ) -- the other spectra as overlays ovly( "FitI" )