# Contributions to Code Made By: # W. Trent Franks (WTF) # Chad M. Rienstra (CMR) # Benjamin J. Wylie (BJW) # Ying Li (YL) # Andrew J. Nieuwkoop (AJN) # Lindsay J. Sperling (LJS) # Gemma C Commellas (GCC) # Heather L. Frericks-Schmidt (HLF) # Charles E. Bronniman (CEB) # cp3resR_pm.acq ########################################################### # $Revision: 1.1 $ $Date: 2000/06/27 19:29:30 $ # $Source: /usr2/users/applab/CFR/I+/ppg/cp3resR_pm.acq,v $ # InfinityPlus Compatible # # This section sets the initial cmx global parameters # # The file format is as follows # # si_name;long name;value;units;min;max;decimal pnts;user level;data type # # a - is a blank field. # tabs and spaces are allowed if you wish to seperate the fields a little # but a line can be only 80 characters. # # first line = ppfn and na # # na;# acq's;1;-;1;100000000;0;5;long # # Channel assignments # ch1;ppg ch1 (X,obs);1;-;1;4;0;5;long sf1;ch1 check FLAGS;125.700;MHz;1.0;800.5;7;5;float ch2;ppg ch2 (H);2;-;1;4;0;5;long sf2;ch2 spect freq;499.864;MHz;1.0;800.5;7;5;float ch3;ppg ch3 (Y);3;-;1;4;0;5;long sf3;ch3 spect freq;50.565;MHz;1.0;800.5;7;5;float # steady state condition dp;dummy pulses;1;-;0;1000;0;5;long pd;pulse delay;1;s;0.1;6500;3;5;float # pw90H;H90 pulse ;4;u;.1;1000;2;1;float aH;H rf ampl;0.0;-;0.0;1.0;4;1;float aXcp;X CP amp;0.0;-;0.0;1.0;4;2;float aHcp;H CP amp;0.0;-;0.0;1.0;4;1;float deltaHX_X;size of H tan ramp;0.08;-;0.0;0.4;4;1;float deltaHX_H;size of X tan ramp;0.08;-;0.0;0.4;4;1;float betaHX_X;shape of H tan ramp ;0.02;-;-2;2;4;1;float betaHX_H;shape of X tan ramp ;0.02;-;-2;2;4;1;float ct;contact time;1;m;.0001;100;3;4;float # decoupling during acquisition period aHdec_COSY;H dec (SPINAL);0.0;-;0.0;1.0;4;2;float pw_COSY;SPINAL dcpl;7;u;0.1;1000;2;2;float #p2_COSY;TPPM phase;15;-;0;360;1;2;float #pw;SPINAL dcpl pulse;7;u;0.1;1000;2;3;float SPINAL_t1_phi;SPINAL phi phase;15.0;-;0.0;360.0;2;3;float SPINAL_t1_alp;SPINAL alpha phase;0.0;-;0.0;360.0;2;3;float SPINAL_t1_bet;SPINAL beta phase;0.0;-;0.0;360.0;2;3;float SPINAL_t1_flag;super cycle;4;-; 1; 4; 0; 3;long #aH_SPINAL_t1;H t1 ampl;0.0;-;0.0;1.0;4;3;float #p2;TPPM phase;15;-;0;360;1;2;float #pw;TPPM dcpl pulse;7;u;0.1;1000;2;2;float aHdec;H dec (TPPM);0.0;-;0.0;1.0;4;2;float pw_SPINAL_t2;SPINAL dcpl pulse;7;u;0.1;1000;2;3;float SPINAL_t2_phi;SPINAL phi phase;15.0;-;0.0;360.0;2;3;float SPINAL_t2_alp;SPINAL alpha phase;0.0;-;0.0;360.0;2;3;float SPINAL_t2_bet;SPINAL beta phase;0.0;-;0.0;360.0;2;3;float SPINAL_t2_flag;super cycle;4;-; 1; 4; 0; 3;long #aH_SPINAL_t2;H t2 ampl;0.0;-;0.0;1.0;4;3;float # Selective echo soft_pulse_flag;0=bb 1=ali;0;-;0;1;0;3;long ipap_flag;0=IP 1=AP sf1 on CO;0;-;0;1;0;3;long scX_rSNOB;X scalar soft;0.1;-;0.0;1.0;3;1;float scX_rSNOB2;X scalar soft;0.1;-;0.0;1.0;3;1;float pw_rSNOB;soft 180 pulse;360;u;20;10000;2;1;float pw_rSNOB2;soft 180 pulse;360;u;200;10000;2;1;float aX_rSNOB;X 180 soft;0.1;-;0.0;1.0;4;1;float aX_rSNOB2;X 180 soft.;0.1;-;0.0;1.0;4;1;float freqhop_F3;softpulse offset;0;Hz;-100000.0;100000.0;3;0;float # SPC5 parameters #q;No. cycles in t_exc;7;-;0;250;0;3;long tau_r;rotor period;100;u;10;5000;2;2;float #t_mix;2Q mix + 0.1u;500;u;0;25000;2;3;float #bigN_SPC5;2Q rotor periods;2;-;1;5;0;1;long #pw360Xdq;X 360 (aXdq);16;u;.1;4000;2;2;float #aXdq;X dq ampl;0.0;-;0.0;1.0;4;3;float #RAD/DARR parameters tau_rad;rad mix time;0.075;m;0.001;100;3;5;float aHrad;dec. dur. RAD;0.15;-;0.0;0.50;4;2;float #aHdq;H dec. (DQ);0.0;-;0.0;1.0;4;1;float aHzfil;dec. dur. z filter;0.25;-;0.0;1.0;4;1;float pw90X;X 90 (aX90);3;u;.1;1000;2;2;float pw180X;X 90 (aX90);3;u;.1;1000;2;2;float pw90Y;Y 90 (aX90);3;u;.1;1000;2;2;float aX90;X 90 ampl;0.72;-;0.0;1.0;4;2;float aY90;Y 90 ampl;0.72;-;0.0;1.0;4;2;float # Acquisition Parameters # 2D params tau1;scalar mix;0.075;m;0.001;100;3;5;float AL2;dim2 (t2) acq length;1;-;1;4096;0;5;long dw2;dim2 (t2) dwell;20;u;.2;10000;3;5;float AL2max;max dim2 (t2) acq;1;-;1;4096;0;4;long #t1_evol_max;t2 evolution;.2;u;.2;100000;3;5;float AL2start;start dim2 (t2) acq;1;-;1;4096;0;4;long al2;total no. rows d2;1;-;0;4096;0;5;long time2d;total 2D time (hrs);1;-;0.0;999;4;5;float # during t2 (Y dec. during X acq.) pwtppm2;Y tppm pulse;20;u;.1;100;2;0;float pwgap2;Y tppm gap;250;u;.1;10000;2;0;float p_tppm2;TPPM phase;15;-;0;360;1;2;float aYdec;Y tppm ampl.;0.0;-;0.0;1.0;4;0;float # Receiver dw;dwell;50;u;.2;1000;3;5;float rd;receiver delay;10;u;3;100;2;5;float ad;acq delay;35;u;1;1000;3;5;float sw;spectrum width;20;kHz;1;5001;3;5;float al;acq length;1024;-;1;65536;0;5;long rb;receiver bandwidth;500;khz;1;2000;1;3;float aqtm;acq time;12.801;m;.001;1000;3;5;float rg;receiver gain;100;-;1;1000;2;3;float txduty1;trans duty;0.01;-;0.0;0.2;3;5;float temp;Set Temp. (C);0;-;-1000;250;2;5;float;acc_array #time1d;1D time (min);1;-;0.000005;999999999;3;0;float speed;spin rate;-1;kHz;-1000;50;3;5;float;acc_array scH;H scalar;1.0;-;0.0;1.0;3;1;float scX;X scalar;1.0;-;0.0;1.0;3;1;float scY;Y scalar;1.0;-;0.0;1.0;3;1;float # si_name;long name;value;units;min;max;decimal pnts;user level;data type name "2D_CC_shell"; title "PDSD mixing with CP prep. and TPPM dec."; ! CMR modifications 8/19/00 ! 1. no TPPM during DQ mixing ! 2. decoupling during X 90s at aH90 level ! 3. variable angle TPPM during acquisition ! 4. generalized symmetry numbers and supercycling (?) ! 5. spinning rate is independent variable (timings dependent) (?) ! W. Trent Franks (WTF) modifications 01/11/05 ! 1. compatable with ants.csh ! 2. ramp on either or both CP channels ! 3. Modifided Phase cycle (0,180 on CP) ! 4. Constant Duty cycle ! 5. Renamed phases for easier modification (for me at least) ! COMPILED WITH OPTIMIZATION ON ! $Header: /usr2/users/applab/CFR/I+/ppg/C7.s,v 1.1 2000/04/11 21:41:48 applab Exp $ ! InfinityPlus Compatible ! ref: Y.K.Lee, N.D. Kurur, M. Helmle, O.G. Johannessen, N.C. Nielsen,M.H. Levitt, ! Chem. Phys. Lett. 242 (1995) 304-309. ! POSTC7: Hohwy et al., JCP 1998 ! CMR7: Rienstra et al., JACS 1998 ! SPC5: Hohwy et al., JCP 1999 ! LJS/GCC/WTF/CMR Modifications on 6/13/08 ! Changing code to become CTUC COSY with broadband and selective band options ! Reference: Chen, et al. JACS Comm. 2008 NMRchnls RF: ch1 ch2 ch3; NMRacq; ! ------------------------------------------ ! Define variables in .data section ! ------------------------------------------ .data !---- ACQUISITION PARAMETERS .long extern AL2max; .long extern AL2start; .time extern autofix tmix = 2000.0us; .time extern tau1 = 3m; .time extern tau2 = 3m; .long extern DQF = 0; .long extern soft_pulse_flag = 0; .time autofix time_soft = 3u; .time TIME_SOFT = 3u; .float extern freqhop_F3 = 0.0; .time autofix time_soft2 = 3u; .time TIME_SOFT2 = 3u; .long AL2_dum; .long AL2_st_dum; .long AL2_mx_dum; .long IDX2_dum; .long extern ipap_flag = 0; !---- COSY TPPM Parameters .ampl extern aHdec_COSY; .ampl autofix a_tmp_COSY = 0; .phase autofix extern p2_COSY = 15.0; .time extern autofix pw_COSY = 3u; .time PW2_COSY = 3u; .time PW_COSY = 3u; !---- Parameters for CP ramp ch++ ch1; .long list fixed aXcpLIST[512]; .ampl aXCP = 1.0; .ampl extern aX_HX = 1.0; .float extern betaHX_X; .float extern deltaHX_X; .ampl extern aX90 ; .ampl extern aX180 ; ch --; ch++ ch2; .long list fixed aHcpLIST[512]; .ampl aHCP = 1.0; .ampl extern aH_HX = 1.0; .float extern betaHX_H; .float extern deltaHX_H; ch--; ch++ ch3; .ampl extern aY90 ; .ampl extern aY180 ; ch--; .long list fixed a00[512]; .time autofix CT = .1m; .time PW2 = 12.0u; .time taurem = 1.0u; .long ntaur = 1; .long i,j,k; .phase list phi1[] = 90, 90; .phase list phi2[] = 0, 0; .phase list phi3[] = 0,180; .phase list phi4[] = 0,180, 90,270,180, 0,270, 90; .phase list phi_soft2[] = 0, 0, 0, 0; .phase list phi5[] = 90,270; .phase list phi6[] = 0, 0; .phase list phi7[] = 90, 90, 90, 90, 90, 90, 90, 90, 180,180,180,180,180,180,180,180, 270,270,270,270,270,270,270,270, 0, 0, 0, 0, 0, 0, 0, 0; .phase list phi7_ap[] = 90,135, 90,135, 90,135, 90,135, 180,225,180,225,180,225,180,225, 270,315,270,315,270,315,270,315, 0, 45, 0, 45, 0, 45, 0, 45; .phase list phi8[] = 0, 0; .phase list phi9[] = 180,270; .long list abph[] = 0, 1, 2, 3, 0, 1, 2, 3, 2, 3, 0, 1, 2, 3, 0, 1; .long list abph_ap[]= 3, 0, 1, 2, 3, 0, 1, 2, 1, 2, 3, 0, 1, 2, 3, 0; ! .long list abph_ap[]= 2, 1, 0, 3, 0, 3, 2, 1, ! 0, 3, 2, 1, 2, 1, 0, 3; ! !Phase cycle from Len Mueller's JACS Comm. ! !.phase list phi9[] = 180,180; ! !.long extern list abph[] = 0, 0, 2, 2, 0, 0, 2, 2, ! ! 2, 2, 0, 0, 2, 2, 0, 0; ! add for 2D .phase list tppi[] = 0, 90,180,270; ! for 1D ! Y decoupling .ampl autofix a_tmp3=0; .time PW180X = 20u; .time PW180Y = 20u; include "../includes/t2.inc"; include "../includes/TWO_D.inc"; include "../includes/STANDARD_PARAMS"; include "../includes/TAN_CP.inc"; include "../includes/SPC5.inc"; include "../includes/rSNOB_061308.inc"; include "../includes/SPINAL2.inc"; include "../includes/rSNOB_delay2.inc"; DEFINE SET_LIST(l1,l2) l1=l1.start; l2=l2.start; do(l2.size){@l1++=@l2++;} ENDDEF DEFINE DEC_H_COSY(aTPPM,cycles,xcyclerm) if(xcyclerm > 0){ out time(xcyclerm) ch2:TG|aTPPM|p0; } do(cycles){ out pw_COSY ch2:TG|aTPPM|p2; out pw_COSY ch2 :TG|p0; } ENDDEF DEFINE SPINAL_t1_DEC_COSY(aDEC,cycles,xcyclerm) pSPINAL_t1=pSPINAL_t1.start; if(SPINAL_t1_flag == 0){ DEC_H_COSY(aDEC,cycles,xcyclerm) } if(SPINAL_t1_flag <> 0){ out time(xcyclerm) ch2:TG | aDEC | @pSPINAL_t1++; do(cycles){ out pw_COSY ch2: @pSPINAL_t1++; } } ENDDEF !------------------------------------------- ! Update Spinsight with calculations. !------------------------------------------- .update "rb=1.30*sw"; .update "aqtm=(dw*al)"; .update "extm = pw90H+ct+2.0*ct+2.0*tmix+ad+rd+aqtm+pd"; .update "txduty1=(pw90H+2.0*ct+2.0*tmix+ad+rd+aqtm)/extm"; .update "time1d = (na+dp)*extm/60.0"; .update "time2d = (dp + AL2*na)*extm/60"; .update "tau_r = 1.0/speed/1000.0"; .update "time2d = ((al2*na*extm)+(na*(al2/2.0)*tau))/3600.0"; .update "tmix = tau_rad"; .update "freqhop_rSNOB2=freqhop_F3"; !.update "t1_evol= dw2 - (2.0/3.1415)*PW90"; !.update "t1_evol_max=t1_evol+dw2*(AL2-1)"; !.update "t1_evol_max=1000*dw2*(AL2max)"; !------------------------------------------ ! Executed once at Start of Experiment !------------------------------------------ .program if(ipap_flag==1){SET_LIST(abph,abph_ap); SET_LIST(phi7,phi7_ap); } dpc = dp; p2 = p2 + p0; p_tppm2 = p_tppm2 + p0; a_tmp = aHdec; a_tmp2 = aH; a_tmp3 = aYdec; a_tmp_COSY=aHdec_COSY; pd = pd - 10ms; PW180Y = 2.0 * pw90Y; PW180X = pw180X; PW2=2.0 * pw; PW2_COSY=2.0*pw_COSY; PW_COSY=pw_COSY; pw_SPINAL_t2=pw; tau2=tau1; AL2_st_dum=floor(1+(AL2start/2.0)); AL2_dum=AL2/2.0; AL2_mx_dum=AL2max/2.0; rSNOB_prog(time_soft); TIME_SOFT=time_soft; rSNOB2_prog(time_soft2); TIME_SOFT2=time_soft2; SPC5_PROG; SPINAL1_PROG; SPINAL2_PROG; acq_prog(pw/2.0,pwgap2+pwtppm2); if((soft_pulse_flag == 0)||(ipap_flag==1)){t1_ct_tau_prog(dw2,AL2_dum,AL2_mx_dum,pw180X,PW_COSY,tau1);} if((soft_pulse_flag == 1)&&(ipap_flag==0)){t1_ct_tau_prog(dw2,AL2_dum,AL2_mx_dum,TIME_SOFT,PW_COSY,tau1);} !if(ipap_flag == 1){t1_ct_tau_prog(dw2,AL2_dum,AL2_mx_dum,TIME_SOFT,PW_COSY,tau1);} ! this will give a bit extra high power decoupling on 1H, but it's ok b/c there is no z filter with the AP seq. ch++ ch1; CP_PROG(aXcpLIST,aXcp,CT,ct,deltaHX_X,betaHX_X); ch--; ch++ ch2; CP_PROG(aHcpLIST,aHcp,CT,ct,deltaHX_H,betaHX_H); ch--; CP_PROG(a00,a0,CT,ct,0.0,1.0); txduty1=(pw90H+(2.0*ct)+(2.0*tmix)+ad+rd+aqtm)/extm; if (txduty1 > 0.2) {error(TXDUTY_ERR);} !Duty factor too large if ((PW180Y) > (t1_evol)) {error(PW2SHORT);} ! ------------------------------------------- ! actual pulse prog. runtime loop ! ------------------------------------------- .start tppi=tppi.start; LOOP2D{ if(IDX2_ == 0){ do(AL2start-1){tppi++;} } IDX2_dum=floor(IDX2_/2.0); if((soft_pulse_flag == 0)||(ipap_flag==1)){t1_ct_EVOLVE(dw2,AL2_st_dum,IDX2_dum,PW180X,pw180Y,PW2_COSY);} if((soft_pulse_flag == 1)&&(ipap_flag==0)){t1_CTUCCOSY_EVOLVE(dw2,AL2_st_dum,IDX2_dum,TIME_SOFT2,pw180Y,PW2_COSY);} abph = abph.start; phi1=phi1.start; phi2=phi2.start; phi3=phi3.start; phi4=phi4.start; phi5=phi5.start; phi6=phi6.start; phi7=phi7.start; phi8=phi8.start; phi9=phi9.start; loop1D { call mainseq; } tppi++; } .end mainseq: START_MAIN(time(10u)); Async; ch++ ch1; MAKE_rSNOB; MAKE_rSNOB2; for(ii=0,ii 1.0u){out time(t1_a);} rSNOB_ONRES_X(@phi4++); out time(t1_b); rSNOB2_ONRES_X(@phi_soft2++); ! out pw180X ch1:TG|AP(aX90,@phi_hard2++); if(t1_c > 1.0u){out time(t1_c);} } out pw90X ch1:TG|AP(aX90,@phi5++); out pw90X ch1:TG|AP(aX90,@phi6++); if (ipap_flag == 1){ out time(tau1); rSNOB_ONRES_X(@phi7++); out time(tau1); } else{ if (soft_pulse_flag == 1){ out time(tau1); rSNOB_ONRES_X(@phi7++); out time(tau1); } if (soft_pulse_flag == 0){ out time(tau1); out pw180X ch1:TG|AP(aX90,@phi7++); out time(tau1); }} if(ipap_flag ==0){ SPC5_X(@phi8++,@phi9++); } Acquisition(dw); out pd; Sync; ch--; ch++ ch2; out time(4u) ch2:SC(scH); out tMX ch2:MX; out pw90X ch2:AP(aH,@phi1++); out pw90H ch2:TG; CP(ch2,CT,aHcpLIST,@phi2++); ! DEC_H_COSY(a_tmp_COSY,cyclest1,cyclerm1); SPINAL_t1_DEC_COSY(a_tmp_COSY,cyclest1,cyclerm1); out pw90X ch2:TG|A(aH); out pw90X ch2:TG|A(aH); ! DEC_H_COSY(a_tmp_COSY,cyclest1,cyclerm1); SPINAL_t1_DEC_COSY(a_tmp_COSY,cyclest1,cyclerm1); if(ipap_flag==0){SPC5_H;} !TPPM_DEC_H(a_tmp,cycles,PW2/2.0); SPINAL_t2_DEC(a_tmp,cycles,10u); waitS; ch--; ch++ ch3; out time(4u) ch3:SC(scY); out tMX ch3:MX; out pw90X ; out pw90H ; CP(ch3,CT,a00,p00); if((soft_pulse_flag == 0)||(ipap_flag==1)){t1_tau_Y_J_DEC(PW180X);} if((soft_pulse_flag == 1)&&(ipap_flag==0)){t1_CTUC_Y_J_DEC(TIME_SOFT);} out pw90X; out pw90X; if((soft_pulse_flag == 0)||(ipap_flag==1)){ out time(tau1); out pw180X; out time(tau1); out pw180X; } if((soft_pulse_flag == 1)&&(ipap_flag==0)){ out time(tau1); out time_soft; out time(tau1); out time(pw_rSNOB); } SPC5_Y; TPPM_DEC_N(a_tmp2); waitS; ch--; scan time(10m); return; !=============================== !SPC5 self contained subroutine !Include in the .data section ! !Additional work needs to be done for multiple SPC5 mix periods ! !CMR Lab...UIUC...Trent Franks author !=============================== !---- SPC5 parameters .time extern autofix t_mix "mixing time" = 2000.0us; .time extern autofix pw360Xdq "X channel 360" = 20us; .time extern ZF_delay "Z filter time" = 100us; .time extern ZF_delay1 = 100 us; .time autofix PW360Xdq "pw360Xdq - tm1" = 20.0us; .time autofix PW270Xdq "pw360Xdq*.75 - tm1" = 15.0us; .time autofix PW90Xdq "pw360Xdq*.25 - tm1" = 5.0us; .time t_dqdec = 10us; .long extern q = 0; !number of rf cycles .long extern bigN_SPC5= 2; .ampl extern aXdq = 0.40; !X amplitude for DQ .ampl extern aHdq = 0.80; !H amplitude for DQ .ampl extern aHzfil = 0.30; !H amplitude for DQ .time extern tau_r = 100us; !---- RAD parameters .ampl extern aHrad =0.15; .time extern autofix tau_rad = 5000us; !DO NOT USE SPC5.inc and RAD.inc in same program. !--- SPC5 phases .phase ph_temp = 0.0; .phase list pdq[] = 0.0, 72.0,144.0,216.0,288.0, 180.0,252.0,324.0, 36.0,108.0; !=============================== !* Add the following lines to .acq file !# SPC5 parameters !q;No. cycles in t_exc;7;-;0;250;0;3;long !tau_r;rotor period;100;u;10;5000;2;2;float !t_mix;2Q mix + 0.1u;500;u;0;25000;2;3;float !bigN_SPC5;2Q rotor periods;2;-;1;5;0;1;long !pw360Xdq;X 360 (aXdq);16;u;.1;4000;2;2;float !aXdq;X dq ampl;0.0;-;0.0;1.0;4;3;float !pw90X;X 90 (aX90);4;u;.1;1000;2;3;float !aX90;X 90 ampl;0.0;-;0.0;1.0;4;3;float !#RAD/DARR parameters !tau_rad;rad mix time;1;m;0.01;100;3;3;float !aHrad;dec. dur. RAD;0.0;-;0.0;0.50;4;3;float !# SPC5 decoupling !aHdq;H dec. (DQ);0.0;-;0.0;1.0;4;1;float !aHzfil;dec. dur. z filter;0.25;-;0.0;1.0;4;1;float !*/ !.update "speed = bigN_SPC5/(5000.0*pw360Xdq)/2.0"; .update "tau_r = 1.0/speed/1000.0"; .update "ZF_delay = tau_r - pw90X"; .update "pw360Xdq = bigN_SPC5*tau_r/10.0"; .update "t_mix = (2.0*pw360Xdq)*q + 1u"; !(2.0*pw360Xdq)*q + tau_rad + 0.001u"; DEFINE SPC5_Prog SPC5_PROG; ENDDEF DEFINE SPC5_PROG dpc=dp; bigN_SPC5*tau_r/10.0; t_dqdec = pw360Xdq*2.0; PW360Xdq = pw360Xdq - tm1; PW270Xdq = (0.75*pw360Xdq) - tm1; PW90Xdq = (0.25*pw360Xdq) - tm1; ENDDEF DEFINE SPC5_prog SPC5_PROG; ENDDEF DEFINE START_MAIN_SPC5 pdq=pdq.start; ENDDEF DEFINE SPC5_C(store,recall) SPC5_X(store,recall); ENDDEF DEFINE SPC5_X(store,recall) out tm1 ch1:TG|AP(aX90,store); out pw90X ch1:TG; out time(ZF_delay) ch1:AP(aXdq,@pdq); out tMX ch1:MX; do(q) { out tm1 ch1:TG|P(@pdq); out PW90Xdq ch1:TG; out tm1 ch1:TG|P(p180+@pdq); out PW360Xdq ch1:TG; out tm1 ch1:TG|P(@pdq++); out PW270Xdq ch1:TG; } out tau_rad; out tm1 ch1:AP(aX90,recall); out time(ZF_delay); out tMX ch1:MX; out pw90X ch1:TG; ENDDEF DEFINE SPC5_H out tm1; out pw90X ch2: TG|A(aH)|p0; out time(ZF_delay) ch2: TG|A(aHzfil); out tMX; do(q) { out time(t_dqdec) ch2: TG|A(aHdq); } if (float(aHrad)>0.01){ out tau_rad ch2: TG|A(aHrad);} else{ out tau_rad;} out tm1; out time(ZF_delay) ch2: TG|A(aHzfil); out tMX; out pw90X ch2: TG|A(aH)|p0; ENDDEF DEFINE SPC5_N SPC5_Y; ENDDEF DEFINE SPC5_Y out tm1; out pw90X ; out time(ZF_delay); out tMX; do(q) { out time(t_dqdec); } out tau_rad; out tm1; out time(ZF_delay); out tMX; out pw90X; ENDDEF DEFINE SPC5_X_DQF(store,pdqf,recall) out tm1 ch1:TG|AP(aX90,store); out pw90X ch1:TG; out time(ZF_delay) ch1:AP(aXdq,@pdq); ph_temp=pdqf; out tMX ch1:MX; do(q) { out tm1 ch1:TG|P(@pdq); out PW90Xdq ch1:TG; out tm1 ch1:TG|P(p180+@pdq); out PW360Xdq ch1:TG; out tm1 ch1:TG|P(@pdq++); out PW270Xdq ch1:TG; } do(q) { out tm1 ch1:TG|P(ph_temp+@pdq); out PW90Xdq ch1:TG; out tm1 ch1:TG|P(ph_temp+p180+@pdq); out PW360Xdq ch1:TG; out tm1 ch1:TG|P(ph_temp+(@pdq++)); out PW270Xdq ch1:TG; } ! Careful with pass lists that are called more than once. out tau_rad; out tm1 ch1:AP(aX90,recall); out time(ZF_delay); out tMX ch1:MX; out pw90X ch1:TG; ENDDEF DEFINE SPC5_X_EXC(store) out tm1 ch1:TG|AP(aX90,store); out pw90X ch1:TG; out time(ZF_delay) ch1:AP(aXdq,@pdq); out tMX ch1:MX; do(q) { out tm1 ch1:TG|P(@pdq); out PW90Xdq ch1:TG; out tm1 ch1:TG|P(p180+@pdq); out PW360Xdq ch1:TG; out tm1 ch1:TG|P(@pdq++); out PW270Xdq ch1:TG; } ENDDEF DEFINE SPC5_X_REC(pdqf,recall) out tm1 ch1:TG|AP(aXdq,pdqf+@pdq); do(q) { out PW90Xdq ch1:TG; out tm1 ch1:TG|P(pdqf+p180+@pdq); out PW360Xdq ch1:TG; out tm1 ch1:TG|P(pdqf+(@pdq++)); out PW270Xdq ch1:TG; out tm1 ch1:TG|P(pdqf+@pdq); } out tau_rad; ! out tm1 ch1:AP(aX90,recall); out time(ZF_delay) ch1:AP(aX90,recall); out tMX ch1:MX; out pw90X ch1:TG; ENDDEF DEFINE SPC5_H_EXC out tm1 ch2: TG|A(aHdq)|p0; out pw90X ch2: TG; out time(ZF_delay) ch2: TG|A(aHzfil); out tMX ch2: TG|A(aHdq); do(q) { out time(t_dqdec) ch2: TG|A(aHdq); } ENDDEF DEFINE SPC5_H_REC out tm1 ch2: TG|A(aHdq)|p0; do(q) { out time(t_dqdec) ch2: TG; } if (float(aHrad)>0.01){ out tau_rad ch2: TG|A(aHrad);} else{ out tau_rad;} out time(ZF_delay) ch2: TG|A(aHzfil); out tMX ch2: TG; out pw90X ch2: TG|A(aHdq)|p0; ENDDEF DEFINE SPC5_Y_EXC out tm1; out pw90X; out time(ZF_delay); out tMX; do(q) { out time(t_dqdec); } ENDDEF DEFINE SPC5_Y_REC out tm1; do(q) { out time(t_dqdec); } out tau_rad; out time(ZF_delay); out tMX; out pw90X; ENDDEF DEFINE RAD_H(aDEC) out tm1; out pw90X ch2: TG|A(aDEC)|p0; out time(ZF_delay) ch2: TG|A(aHzfil); out tMX; out tau_rad ch2: TG|A(aHrad); out tm1; out tMX; out pw90X ch2: TG|A(aDEC)|p0; ENDDEF DEFINE RAD_X(Store,Recall) out tm1 ch1:TG|AP(aX90,Store); out pw90X ch1:TG; out time(ZF_delay) ; out tMX ch1:MX; out tau_rad; out tm1 ch1:TG|AP(aX90,Recall); out tMX ch1:MX; out pw90X ch1:TG; ENDDEF DEFINE RAD_Y out tm1; out pw90X; out time(ZF_delay); out tMX; out tau_rad; out tm1; out tMX; out pw90X; ENDDEF DEFINE RAD_C(Store,Recall) RAD_X(Store,Recall); ENDDEF DEFINE RAD_N; RAD_Y; ENDDEF !=================================== ! SPINAL DECOUPLING ! BENJAMIN WYLIE !=================================== ! WTF wrote includes file ! 1. Put into Macros. ! 2. Added more "do" loops. ! 3. Changed variable/Macro naming conventions ! 4. Added acq params here.(010906) !=================================== .long extern SPINAL_t1_flag = 1; .phase extern SPINAL_t1_phi = 15.0; .phase extern SPINAL_t1_alp = 15.0; .phase extern SPINAL_t1_bet = 15.0; .ampl extern autofix aH_SPINAL_t1 = 0.75; .time extern pw_SPINAL_t1 = 100us; .time autofix PW_SPINAL_t1 = 100us; .long list super16[] = 1, -1; .long list super32[] = 1, -1,-1, 1; .long list super64[] = 1, -1,-1, 1,-1, 1, 1,-1; .phase list spinal_t1[8]; ch++ ch2; .long list fixed pSPINAL_t1[128]; ch--; !Add to .acq file !pw;SPINAL dcpl pulse;7;u;0.1;1000;2;3;float !SPINAL_t1_phi;SPINAL phi phase;10.0;-;0.0;360.0;2;3;float !SPINAL_t1_alp;SPINAL alpha phase;5.0;-;0.0;360.0;2;3;float !SPINAL_t1_bet;SPINAL beta phase;10.0;-;0.0;360.0;2;3;float !SPINAL_t1_flag;super cycle; 1;-; 1; 4; 0; 3;long !aH_SPINAL_t1;H t1 ampl;0.0;-;0.0;1.0;4;3;float DEFINE SPINAL1_PROG PW_SPINAL_t1 = pw_SPINAL_t1; ch++ ch2; spinal_t1=spinal_t1.start; @spinal_t1++ = SPINAL_t1_phi; @spinal_t1++ = -SPINAL_t1_phi; @spinal_t1++ = (SPINAL_t1_phi + SPINAL_t1_alp); @spinal_t1++ = (-SPINAL_t1_phi - SPINAL_t1_alp); @spinal_t1++ = (SPINAL_t1_phi + SPINAL_t1_bet); @spinal_t1++ = (-SPINAL_t1_phi - SPINAL_t1_bet); @spinal_t1++ = (SPINAL_t1_phi + SPINAL_t1_alp); @spinal_t1++ = (-SPINAL_t1_phi - SPINAL_t1_alp); pSPINAL_t1=pSPINAL_t1.start; super16=super16.start; super32=super32.start; super64=super64.start; spinal_t1=spinal_t1.start; do(16){ spinal_t1=spinal_t1.start; if(SPINAL_t1_flag <= 1){ do(8){@pSPINAL_t1++ = TG | OUTP phase(@spinal_t1++);} } if(SPINAL_t1_flag == 2){ do(8){@pSPINAL_t1++ = TG | OUTP phase((@spinal_t1++ * @super16));} super16++; } if(SPINAL_t1_flag == 3){ do(8){@pSPINAL_t1++ = TG | OUTP phase((@spinal_t1++ * @super32));} super32++; } if(SPINAL_t1_flag == 4){ do(8){@pSPINAL_t1++ = TG | OUTP phase((@spinal_t1++ * @super64));} super64++; } } ch--; ENDDEF DEFINE SPINAL_t1_DEC(aDEC,cycles,xcyclerm) pSPINAL_t1=pSPINAL_t1.start; if(SPINAL_t1_flag == 0){ TPPM_DEC_H(aDEC,cycles,xcyclerm) } if(SPINAL_t1_flag <> 0){ out time(xcyclerm) ch2:TG | aDEC | @pSPINAL_t1++; do(cycles){ out PW_SPINAL_t1 ch2: @pSPINAL_t1++; } } ENDDEF !=================================== ! SPINAL DECOUPLING ! BENJAMIN WYLIE !=================================== ! WTF wrote includes file ! 1. Put into Macros. ! 2. Added more "do" loops. ! 3. Changed variable/Macro naming conventions ! 4. Added acq params here.(010906) !=================================== include "../includes/SPINAL1.inc"; .long extern SPINAL_t2_flag = 1; .phase extern SPINAL_t2_phi = 15.0; .phase extern SPINAL_t2_alp = 15.0; .phase extern SPINAL_t2_bet = 15.0; .ampl extern autofix aH_SPINAL_t2 = 0.75; .time extern pw_SPINAL_t2 = 100us; .time autofix PW_SPINAL_t2 = 100us; .phase list spinal_t2[8]; ch++ ch2; .long list fixed pSPINAL_t2[128]; ch--; !Add to .acq file !pw_SPINAL_t2;SPINAL dcpl pulse;7;u;0.1;1000;2;3;float !SPINAL_t2_phi;SPINAL phi phase;10.0;-;0.0;360.0;2;3;float !SPINAL_t2_alp;SPINAL alpha phase;5.0;-;0.0;360.0;2;3;float !SPINAL_t2_bet;SPINAL beta phase;10.0;-;0.0;360.0;2;3;float !SPINAL_t2_flag;super cycle; 1;-; 1; 4; 0; 3;long !aH_SPINAL_t2;H t2 ampl;0.0;-;0.0;1.0;4;3;float DEFINE SPINAL2_PROG PW_SPINAL_t2 = pw_SPINAL_t2; ch++ ch2; spinal_t2=spinal_t2.start; @spinal_t2++ = SPINAL_t2_phi; @spinal_t2++ = -SPINAL_t2_phi; @spinal_t2++ = (SPINAL_t2_phi + SPINAL_t2_alp); @spinal_t2++ = (-SPINAL_t2_phi - SPINAL_t2_alp); @spinal_t2++ = (SPINAL_t2_phi + SPINAL_t2_bet); @spinal_t2++ = (-SPINAL_t2_phi - SPINAL_t2_bet); @spinal_t2++ = (SPINAL_t2_phi + SPINAL_t2_alp); @spinal_t2++ = (-SPINAL_t2_phi - SPINAL_t2_alp); pSPINAL_t2=pSPINAL_t2.start; super16=super16.start; super32=super32.start; super64=super64.start; spinal_t2=spinal_t2.start; do(16){ spinal_t2=spinal_t2.start; if(SPINAL_t2_flag <= 1){ do(8){@pSPINAL_t2++ = TG | OUTP phase(@spinal_t2++);} } if(SPINAL_t2_flag == 2){ do(8){@pSPINAL_t2++ = TG | OUTP phase((@spinal_t2++ * @super16));} super16++; } if(SPINAL_t2_flag == 3){ do(8){@pSPINAL_t2++ = TG | OUTP phase((@spinal_t2++ * @super32));} super32++; } if(SPINAL_t2_flag == 4){ do(8){@pSPINAL_t2++ = TG | OUTP phase((@spinal_t2++ * @super64));} super64++; } } ch--; ENDDEF DEFINE SPINAL_t2_DEC(aDEC,cycles,xcyclerm) pSPINAL_t2=pSPINAL_t2.start; if(SPINAL_t2_flag == 0){ TPPM_DEC_H(a_tmp,cycles,xcyclerm) } if(SPINAL_t2_flag <> 0){ out time(xcyclerm) ch2: TG | aDEC | @pSPINAL_t2++; do(cycles){ out PW_SPINAL_t2 ch2: TG | aDEC | @pSPINAL_t2++; } } ENDDEF !======================================= !Tangent Cross Polarization ! !The user must specify input parameters, and put them into the main !body of the program. !======================================= .float alpha_CP,alpha2_CP; .ampl aCP,amp; .long extern stepstan "shape steps" = 512; .ampl autofix a0 =0.0001; DEFINE CP_PROG(aLIST,aCP,CNCT,cnct,delta_CP,beta_CP) CNCT = (cnct/stepstan); if(CNCT<0.125u){CNCT=0.125u;} i=0; k=stepstan/2+0.5; do(stepstan){ alpha_CP=2*atan(delta_CP/beta_CP); alpha2_CP=abs(beta_CP)*tan(float(i-k)/float(stepstan-1)*alpha_CP); amp=aCP+alpha2_CP; @aLIST++=RX|TG|A(amp); i++; } if (delta_CP>aCP) {error(ZEROCROSS);} if (delta_CP+aCP>1.000) {error(ZEROCROSS);} ENDDEF DEFINE CP(chan,CNCT,aLIST,PHASE) ss aLIST; out CNCT chan:@aLIST++|P(PHASE); for(i=0,i<(stepstan-1),i++) {out CNCT chan:@aLIST++;} ENDDEF !===================================================== ! THREE_D.inc ! ! File to support three dimensional acquisition ! $Header: /usr2/users/applab/CFR/I+/includes/THREE_D.inc,v 1.1 2000/05/02 22:28:32 applab Exp $ !===================================================== .long IDX2_; .long extern AL2; include "../includes/std_errs.inc"; .update "dl=al"; .update "al2 = AL2"; .update "dl2 = al2"; .update "al3 = 1"; .update "dl3 = al3"; .update "dl4 = 1"; DEFINE LOOP2D ch ALL; index2 = 0; IDX2_=0; WHILE IDX2_ 0.2) {error(TXDUTY_ERR);} !Duty factor too large ENDDEF !----DECOUPLING DEFINE TPPM_DEC_H(aTPPM,cycles,xcyclerm) if(xcyclerm > 0){ out time(xcyclerm) ch2:TG|aTPPM|p0; } do(cycles){ out pw ch2:TG|aTPPM|p2; out pw ch2 :TG|p0; } ENDDEF DEFINE TPPM_DEC_N(a_tmp2) out pwgap2 ch3: P(@tppm2++); out pwtppm2 ch3: TG|a_tmp2; do(cyclesy) { out pwgap2 ch3: P(@tppm2++); out pwtppm2 ch3: TG|a_tmp2; out pwgap2 ch3: P(@tppm2++); out pwtppm2 ch3: TG; } ENDDEF DEFINE CW_DEC(aCW,tCW) out tCW ch2:TG|A(aCW); ENDDEF DEFINE ACQ out rd ch1: TB; out ad ch1: RE | TB; Acq dw ch1: RE | TB; out time(50u) ch1: TB; ENDDEF DEFINE Acquisition(dwell) out rd ch1: TB; out ad ch1: RE | TB; Acq dwell ch1: RE | TB; out time(50u) ch1: TB; !out time(ct) ch1: TG | A(aXcp); ENDDEF !=================================== ! rSNOB X pulse ! BENJAMIN WYLIE AND YING LI !=================================== ! WTF additions 010706 ! 1. streamlined phase/freq hopping implementation. ! 2. added variables to make it fully internal (an actual includes file) ! 3. Changed variable/Macro naming conventions ! 4. Added acq params here.(010906) !=================================== ! Li, Wylie, Rienstra JMR 2006 ! ! phase cycling may be done within ch1 or loop1 (after declaring into ch1) ! !calculation phases .phase phi_rSNOB = 0.0; .phase ph0_rSNOB = 0.0; .phase p00_rSNOB = 0.0; .phase p_err_rSNOB = 0.0; .phase d_ph_rSNOB = 0.0; !timings .time extern pw_rSNOB = 10m; .time autofix PW_rSNOB = 10u; .time t_rSNOB = 10u; .time t_rSNOB_Y = 10u; .time rSNOB_rm = 10u; .time tau_r_rSNOB = 10u; .time tau_r_rSNOB_PI = 10u; .time PW90Ytemp; .long steps_rSNOB "shape steps" = 256; .long cycles_rSNOB; .long ii,jj,kk; .time cyclesrem_rSNOB; !rSNOB Globals .time extern pw_tppm_rSNOB; .ampl extern aHdec_rSNOB; .phase extern p2_tppm_rSNOB; ! r-SNOB fourier coefficients (Shape) .float Ac_rSNOB[]=0.5000,-1.1472, 0.5572,-0.0829, 0.0525; .float Bc_rSNOB[]=0.0000, 0.0000, 0.0000, 0.0000, 0.0000; ! rSNOB amplitudes !ch++ ch1; .long list fixed ap_rSNOB[256]; .float list a_rSNOB[256]; .phase p_rSNOB[256]; .phase list rSNOB_plist[256]; .float extern freqhop_rSNOB = 0.0; !ch--; .ampl extern aX_rSNOB = 0.1; .ampl amplrSNOB = 0.1; .scale scX_rSNOB "X rSNOB scaler" = 0.1; .float norm = 0.0; .phase pshift; .phase phi_0 = 0.0; .phase phi_00 = 0.0; .phase perror = 0.0; .ampl AX_rSNOB; !Add to .acq file !# Selective echo !scX_rSNOB;X scalar soft;0.1;-;0.0;1.0;3;1;float !pw_rSNOB;soft 180 pulse;360;u;200;10000;2;1;float !aX_rSNOB;X 180 soft.;0.1;-;0.0;1.0;4;1;float !#rSNOB Decoupling (all rSNOBs) !aHdec_soft;dec. during echo;0.5;-;0.0;1.0;4;3;float !pw_tppm_soft;TPPM pw(echo);7;u;0.1;1000;2;2;float !p2_tppm_soft; TPPM phase(echo);15;-;0;360;1;2;float !---- add to update section DEFINE rSNOB_prog(t_soft) PW_rSNOB=(pw_rSNOB-12u)/steps_rSNOB; while(PW_rSNOB < 1u){ steps_rSNOB = steps_rSNOB - 1; PW_rSNOB=(pw_rSNOB-12u)/steps_rSNOB; } rSNOB_rm = pw_rSNOB - (steps_rSNOB*PW_rSNOB); d_ph_rSNOB = 0.0 ; norm = 0.0; i=0; do(steps_rSNOB){ amplrSNOB=0.0; j=0; ss Ac_rSNOB; ss Bc_rSNOB; do(Ac_rSNOB.size){ amplrSNOB=amplrSNOB+(@Ac_rSNOB++)*cos(i*j*(2*pi/steps_rSNOB)); amplrSNOB=amplrSNOB+(@Bc_rSNOB++)*sin(i*j*(2*pi/steps_rSNOB)); j++; } if( abs(amplrSNOB) > norm ){norm=abs(amplrSNOB);} i++; } d_ph_rSNOB = 0.0 ; t_rSNOB = pw_rSNOB ; t_soft = t_rSNOB; ch++ ch1; MAKE_rSNOB; MAKE_ampl_rSNOB; ch--; cycles_rSNOB= floor((t_rSNOB)/(2.0*pw_tppm_rSNOB))-1; cyclesrem_rSNOB=(t_rSNOB)-(cycles_rSNOB*2.0*pw_tppm_rSNOB); if( cyclesrem_rSNOB < 1.0u){ cycles_rSNOB=cycles_rSNOB-1; cyclesrem_rSNOB=(t_rSNOB)-(cycles_rSNOB*2.0*pw_tppm_rSNOB); } PW90Ytemp=pw90Y; ENDDEF DEFINE MAKE_rSNOB p_err_rSNOB = 0.0; AX_rSNOB=aX_rSNOB/scX_rSNOB; ss ap_rSNOB; ss p_rSNOB; ss a_rSNOB; i=0; ii=0; norm=0.0; do(steps_rSNOB){ amplrSNOB=0.0; jj=0; do(Ac_rSNOB.size){ a_rSNOB[ii] = a_rSNOB[ii] + Ac_rSNOB[jj]*cos(ii*jj*(2*pi/steps_rSNOB)); a_rSNOB[ii] = a_rSNOB[ii] + Bc_rSNOB[jj]*sin(ii*jj*(2*pi/steps_rSNOB)); jj++; } if(abs(a_rSNOB[ii]) > norm) { norm = abs(a_rSNOB[ii]); } ii++; } ii = 0; pshift=(freqhop_rSNOB*360.0)*(pw_rSNOB/steps_rSNOB); perror = 0.0; ss ap_rSNOB; do(steps_rSNOB){ phi_0 = -1.0*(freqhop_rSNOB*180.0)*(pw_rSNOB); ! normally phi_0 = 0.0; a_rSNOB[ii] = (a_rSNOB[ii]/norm)*AX_rSNOB; if(a_rSNOB[ii] < 0.0){ a_rSNOB[ii] = abs(a_rSNOB[ii]); phi_0 = phi_0 + 180.0; } phi_0 = phi_0 + pshift*(ii+1); phi_0 = phi_0; phi_00 = floor(phi_0+0.5); perror = perror + (phi_0 - phi_00); if(abs(perror) > 1.0){ phi_00 = phi_00 + floor(perror); perror = perror - floor(perror); } p_rSNOB[ii]=phi_00; ii++; } ! ss p_rSNOB; ! ss a_rSNOB; ! ss ap_rSNOB; ! do(steps_rSNOB){ ! @ap_rSNOB++ = TG | AP(@a_rSNOB++,@p_rSNOB++) ; ! } ENDDEF DEFINE MAKE_ampl_rSNOB p_err_rSNOB = 0.0; ph0_rSNOB = 0.0; ss a_rSNOB; ss p_rSNOB; do(steps_rSNOB){@a_rSNOB++=0.0;@p_rSNOB++=0.0;} ss a_rSNOB; ss p_rSNOB; i = 0; do(steps_rSNOB){ amplrSNOB=0.0; ss Ac_rSNOB; ss Bc_rSNOB; j=0; do(Ac_rSNOB.size){ amplrSNOB=amplrSNOB + Ac_rSNOB[j]*cos(j*2*pi*i/steps_rSNOB); amplrSNOB=amplrSNOB + Bc_rSNOB[j]*sin(j*2*pi*i/steps_rSNOB); j++; } amplrSNOB=aX_rSNOB*amplrSNOB/scX_rSNOB; if(amplrSNOB < 0.0){ ph0_rSNOB=p180+ph0_rSNOB; amplrSNOB=abs(amplrSNOB); } ph0_rSNOB= ph0_rSNOB + (i*d_ph_rSNOB); p00_rSNOB=floor(ph0_rSNOB + 0.5); p_err_rSNOB = p_err_rSNOB + (ph0_rSNOB - p00_rSNOB); if(abs(p_err_rSNOB)>1.0){ p00_rSNOB = p00_rSNOB + floor(p_err_rSNOB); p_err_rSNOB = p_err_rSNOB - floor(p_err_rSNOB); } p00_rSNOB=p00_rSNOB - floor(p00_rSNOB/360.0)*360.0; @a_rSNOB++ = amplrSNOB ; @p_rSNOB++ = p00_rSNOB ; i++; } ENDDEF DEFINE rSNOB_X ss ap_rSNOB; out time(3u) ch1: TB ; out time(3u) ch1: SC(scX_rSNOB); for(i=0, i1.0u) { out time(t_rSNOB_Y); out pw90Y ch3:TG|AP(aY90, 0.0); out pw90Y ch3:TG|AP(aY90,90.0); out pw90Y ch3:TG|AP(aY90,90.0); out pw90Y ch3:TG|AP(aY90, 0.0); } ENDDEF !=================================== ! rSNOB2 X pulse ! BENJAMIN WYLIE AND YING LI !=================================== ! WTF additions 010706 ! 1. streamlined phase/freq hopping implementation. ! 2. added variables to make it fully internal (an actual includes file) ! 3. Changed variable/Macro naming conventions ! 4. Added acq params here.(010906) !=================================== ! Li, Wylie, Rienstra JMR 2006? ! ! phase cycling may be done within ch1 or loop1 (after declaring into ch1) ! !calculation phases .phase phi_rSNOB2 = 0.0; .phase ph0_rSNOB2 = 0.0; .phase p00_rSNOB2 = 0.0; .phase p_err_rSNOB2 = 0.0; .phase d_ph_rSNOB2 = 0.0; !timings .time extern pw_rSNOB2 = 10m; .time autofix PW_rSNOB2 = 10u; .time t_rSNOB2 = 10u; .time rSNOB2_rm = 10u; .time tau_r_rSNOB2 = 10u; .long steps_rSNOB2 "shape steps" = 256; .long cycles_rSNOB2; .time cyclesrem_rSNOB2; ! .long ii,jj,kk; ! r-SNOB fourier coefficients (Shape) .float Ac_rSNOB2[]=0.5000,-1.1472, 0.5572,-0.0829, 0.0525; .float Bc_rSNOB2[]=0.0000, 0.0000, 0.0000, 0.0000, 0.0000; ! rSNOB2 amplitudes !ch++ ch1; .long list fixed ap_rSNOB2[256]; .float list a_rSNOB2[256]; .phase p_rSNOB2[256]; .phase list rSNOB2_plist[256]; .float extern freqhop_rSNOB2 = 0.0; !ch--; .ampl extern aX_rSNOB2 = 0.1; .ampl amplrSNOB2 = 0.1; .float nml_rSNOB2 = 0.0; ! .float norm = 0.0; ! .phase pshift; .scale scX_rSNOB2 "X rSNOB2 scaler" = 0.1; ! .phase phi_0 = 0.0; ! .phase phi_00 = 0.0; ! .phase perror = 0.0; .ampl AX_rSNOB2; !Add to .acq file !# Selective echo !scX_rSNOB2;X scalar soft;0.1;-;0.0;1.0;3;1;float !pw_rSNOB2;soft 180 pulse;360;u;200;10000;2;1;float !aX_rSNOB2;X 180 soft.;0.1;-;0.0;1.0;4;1;float !freqhop_rSNOB2;softpulse offset;0;Hz;-100000.0;100000.0;3;0;float DEFINE rSNOB2_prog(t_soft) PW_rSNOB2=(pw_rSNOB2-12u)/steps_rSNOB2; while(PW_rSNOB2 < 1.0u){ steps_rSNOB2 = steps_rSNOB2 - 1; PW_rSNOB2=(pw_rSNOB2-12u)/steps_rSNOB2; } rSNOB2_rm = pw_rSNOB2 - (steps_rSNOB2*PW_rSNOB2); d_ph_rSNOB2 = 0.0; norm=0.0; i=0; do(steps_rSNOB2){ amplrSNOB2=0.0; j=0; ss Ac_rSNOB2; ss Bc_rSNOB2; do(Ac_rSNOB2.size){ amplrSNOB2=amplrSNOB2+(@Ac_rSNOB2++)*cos(i*j*(2*pi/steps_rSNOB2)); amplrSNOB2=amplrSNOB2+(@Bc_rSNOB2++)*sin(i*j*(2*pi/steps_rSNOB2)); j++; } if( abs(amplrSNOB2) > norm ){norm=abs(amplrSNOB2);} i++; } d_ph_rSNOB2 = 0.0; t_rSNOB2 = pw_rSNOB2 ; t_soft = t_rSNOB2; ch++ ch1; MAKE_rSNOB2; MAKE_ampl_rSNOB2; ch--; cycles_rSNOB2= floor((t_soft)/(2.0*pw_tppm_rSNOB)); cyclesrem_rSNOB2=t_soft+pw180X-cycles_rSNOB2*2.0*pw_tppm_rSNOB ; if( cyclesrem_rSNOB2 < 1.0u){ cycles_rSNOB2=cycles_rSNOB2-1; cyclesrem_rSNOB2=t_soft+pw180X-cycles_rSNOB2*2.0*pw_tppm_rSNOB; } ENDDEF DEFINE MAKE_rSNOB2 p_err_rSNOB2 = 0.0; AX_rSNOB2=aX_rSNOB2/scX_rSNOB2; ss ap_rSNOB2; ss p_rSNOB2; ss a_rSNOB2; i=0; ii=0; norm=0.0; do(steps_rSNOB2){ amplrSNOB2=0.0; jj=0; do(Ac_rSNOB2.size){ a_rSNOB2[ii] = a_rSNOB2[ii] + Ac_rSNOB2[jj]*cos(ii*jj*(2*pi/steps_rSNOB2)); a_rSNOB2[ii] = a_rSNOB2[ii] + Bc_rSNOB2[jj]*sin(ii*jj*(2*pi/steps_rSNOB2)); jj++; } if(abs(a_rSNOB2[ii]) > norm) { norm = abs(a_rSNOB2[ii]); } ii++; } ii = 0; freqhop_rSNOB2=freqhop_F3; pshift=(freqhop_rSNOB2*360.0)*((pw_rSNOB2-12u)/steps_rSNOB2); perror = 0.0; ss ap_rSNOB2; do(steps_rSNOB2){ phi_0 = -1.0*(freqhop_rSNOB2*180.0)*(pw_rSNOB2); ! normally phi_0 = 0.0; a_rSNOB2[ii] = (a_rSNOB2[ii]/norm)*AX_rSNOB2; if(a_rSNOB2[ii] < 0.0){ a_rSNOB2[ii] = abs(a_rSNOB2[ii]); phi_0 = phi_0 + 180.0; } phi_0 = phi_0 + pshift*(ii+1); phi_0 = phi_0; phi_00 = floor(phi_0+0.5); perror = perror + (phi_0 - phi_00); if(abs(perror) > 1.0){ phi_00 = phi_00 + floor(perror); perror = perror - floor(perror); } p_rSNOB2[ii]=phi_00; ii++; } ENDDEF DEFINE MAKE_ampl_rSNOB2 p_err_rSNOB2 = 0.0; ph0_rSNOB2 = 0.0; ss a_rSNOB2; ss p_rSNOB2; do(steps_rSNOB2){@a_rSNOB2++=0.0;@p_rSNOB2++=0.0;} ss a_rSNOB2; ss p_rSNOB2; i = 0; do(steps_rSNOB2){ amplrSNOB2=0.0; ss Ac_rSNOB2; ss Bc_rSNOB2; j=0; do(Ac_rSNOB2.size){ amplrSNOB2=amplrSNOB2 + Ac_rSNOB2[j]*cos(j*2*pi*i/steps_rSNOB2); amplrSNOB2=amplrSNOB2 + Bc_rSNOB2[j]*sin(j*2*pi*i/steps_rSNOB2); j++; } amplrSNOB2=aX_rSNOB2*amplrSNOB2/scX_rSNOB; if(amplrSNOB2 < 0.0){ ph0_rSNOB2=p180+ph0_rSNOB2; amplrSNOB2=abs(amplrSNOB2); } ph0_rSNOB2= ph0_rSNOB2 + (i*d_ph_rSNOB2); p00_rSNOB2=floor(ph0_rSNOB2 + 0.5); p_err_rSNOB2 = p_err_rSNOB2 + (ph0_rSNOB2 - p00_rSNOB2); if(abs(p_err_rSNOB2)>1.0){ p00_rSNOB2 = p00_rSNOB2 + floor(p_err_rSNOB2); p_err_rSNOB2 = p_err_rSNOB2 - floor(p_err_rSNOB2); } p00_rSNOB2=p00_rSNOB2 - floor(p00_rSNOB2/360.0)*360.0; @a_rSNOB2++ = amplrSNOB2 ; @p_rSNOB2++ = p00_rSNOB2 ; i++; } ENDDEF DEFINE rSNOB2_X ss ap_rSNOB2; out time(3u) ch1: TB ; out time(3u) ch1: SC(scX_rSNOB2); ! out time(tau_r_rSNOB2); for(i=0, i 0.2) {error(TXDUTY_ERR);} ! ! 2. The second line is a definition which calculates the full ! error code number which will appear as a _COMMENT line in the ! compiled hex code of the pulse program. This identifies the ! error code to Spinsight. For example, ! define TXDUTY_ERROR_CODE USER_ERROR_BASE + TXDUTY_ERR ! ! 3. The third line creates a comment in the compiled P-Code ! that will be picked up by Spinsight while reading in the ! pulse program. The error code and the descriptive text which ! accompanies it will be added to an error code table that will ! remain intact until you load a different pulse program. ! See actual examples below. ! ! ----------------------------------------------------------------- ! Some Tips and Comments: ! ----------------------------------------------------------------- ! ! It is recommended that error definitions be placed in the '.data' ! section of the pulse program, and calls to the error() function ! be placed in the '.program' section where possible, so that ! errors will be detected and reported before the pulse program can ! actually start. ! ! You can have gaps in the error numbering system, and error ! code definitions do not have to be in numerical order. ! ! If you accidentally give the same numerical code to two ! different errors, only the first one will be in effect. ! ! The three-line error definitions can also be placed directly in ! line in the P-Code source program and need not be in an include ! file. In fact, this is recommended for errors which are specific ! to one pulse program only, and are not generally applicable. ! When creating in-line error definitions in pulse programs, it ! is recommended that their numbering start at 0x100 in order ! to avoid conflicts with definitions in this file, which start ! at 0x1. ! ! When creating new error definitions, note the syntax of the ! comment line, especially with regard to the placement of ! quote marks. Also, the comment line should have a semicolon ! at the end, but the two 'define' lines should not. ! ! It is the user's reponsibility to devise the code for the error ! check and to call error(). Use the Varian/Chemagnetics released ! programs as examples. ! ! Try to be descriptive about the nature of the error in the ! comment text string, because that is what the user will see. ! For instance, "Echo time too short" is better than "You can't ! do that!" ! ! Defined errors are most useful for derived or calculated ! parameters, because these cannot be corrected automatically ! by the Spinsight Acq panel. It will try to correct them, but ! they will immediately be recalculated from other parameters, and ! thus will still be wrong. For simple non-derived parameters, ! there is usually no need to define errors here, since the limits ! in the .acq file will take care of them. ! ----------------------------------------------------------------- ! define TXDUTY_ERR 0x1 define TXDUTY_ERROR_CODE USER_ERROR_BASE + TXDUTY_ERR comment "ERROR "TXDUTY_ERROR_CODE "XMTR duty factor too large"; define PW2SHORT 0x2 define PW2SHORT_ERROR_CODE USER_ERROR_BASE + PW2SHORT comment "ERROR "PW2SHORT_ERROR_CODE "Pulse width too short"; define ZEROCROSS 0x3 define ZEROCROSS_ERROR_CODE USER_ERROR_BASE + ZEROCROSS comment "ERROR "ZEROCROSS_ERROR_CODE "Ramp cannot cross zero or 100!"; define BADDUTY 0x4 define BADDUTY_ERROR_CODE USER_ERROR_BASE + BADDUTY comment "ERROR "BADDUTY_ERROR_CODE "Impossible duty factor!"; define NEGPULSE 0x5 define NEGPULSE_ERROR_CODE USER_ERROR_BASE + NEGPULSE comment "ERROR "NEGPULSE_ERROR_CODE "Small or negative pulse width!"; define NOSPIN 0x6 define NOSPIN_ERROR_CODE USER_ERROR_BASE + NOSPIN comment "ERROR "NOSPIN_ERROR_CODE "We do magic-angle SPINNING in this lab!"; define TAU_ERR 0x7 define TAU_ERROR_CODE USER_ERROR_BASE + TAU_ERR comment "ERROR "TAU_ERROR_CODE "pw180X too long or tau too short"; ! ----------------------------------------------------------------- ! Add more error definitions above this line as desired. ! ------------------------------------------ ! TIME INCREMENTS. ! ! This Set of subroutines keeps track of evolution times. ! ! CMR Lab...UIUC...Trent Franks...4-22-04 ! ! Updated to be consistent with ants.csh ! ! WTF updated 12-30-04 ! 1. AL start parameters added ! 2. Initial start times are calculated. ! f ! WTF updated 01-05-06 ! 1. Constant time evolution added ! ! WTF updated 051407 ! 1. Constant time with soft pulse, Improved J decoupling. ! ------------------------------------------ include "../includes/acq.inc"; !---- t1 .time extern t1_evol = 100u; .time t1_evol_out = 100u; .time extern t1_evol_max = 100u; .time extern t1_evol_max2= 100u; .time t1_evol_x = 100u; .time cyclerm1 = 1.0u; .time t1by2 = 1.0u; .time t1by2x = 1.0u; .time t1by2y = 1.0u; .time extern autofix pwXdump= 10u; .time extern autofix pwYdump= 10u; !---- t1 TPPM Parameters .float t1cycles "no. of TPPM cycles during t1" = 8; .long cyclest1 ; !---- t1 constant time (echo recoupling) .time extern t1_ct = 100u; .time t1_a = 100u; .time t1aby2 = 1.0u; .time t1aby2x = 1.0u; .time t1aby2y = 1.0u; .time t1_b = 100u; .time t1bby2 = 1.0u; .time t1bby2x = 1.0u; .time t1bby2y = 1.0u; .time t1_c = 100u; .time t1cby2 = 1.0u; .time t1cby2x = 1.0u; .time t1cby2y = 1.0u; .long cyclest1a ; .long cyclest1b ; .long cyclest1c ; .time cyclerm1a = 1.0u; .time cyclerm1b = 1.0u; .time cyclerm1c = 1.0u; .time t1LO = 100u; .time t1LOby2 = 1.0u; .time t1LOby2x = 1.0u; .time t1LOby2y = 1.0u; .long cyclest1LO ; .time cyclerm1LO = 1.0u; .long cycles1tau ; .time cyclerm1tau = 1.0u; !---- Add to update section (uncomment/adjust variable names) ! .update "t1_evol= dwell - (2.0/3.1415)*offset"; ! .update "t1_evol_max = t1_evol + dwell * (AL - 1)"; ! .update "t1_evol_max2 = dwell * (AL_max)"; DEFINE t1_prog(dwell,AL,ALmax,offset,PW) t1_evol= dwell - (2.0/3.14159) * offset; t1_evol_max = t1_evol + dwell*(AL-1); if(AL(2.0*PW180X+1u)){ t1by2x = t1by2 - PW180X ; ! 2 pi's for composite,1 per half } else{t1by2x=t1by2;} if(t1by2>(2.0*PW180Y+1u)){ t1by2y = t1by2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1by2y=t1by2;} t1_evol_x = t1_evol_max2 + 10u - t1_evol_out; if(t1_evol_x<3.0u){t1_evol_x=3u;} ENDDEF DEFINE t1_HOMO_DEC_EVOLVE(dwell,ALstart,INDEX,PW_Evol,PW_homodec) t1_evol_out = (t1_evol + (dwell*(INDEX+ALstart-1)))/2.0; cyclest1 = ceil(t1_evol_out/PW_Evol)-1; if (cyclest1 < 0){cyclest1 = 0;} cyclerm1 = t1_evol_out - cyclest1*PW_Evol; if(cyclerm1<1.0u){ cyclest1 = cyclest1 - 1; if (cyclest1 < 0){cyclest1 = 0;} cyclerm1 = t1_evol_out - cyclest1*PW_Evol; } !making sure cyclerm2 isn't too short t1by2 = t1_evol_out; if((t1by2+(PW_homodec/2.0))>(2.0*PW180X+1u )){ t1by2x = t1by2 - PW90X; ! 4 pi/2's for composite,1 per half } else{t1by2x=t1by2;} if((t1by2+(PW_homodec/2.0))>(2.0*PW180Y+1u )){ t1by2y = t1by2 - 2*PW90Y; ! 4 pi/2's for composite,2 per half } else{t1by2y=t1by2;} t1_evol_x = t1_evol_max2 + 10u - 2.0*t1_evol_out; if(t1_evol_x<3.0u){t1_evol_x=3u;} ENDDEF DEFINE t1_PROG(dwell,AL,ALmax,PW) t1_prog(dwell,AL,ALmax,PW); ENDDEF DEFINE t1_Y_PI_DEC if(t1by2y1.0u) {out time(PW_homodec);} out pw90Y ch3:TG|AP(aY90, 0.0); out time(PW180Y) ch3:TG|AP(aY90,90.0); out pw90Y ch3:TG|AP(aY90, 0.0); out time(t1by2y); } else{ out time(t1by2); out time(t1by2); } ENDDEF DEFINE t1_N_PI_DEC(pw90Y) if(t1by2y=ALct){t1_ct = pw180CS + (dwell*AL); } t1_evol_out = t1_ct; cyclest1 = floor((t1_ct)/(PW)); cyclest1 = cyclest1 - 1; cyclerm1 = t1_ct - cyclest1*PW; if(cyclerm1<1.0u){ cyclest1 = cyclest1 - 1; cyclerm1 = t1_evol - cyclest1*PW; } !!! t1_evol_max = t1_evol + dwell*(AL-1); if(AL(2.0*PW180X+1u)){ t1by2x = t1by2 - PW180X ; ! 2 pi's for composite,1 per half } else{t1by2x=t1by2;} if(t1by2>(2.0*PW180Y+1u)){ t1by2y = t1by2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1by2y=t1by2;} t1_evol_x = t1_evol_max2 + 10u - t1_evol_out; if(t1_evol_x<3.0u){t1_evol_x=3u;} ENDDEF DEFINE t1_ct_tau_prog(dwell,AL,ALct,pw180CS,PW,tau) if(AL< ALct){t1_evol = pw180CS + (dwell*ALct);} if(AL>=ALct){t1_evol = pw180CS + (dwell*AL); } t1_ct = 2*tau + pw180CS; t1_evol_out = 2*tau; !if(t1_evol>t1_ct){error(t1outofbounds); ! This ain't workin cyclest1 = floor((t1_ct)/(PW)); cyclest1 = cyclest1 - 1; cyclerm1 = t1_ct - cyclest1*PW; if(cyclerm1<1.0u){ cyclest1 = cyclest1 - 1; cyclerm1 = t1_evol - cyclest1*PW; } !!! t1_evol_max = t1_evol + dwell*(AL-1); if(AL(2.0*PW180X+1u)){ t1by2x = t1by2 - PW180X ; ! 2 pi's for composite,1 per half } else{t1by2x=t1by2;} if(t1by2>(2.0*PW180Y+1u)){ t1by2y = t1by2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1by2y=t1by2;} t1_evol_x = t1_evol_max2 + 10u - t1_evol_out; if(t1_evol_x<3.0u){t1_evol_x=3u;} ENDDEF DEFINE t1_ct_EVOLVE(dwell,ALstart,INDEX,PW180_CS,PW180_J,PW_Evol) t1_a= (t1_ct-PW180_CS) / 2.0 - ((INDEX+ALstart-1) * (dwell / 2.0)); t1_b= (t1_ct-PW180_CS) / 2.0 + ((INDEX+ALstart-1) * (dwell / 2.0)); if (t1_a<1.0u){t1_a=1u;} if (t1_b<1.0u){t1_b=1u;} ! Proton decoupling in each period cyclest1a = ceil(t1_a/PW_Evol)-1; cyclerm1a = t1_a - cyclest1a*PW_Evol; cyclest1b = ceil(t1_b/PW_Evol)-1; cyclerm1b = t1_b - cyclest1b*PW_Evol; if(cyclerm1a<1.0u){ cyclest1a = cyclest1a - 1; cyclerm1a = t1_a - cyclest1a*PW_Evol; } if(cyclerm1b<1.0u){ cyclest1b = cyclest1b - 1; cyclerm1b = t1_b - cyclest1b*PW_Evol; } !making sure cyclerm1(a,b) isn't too short !for heteronuclear J-decoupling !!! t1aby2 = t1_a / 2.0; if(t1aby2>(2.0*PW180X+1u)){ t1aby2x = t1aby2 - PW180X ; ! 2 pi's for composite,1 per half } else{t1aby2x=t1aby2;} if(t1aby2>(2.0*PW180Y+1u)){ t1aby2y = t1aby2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1aby2y=t1aby2;} !!! t1bby2y = t1bby2x; t1bby2 = t1_b / 2.0; if(t1bby2>(2.0*PW180X+1u)){ t1bby2x = t1bby2 - PW180X ; ! 2 pi's for composite,1 per half } else{t1bby2x=t1bby2;} if(t1bby2>(2.0*PW180Y+1u)){ t1bby2y = t1bby2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1bby2y=t1bby2;} !!! Leftover for scalar experiments t1LO = t1_ct - 2*t1_a + PW180_CS; t1LOby2 = t1LO / 2.0; if(t1LOby2>(2.0*PW180X+1u)){ t1LOby2x = t1LOby2 - PW180X ; ! 2 pi's for composite,1 per half } else{t1LOby2x=t1LOby2;} if(t1LOby2>(2.0*PW180Y+1u)){ t1LOby2y = t1LOby2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1LOby2y=t1LOby2;} cyclest1LO = ceil(t1LO/PW_Evol)-1; cyclerm1LO = t1LO - cyclest1LO*PW_Evol; if(cyclerm1LO<1.0u){ cyclest1LO = cyclest1LO - 1; cyclerm1LO = t1LO - cyclest1LO*PW_Evol; } cycles1tau = ceil(tau/PW_Evol)-1; cyclerm1tau = tau - cycles1tau*PW_Evol; if(cyclerm1tau<1.0u){ cycles1tau = cycles1tau - 1; cyclerm1tau = tau - cycles1tau*PW_Evol; } !!! ENDDEF DEFINE t1_CTUCCOSY_EVOLVE(dwell,ALstart,INDEX,PW180_CS,PW180_J,PW_Evol) t1_a= tau1 - ((INDEX + ALstart - 1) * (dwell / 2.0)); t1_b= tau1 - PW180_CS; ! t1_c= ((INDEX + ALstart - 1) * (dwell / 2.0)); if (t1_a<1.0u){t1_a=1u;} if (t1_b<1.0u){t1_b=1u;} if (t1_c<1.0u){t1_c=1u;} ! Proton decoupling in each period cyclest1a = ceil(t1_a/PW_Evol)-1; cyclerm1a = t1_a - cyclest1a*PW_Evol; cyclest1b = ceil(t1_b/PW_Evol)-1; cyclerm1b = t1_b - cyclest1b*PW_Evol; cyclest1c = ceil(t1_c/PW_Evol)-1; cyclerm1c = t1_c - cyclest1c*PW_Evol; if(cyclerm1a<1.0u){ cyclest1a = cyclest1a - 1; cyclerm1a = t1_a - cyclest1a*PW_Evol; } if(cyclerm1b<1.0u){ cyclest1b = cyclest1b - 1; cyclerm1b = t1_b - cyclest1b*PW_Evol; } if(cyclerm1c<1.0u){ cyclest1c = cyclest1c - 1; cyclerm1c = t1_c - cyclest1c*PW_Evol; } !making sure cyclerm1(a,b) isn't too short !for heteronuclear J-decoupling !!! t1cby2 = t1_c / 2.0; if(t1cby2>(2.0*PW180Y+1u)){ t1cby2y = t1cby2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t1cby2y=t1cby2;} !!! ENDDEF DEFINE t1_ct_X(pCS) if(t1_a > 1.0u){out time(t1_a);} out pw180X ch1:TG|AP(aX90,pCS); if(t1_b > 1.0u){out time(t1_b);} ENDDEF DEFINE t1_ct_Y(pCS) if(t1_a > 1.0u){out time(t1_a);} out pw180Y ch3:TG|AP(aY90,pCS); if(t1_b > 1.0u){out time(t1_b);} ENDDEF DEFINE t1_ct_X_J_DEC(PW_CS) if( t1_a > 2*PW180X){ if(t1aby2y>2.0*PW180X){ out time(t1aby2x); out pw90X ch1:TG|AP(aX90,0.0); out pw180X ch1:TG|P(90.0); out pw90X ch1:TG|P(0.0); out time(t1aby2x); } else { if (t1_a > 3u){out time(t1_a);} } out time(PW_CS); if(t1bby2y>2.0*PW180X){ out time(t1bby2x) ; out pw90X ch1:TG|AP(aX90,0.0); out pw180X ch1:TG|P(90.0); out pw90X ch1:TG|P(0.0); out time(t1bby2x) ; } else {out time(t1_b);} } else{ out time(t1_a); out pw180Y; out time(t1_b); } ENDDEF DEFINE t1_ct_Y_J_DEC(PW_CS) if(t1aby2y>2.0*PW180Y){ out time(t1aby2y); out pw90Y ch3:TG|AP(aX90,0.0); out pw180Y ch3:TG|P(90.0); out pw90Y ch3:TG|P(0.0); out time(t1aby2y); } if(t1aby2y<=2.0*PW180Y){ if (t1_a > 3u){out time(t1_a);} } out time(PW_CS); if(t1bby2y>2.0*PW180Y){ out time(t1bby2y) ; out pw90Y ch3:TG|AP(aX90,0.0); out pw180Y ch3:TG|P(90.0); out pw90Y ch3:TG|P(0.0); out time(t1bby2y) ; } if(t1bby2y<=2.0*PW180Y){ if (t1_b > 3u){out time(t1_b);} } ENDDEF DEFINE t1_tau_Y_J_DEC(PW_CS) out time(t1_a); out time(PW_CS); out time(t1_a); if(t1LOby2y>2.0*PW180Y){ out time(t1LOby2y) ; out pw90Y ch3:TG|AP(aY90,0.0); out pw180Y ch3:TG|P(90.0); out pw90Y ch3:TG|P(0.0); out time(t1LOby2y) ; } if(t1LOby2y<=2.0*PW180Y){ if (t1LOby2y > 3u){out time(2*t1LOby2y);} } ENDDEF DEFINE t1_CTUC_Y_J_DEC(PW_CS) out time(t1_a); out time(PW_CS); out time(tau1); if(t1cby2y>PW180Y){ out pw90Y ch3:TG|AP(aY90,0.0); out pw180Y ch3:TG|P(90.0); out pw90Y ch3:TG|P(0.0); out time(t1cby2y) ; out time(t1cby2y) ; } if(t1cby2y<=PW180Y){ if (t1cby2y > 3u){out time(2*t1cby2y);} } ENDDEF DEFINE C_XMIX(PHASE) if(Xmix1flag == 0){ out pwXdump ch1:TG|AP(aX90,PHASE); } ENDDEF DEFINE t1_C_XMIX(PHASE) if(Xmix1flag == 1){ out pw90X ch1:TG|AP(aX90,p270+PHASE); out time(ct1) ch1:TG|AP(aXcp1,PHASE); } if(t1by2x CT period!";! ------------------------------------------ ! TIME INCREMENTS. ! ! This Set of subroutines keeps track of evolution times. ! ! CMR Lab...UIUC...Trent Franks...4-22-04 ! ! Updated to be consistent with ants.csh ! ! WTF updated 12-30-04 ! 1. AL start parameters added ! 2. Initial start times are calculated. ! f ! WTF updated 01-05-06 ! 1. Constant time evolution added ! ! WTF updated 051407 ! 1. Constant time with soft pulse, Improved J decoupling. ! ------------------------------------------ include "../includes/t1.inc"; !---- t2 .time extern t2_evol = 100u; .time t2_evol_out = 100u; .time extern t2_evol_max = 100u; .time extern t2_evol_max2= 100u; .time t2_evol_x = 100u; .time cyclerm2 = 1.0u; .time t2by2 = 1.0u; .time t2by2x = 1.0u; .time t2by2y = 1.0u; !---- T2 TPPM Parameters .float t2cycles "no. of TPPM cycles during t2" = 8; .long cyclest2 ; !---- t2 constant time (echo recoupling) .time extern t2_ct = 100u; .time t2_a = 100u; .time t2aby2 = 1.0u; .time t2aby2x = 1.0u; .time t2aby2y = 1.0u; .time t2_b = 100u; .time t2bby2 = 1.0u; .time t2bby2x = 1.0u; .time t2bby2y = 1.0u; .long cyclest2a ; .long cyclest2b ; .time cyclerm2a = 1.0u; .time cyclerm2b = 1.0u; !---- Add to update section (uncomment/adjust variable names) ! .update "t2_evol= dwell - (2.0/3.1415)*offset"; ! .update "t2_evol_max = t2_evol + dwell * (AL - 1)"; ! .update "t2_evol_max2 = dwell * (AL_max)"; DEFINE t2_prog(dwell,AL,ALmax,offset,PW) t2_evol= dwell - (2.0/3.14159) * offset; t2_evol_max = t2_evol + dwell*(AL-1); if(AL(2.0*PW180X+1u)){ t2by2x = t2by2 - PW180X ; ! 2 pi's for composite,1 per half } else{t2by2x=t2by2;} if(t2by2>(2.0*PW180Y+1u)){ t2by2y = t2by2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t2by2y=t2by2;} t2_evol_x = t2_evol_max2 + 10u - t2_evol_out; if(t2_evol_x<3.0u){t2_evol_x=3u;} ENDDEF DEFINE t2_HOMO_DEC_EVOLVE(dwell,ALstart,INDEX,PW_Evol,PW_homodec) t2_evol_out = (t2_evol + (dwell*(INDEX+ALstart-1)))/2.0; cyclest2 = ceil(t2_evol_out/PW_Evol)-1; if (cyclest2 < 0){cyclest2 = 0;} cyclerm2 = t2_evol_out - cyclest2*PW_Evol; if(cyclerm2<1.0u){ cyclest2 = cyclest2 - 1; if (cyclest2 < 0){cyclest2 = 0;} cyclerm2 = t2_evol_out - cyclest2*PW_Evol; } !making sure cyclerm2 isn't too short t2by2 = t2_evol_out; if((t2by2+(PW_homodec/2.0))>(2.0*PW180X+1u )){ t2by2x = t2by2 - PW180X; ! 2 pi's for composite,1 per half } else{t2by2x=t2by2;} if((t2by2+(PW_homodec/2.0))>(2.0*PW180Y+1u )){ t2by2y = t2by2 - PW180Y; ! 2 pi's for composite,1 per half } else{t2by2y=t2by2;} t2_evol_x = t2_evol_max2 + 10u - 2.0*t2_evol_out; if(t2_evol_x<3.0u){t2_evol_x=3u;} ENDDEF DEFINE t2_PROG(dwell,AL,ALmax,PW) t2_prog(dwell,AL,ALmax,PW); ENDDEF DEFINE t2_Y_PI_DEC if(t2by2y1.0u) {out time(PW_homodec);} out pw90Y ch3:TG|AP(aY90, 0.0); out time(PW180Y) ch3:TG|AP(aY90,90.0); out pw90Y ch3:TG|AP(aY90, 0.0); out time(t2by2y); } else{ out time(t2by2); out time(t2by2); } ENDDEF DEFINE t2_N_PI_DEC(pw90Y) if(t2by2y=ALct){t2_ct = pw180CT + (dwell*AL); } t2_evol_out = t2_ct; cyclest2 = floor((t2_ct)/(PW)); cyclest2 = cyclest2 - 1; cyclerm2 = t2_ct - cyclest2*PW2; if(cyclerm2<1.0u){ cyclest2 = cyclest2 - 1; cyclerm2 = t2_evol - cyclest2*PW; } !!! t2_evol_max = t2_evol + dwell*(AL-1); if(AL(2.0*PW180X+1u)){ t2by2x = t2by2 - PW180X ; ! 2 pi's for composite,1 per half } else{t2by2x=t2by2;} if(t2by2>(2.0*PW180Y+1u)){ t2by2y = t2by2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t2by2y=t2by2;} t2_evol_x = t2_evol_max2 + 10u - t2_evol_out; if(t2_evol_x<3.0u){t2_evol_x=3u;} ENDDEF DEFINE t2_ct_tau_prog(dwell,AL,ALct,pw180CS,PW,tau) if(AL< ALct){t2_evol_x = pw180CS + (dwell*ALct);} if(AL>=ALct){t2_evol_x = pw180CS + (dwell*AL); } t2_ct = 2*tau; t2_evol_out = 2*tau; !if(t2_evol_x>t2_evol_out){error(t2outofbounds); cyclest2 = floor((t2_ct)/(PW)); cyclest2 = cyclest2 - 1; cyclerm2 = t2_ct - cyclest2*PW; if(cyclerm2<1.0u){ cyclest2 = cyclest2 - 1; cyclerm2 = t2_evol - cyclest2*PW; } cyclest2a = floor((tau)/(PW)); cyclest2a = cyclest2a - 1; cyclerm2a = tau - cyclest2a*PW; if(cyclerm2a<1.0u){ cyclest2a = cyclest2a - 1; cyclerm2a = tau - cyclest2a*PW; } !!! t2_evol_max = t2_evol + dwell*(AL-1); if(AL(2.0*PW180X+1u)){ t2by2x = t2by2 - PW180X ; ! 2 pi's for composite,1 per half } else{t2by2x=t2by2;} if(t2by2>(2.0*PW180Y+1u)){ t2by2y = t2by2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t2by2y=t2by2;} t2_evol_x = t2_evol_max2 + 10u - t2_evol_out; if(t2_evol_x<3.0u){t2_evol_x=3u;} ENDDEF DEFINE t2_ct_EVOLVE(dwell,ALstart,INDEX,PW180_CS,PW180_J,PW_Evol) t2_a= (t2_ct-PW180_CS) / 2.0 - ((INDEX+ALstart-1) * (dwell / 2.0)); t2_b= (t2_ct-PW180_CS) / 2.0 + ((INDEX+ALstart-1) * (dwell / 2.0)); if (t2_a<1.0u){t2_a=1u;} if (t2_b<1.0u){t2_b=1u;} ! Proton decoupling in each period cyclest2a = ceil(t2_a/PW_Evol)-1; cyclerm2a = t2_a - cyclest2a*PW_Evol; cyclest2b = ceil(t2_b/PW_Evol)-1; cyclerm2b = t2_b - cyclest2b*PW_Evol; if(cyclerm2a<1.0u){ cyclest2a = cyclest2a - 1; cyclerm2a = t2_a - cyclest2a*PW_Evol; } if(cyclerm2b<1.0u){ cyclest2b = cyclest2b - 1; cyclerm2b = t2_b - cyclest2b*PW_Evol; } !making sure cyclerm2(a,b) isn't too short !for heteronuclear J-decoupling !!! t2aby2 = t2_a / 2.0; if(t2aby2>(2.0*PW180X+1u)){ t2aby2x = t2aby2 - PW180X ; ! 2 pi's for composite,1 per half } else{t2aby2x=t2aby2;} if(t2aby2>(2.0*PW180Y+1u)){ t2aby2y = t2aby2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t2aby2y=t2aby2;} !!! t2bby2y = t2bby2x; t2bby2 = t2_b / 2.0; if(t2bby2>(2.0*PW180X+1u)){ t2bby2x = t2bby2 - PW180X ; ! 2 pi's for composite,1 per half } else{t2bby2x=t2bby2;} if(t2bby2>(2.0*PW180Y+1u)){ t2bby2y = t2bby2 - PW180Y ; ! 2 pi's for composite,1 per half } else{t2bby2y=t2bby2;} ENDDEF DEFINE t2_ct_X(pCS) if(t2_a > 1.0u){out time(t2_a);} out pw180X ch1:TG|AP(aX90,pCS); if(t2_b > 1.0u){out time(t2_b);} ENDDEF DEFINE t2_ct_Y(pCS) if(t2_a > 1.0u){out time(t2_a);} out pw180Y ch3:TG|AP(aY90,pCS); if(t2_b > 1.0u){out time(t2_b);} ENDDEF DEFINE t2_ct_X_J_DEC(PW_CS) if( t2_a > 2*PW180X){ if(t2aby2y>2.0*PW180X){ out time(t2aby2x); out pw90X ch1:TG|AP(aX90,0.0); out pw180X ch1:TG|P(90.0); out pw90X ch1:TG|P(0.0); out time(t2aby2x); } else { if (t2_a > 3u){out time(t2_a);} } out time(PW_CS); if(t2bby2y>2.0*PW180X){ out time(t2bby2x) ; out pw90X ch1:TG|AP(aX90,0.0); out pw180X ch1:TG|P(90.0); out pw90X ch1:TG|P(0.0); out time(t2bby2x) ; } else {out time(t2_b);} } else{ out time(t2_a); out pw180Y; out time(t2_b); } ENDDEF DEFINE t2_ct_Y_J_DEC(PW_CS) if(t2aby2y>2.0*PW180Y){ out time(t2aby2y); out pw90Y ch3:TG|AP(aX90,0.0); out pw180Y ch3:TG|P(90.0); out pw90Y ch3:TG|P(0.0); out time(t2aby2y); } if(t2aby2y<=2.0*PW180Y){ if (t2_a > 3u){out time(t2_a);} } out time(PW_CS); if(t2bby2y>2.0*PW180Y){ out time(t2bby2y) ; out pw90Y ch3:TG|AP(aX90,0.0); out pw180Y ch3:TG|P(90.0); out pw90Y ch3:TG|P(0.0); out time(t2bby2y) ; } if(t2bby2y<=2.0*PW180Y){out time(t2_b);} ENDDEF ! ERROR CODES FOR t2.inc define t2outofbounds 0x1454 define OOBt2_ERROR_CODE USER_ERROR_BASE + OOBt2_ERROR comment "ERROR "OOBt2_ERROR_CODE "Maximum t2 greater than constant time period requested!";