c**ft3d_tocfhsqc_lp ; ; $Id: ft3d_tocfhsqc_lp.mac,v 1.1 2000/02/04 23:00:53 abild Exp abild $ ; ; Felix processing macro for data acquired with n15tocfhsqc.fa, including lp ; ty ft3d_tocfhsqc_lp ;define the processing parameters appropriate for your data ; ; File names ; def dat_fl asp50ala_3dtoc.dat ;name of the data file (.dat) def mat_fl asp50ala_3dtoclp.mat ;name of the matrix file (.mat). Will be created if not already there. ; ; Number of points ; def ctd_d1 1024 ;complex points in D1 FID: Bruker TD/2 def ctd_d2 34 ;complex points in D2 FID: Usually L4 def ctd_d3 100 ;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 256 ;complex points in D3 FID after zero-filling, usually 2*ctd_d3 eva svszd1 (&csz_d1/4) ;complex points to save after FT of D1 (use to this with ; svofd1 to chop out a subsection of D1) def svofd1 400 ;number of points to discard at the left after FT in D1 ; def cnst10 1 ;value of cnst10 (number of missing first points in D3 ; def dcim 16 ;decimation rate, use "uxgrep decim" to extract from Bruker acqus file def dfvs 12 ;dsp firmware number, use "uxgrep dspfvs" to extract from Bruker acqus file ; ; Linear prediction parameters: ; ; D2, normal LP using lpx for prediction eva flptd2 (1) ; first point to use to calc. LP coefficients eva llptd2 (&ctd_d2) ; last point to use to calc. LP coefficients eva fnewd2 (&ctd_d2+1) ; first new predicted point eva lnewd2 (&ctd_d2*1.5) ; last new predicted point eva ncofd2 (&ctd_d2*0.3) ; no. of coefficients - 1/4-1/3 times no. of points def mthod2 2 ; LP method: 0: forward; 1: backw.; 2: f-b; 3: mirror-image def mimgd2 1 ; mirror-image mode: 0: dw/2 initial delay; 1: no init. del. ; ; D3, normal LP using lpx for prediction eva flptd3 (&cnst10+1) ; first point to use to calc. LP coefficients eva llptd3 (&ctd_d3+&cnst10) ; last point to use to calc. LP coefficients eva fnewd3 (&ctd_d3+1+&cnst10) ; first new predicted point eva lnewd3 (&ctd_d3*1.5+&cnst10); last new predicted point eva ncofd3 (&ctd_d3*0.3) ; no. of coefficients - 1/4-1/3 times no. of points def mthod3 2 ; LP method: 0: forward; 1: backw.; 2: f-b; 3: mirror-image def mimgd3 1 ; mirror-image mode: 0: dw/2 initial delay; 1: no init. del. ; ; Let's figure out the length of the FIDs after correction for digital filters etc ; (you shouldn't have to change this): ; exr digphs &dcim &dfvs eva fidlen (&ctd_d1-&digdel) eva lpszd3 (&ctd_d3+&cnst10) ;complex points in D3 FID after correction for missing first point(s) ; ; ; 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 ss ;name of the window type for D2 def wp1_d2 &lnewd2 ;first parameter def wp2_d2 90 ;second parameter (blank if n/a) ; def wdw_d3 ss ;name of the window type for D3 def wp1_d3 &lnewd3 ;first parameter def wp2_d3 90 ;second parameter (blank if n/a) ; ; Phase parameters ; def ph0_d1 -174.85 ;zero order phase angle for D1 def ph1_d1 -6.601 ;first order phase angle for D1 ; def ph0_d2 90 ;zero order phase angle for D2 def ph1_d2 -180 ;first order phase angle for D2 ; def ph0_d3 135.0 ;zero order phase angle for D3 def ph1_d3 -180.0 ;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 1 ;phase D1 def phs_d2 1 ;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 0 ;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) ; ; Set the sweep width in D1, D2 and D3 ; def sw_d1 12019.231 ;Sweep width in Hz in D1 (Bruker sw_h: uxgrep sw_h) def sw_d2 1923.077 ;Sweep width in Hz in D2 (1/(2*in0)) def sw_d3 6024.096 ;Sweep width in Hz in D3 (1/(2*in10)) ; ; More referencing information. Here we use the carrier position as ; the reference point: ; eva refpt1 (&csz_d1/2+1-&svofd1) ; Reference point D1 eva refpt2 (&csz_d2/2+1) ; Reference point D2 eva refpt3 (&csz_d3/2+1) ; Reference point D3 def refsh1 4.631 ; Reference shift D1 def refsh2 118.950 ; Reference shift D2 def refsh3 4.631 ; Reference shift D3 def sfreq1 600.13 ; Spectrometer frequency D1 def sfreq2 60.811 ; Spectrometer frequency D2 def sfreq3 600.13 ; Spectrometer frequency D3 eva redsw1 (&sw_d1*&svszd1/&csz_d1) ; Reduced sweep width in D1 ; ; Set "chifit" to 1 if you want help on input parameters for CHIFIT. ; This will bypass all processing etc. ; def chifit 0 ; ; 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 if &chifit eq 1 then cal chifit_out go quit eif cal bldmat cal refmat if &prc_d1 eq 1 then cal proc_d1 eif if &prc_d2 eq 1 then cal preprc_d2 eif if &prc_d3 eq 1 then cal proc_d3 eif if &prc_d2 eq 1 then cal postprc_d2 eif go quit ; Subroutines here ;proc_d1 proc_d1: cl def datype 1 def datsiz &fidlen set 1 def swidth &sw_d1 &wdw_d1 &wp1_d1 &wp2_d1 stb 1 def gibbs &gib_d1 ty Working on D1... for plane 1 &rtd_d3 for row 1 &rtd_d2 esc out if &out ne 0 quit cal ftvec_d1 red sto 0 &row &plane next ty done D1 &plane / &rtd_d3 $ next ty done D1 &plane / &rtd_d3 ret ; proc_d2 proc_d2: def datype 1 def datsiz &ctd_d2 set 1 def swidth &sw_d2 &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 ret ; proc_d3 proc_d3: def datype 1 def datsiz &lnewd3 set 1 def swidth &sw_d3 &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 def datsiz &lpszd3 if &lpszd3 gt &ctd_d3 then if &cnst10 eq 1 then shr 1 lpf els ty This macro cannot handle cases with cnst10 > 1 ty Please contact your Felix wizard. ty Sorry. Exiting... go quit eif eif ; linear predict D3 lpx &flptd3 &llptd3 &fnewd3 &lnewd3 &ncofd3 &mthod3 1 &mimgd3 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 ge &nexvec then ty done D3 &vec / &vector $ eva nexvec (&nexvec+64) eif next ty done D3 &vec / &vector bun 0 ret ; ftvec_d1 ftvec_d1: rn &dat_fl def datype 1 exr digphs &dcim &dfvs 1 def datsiz &fidlen if &rev_d1 eq 1 then cnj eif mwb 1 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 ret ; preprc_d2, preliminary processing of D2 preprc_d2: cal preprcwd2 stb 1 def gibbs 0 ty Working on first round 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 ret ; preprcwd2 preprcwd2: def datype 1 eva datsiz (&ctd_d2*1.03) set 1 sb &datsiz 90 def datsiz &ctd_d2 ret ; postprc_d2, final processing of D2 postprc_d2: cal preprcwd2 inv zf &csz_d2 stb 1 bun 2 def nexvec 64 ty Working on second round D2... for vec 1 &vector esc out if &out ne 0 quit def gibbs 0 lwb hft ift mwb 1 ; linear predict D2 lpx &flptd2 &llptd2 &fnewd2 &lnewd2 &ncofd2 &mthod2 1 &mimgd2 def swidth &sw_d2 &wdw_d2 &wp1_d2 &wp2_d2 def gibbs &gib_d2 zf &csz_d2 ft red swb if &vec ge &nexvec then ty done D2 &vec / &vector $ eva nexvec (&nexvec+64) eif next ty done D2 &vec / &vector bun 0 ret ;bldmat bldmat: cmx inq mat &mat_fl exist if &exist eq 1 then mat &mat_fl w if &dimen ne 3 then ty The matrix &mat_fl exists but has the wrong dimensionality go quit eif if &d1size ne &msz_d1 or &d2size ne &msz_d2 or &d3size ne &msz_d3 then ty The matrix &mat_fl exists but has the wrong size go quit eif els ty Building the matrix (&mat_fl)... bld &mat_fl 3 &msz_d1 &msz_d2 &msz_d3 mat &mat_fl w eif ret ; refmat refmat: rmx 1 &sfreq1 &redsw1 3 &refpt1 &refsh1 H rmx 2 &sfreq2 &sw_d2 3 &refpt2 &refsh2 N rmx 3 &sfreq3 &sw_d3 3 &refpt3 &refsh3 H ret ; chifit_out chifit_out: eva cpd1 (&fidlen*&svszd1/&csz_d1) ty Chifit input parameters: ty dimensions = 3 ty data_points = (&svszd1, &csz_d2, &csz_d3) ty complex_points = (&cpd1, &lnewd2, &lnewd3) if &wdw_d1 eqs ss then ty WF_DIM1 = SineSqrBell, &wp2_d1 eif if &wdw_d1 eqs sb then ty WF_DIM1 = SineBell, &wp2_d1 eif if &wdw_d1 eqs gm then ty WF_DIM1 = LorentzGauss, &wp1_d1, &redsw1, &wp2_d1 eif if &wdw_d2 eqs ss then ty WF_DIM2 = SineSqrBell, &wp2_d2 eif if &wdw_d2 eqs sb then ty WF_DIM2 = SineBell, &wp2_d2 eif if &wdw_d2 eqs gm then ty WF_DIM2 = LorentzGauss, &wp1_d2, &sw_d2, &wp2_d2 eif if &wdw_d3 eqs ss then ty WF_DIM3 = SineSqrBell, &wp2_d3 eif if &wdw_d3 eqs sb then ty WF_DIM3 = SineBell, &wp2_d3 eif if &wdw_d3 eqs gm then ty WF_DIM3 = LorentzGauss, &wp1_d3, &sw_d3, &wp2_d3 eif ret quit: ret end