c**ft3d_hncose ty ft3d_hncose ;define the processing parameters appropriate for your data def dat_fl hncose ;name of the data file (.dat) def mat_fl hncose ;name of the matrix file (.mat). Will be created if not already there. ; def ctd_d1 1024 ;complex points in D1 FID: Bruker TD/2 def ctd_d2 64 ;complex points in D2 FID: Usually L4 def ctd_d3 48 ;complex points in D3 FID: Usually L6 ; def csz_d1 2048 ;complex points in D1 FID after zero-filling, usually 2*ctd_d1 def csz_d2 128 ;complex points in D2 FID after zero-filling, usually 2*ctd_d2 def csz_d3 128 ;complex points in D3 FID after zero-filling, usually 2*ctd_d3 eva svszd1 (&csz_d1/2) ;complex points to save after FT of D1 (use to this with ; svofd1 to chop out a subsection of D1) def svofd1 0 ;number of points to discard at the left after FT in D1 ; def dcim 16 ;decimation rate, use "uxgrep decim" to extract from Bruker acqus file def dfvs 10 ;dsp firmware number, use "uxgrep dspfvs" to extract from Bruker acqus file ; ; Let's figure out the length of the FID after correction for digital filters: ; exr digphs &dcim &dfvs eva fidlen (&ctd_d1-&digdel) ; ; Set the window functions and corresponding parameters ; def wdw_d1 ss ;name of the window type for D1 def wp1_d1 &fidlen ;first parameter def wp2_d1 90 ;second parameter (blank if n/a) ; def wdw_d2 sb ;name of the window type for D2 def wp1_d2 &ctd_d2 ;first parameter def wp2_d2 90 ;second parameter (blank if n/a) ; def wdw_d3 sb ;name of the window type for D3 def wp1_d3 &ctd_d3 ;first parameter def wp2_d3 90 ;second parameter (blank if n/a) ; ; Set the sweep width in D1, D2 and D3 ; def sw_d1 10000.000 ;Sweep width in Hz in D1 (Bruker sw_h: uxgrep sw_h) def sw_d2 2000.000 ;Sweep width in Hz in D2 def sw_d3 1785.714 ;Sweep width in Hz in D3 ; ; Phase parameters ; def ph0_d1 0 ;zero order phase angle for D1 def ph1_d1 0 ;first order phase angle for D1 ; def ph0_d2 0 ;zero order phase angle for D2 def ph1_d2 0 ;first order phase angle for D2 ; def ph0_d3 90 ;zero order phase angle for D3 def ph1_d3 -180 ;first order phase angle for d3 ; ; Which dimensions to process (1=processing will be done, 0=no processing) ; def prc_d1 1 ;process D1 (data must already be loaded into the matrix file) def prc_d2 1 ;process D2 def prc_d3 1 ;process D3 ; ; Which dimensions to phase correct after FT (0=no phasing, 1=phasing will be performed) ; def phs_d1 0 ;phase D1 def phs_d2 0 ;phase D2 def phs_d3 1 ;phase D3 ; ; If a particular dimension has a reversed ch. sh. axis, set rev_d? to 1 ; def rev_d1 0 ;reverse d1 if 1 def rev_d2 0 ;reverse d2 if 1 def rev_d3 0 ;reverse d3 if 1 ; ; Which dimensions to do the Gibbs trick on ; def gib_d1 0 ;Gibbs filter D1, 0=off, 1=on (divide 1st pt. by 2) def gib_d2 1 ;Gibbs filter D2, 0=off, 1=on (divide 1st pt. by 2) def gib_d3 0 ;Gibbs filter D3, 0=off, 1=on (divide 1st pt. by 2) ; ; That's all ; eva rtd_d1 (&ctd_d1*2) eva rtd_d2 (&ctd_d2*2) eva rtd_d3 (&ctd_d3*2) eva rsz_d1 (&csz_d1*2) eva rsz_d2 (&csz_d2*2) eva rsz_d3 (&csz_d3*2) def msz_d1 &svszd1 def msz_d2 &csz_d2 def msz_d3 &csz_d3 cmx inq mat &mat_fl exist if &exist eq 1 then mat &mat_fl w els ty Building the matrix (&mat_fl)... bld &mat_fl 3 &msz_d1 &msz_d2 &msz_d3 mat &mat_fl w eif if &prc_d1 eq 0 proc_d2 cl def gibbs &gib_d1 ty Working on D1... for plane 1 &rtd_d3 def rownr 1 for row 1 &ctd_d2 esc out if &out ne 0 quit rn &dat_fl def datype 1 exr digphs &dcim &dfvs 1 def datsiz &fidlen if &rev_d1 eq 1 then cnj eif def swidth &sw_d1 &wdw_d1 &wp1_d1 &wp2_d1 zf &csz_d1 ft if &phs_d1 eq 1 then def phase0 &ph0_d1 def phase1 &ph1_d1 ph eif if &svofd1 gt 0 then shl &svofd1 eif def datsiz &svszd1 stb 1 stb 2 rn &dat_fl def datype 1 exr digphs &dcim &dfvs 1 def datsiz &fidlen if &rev_d1 eq 1 then cnj eif def swidth &sw_d1 &wdw_d1 &wp1_d1 &wp2_d1 zf &csz_d1 ft if &phs_d1 eq 1 then def phase0 &ph0_d1 def phase1 &ph1_d1 ph eif if &svofd1 gt 0 then shl &svofd1 eif def datsiz &svszd1 adb 1 mul -1 adb 2 ldb 2 exc red sto 0 &rownr &plane eva rownr (&rownr+1) def datype 1 def datsiz &svszd1 ldb 1 red sto 0 &rownr &plane eva rownr (&rownr+1) next ty done D1 &plane / &rtd_d3 $ next ty done D1 &plane / &rtd_d3 proc_d2: if &prc_d2 eq 0 proc_d3 def datype 1 def datsiz &ctd_d2 set 1 &wdw_d2 &wp1_d2 &wp2_d2 stb 1 def gibbs &gib_d2 ty Working on D2... for plane 1 &rtd_d3 for col 1 &msz_d1 esc out if &out ne 0 quit loa &col 0 &plane def datype 1 def datsiz &ctd_d2 if &rev_d2 eq 1 then cnj eif mwb 1 zf &csz_d2 ft if &phs_d2 eq 1 then def phase0 &ph0_d2 def phase1 &ph1_d2 ph eif red sto &col 0 &plane next ty done D2 &plane / &rtd_d3 $ next ty done D2 &plane / &rtd_d3 proc_d3: if &prc_d3 eq 0 quit def datype 1 def datsiz &ctd_d3 set 1 &wdw_d3 &wp1_d3 &wp2_d3 stb 1 def gibbs &gib_d3 bun 3 def nexvec 64 ty Working on D3... for vec 1 &vector esc out if &out ne 0 quit lwb def datype 1 def datsiz &ctd_d3 if &rev_d3 eq 1 then cnj eif mwb 1 zf &csz_d3 ft if &phs_d3 eq 1 then def phase0 &ph0_d3 def phase1 &ph1_d3 ph eif red swb if &vec lt &nexvec gonxtd3 ty done D3 &vec / &vector $ eva nexvec (&nexvec+64) gonxtd3: next ty done D3 &vec / &vector bun 0 quit: end