Beispiel #1
0
pulsesequence()
{
/* DECLARE VARIABLES */

 char       fsat[MAXSTR],
	    fscuba[MAXSTR],
            f1180[MAXSTR],    /* Flag to start t1 @ halfdwell             */
            f2180[MAXSTR],    /* Flag to start t2 @ halfdwell             */
            C_flg[MAXSTR],
            dtt_flg[MAXSTR];

 int         phase, phase2, ni, ni2, 
             t1_counter,   /* used for states tppi in t1           */ 
             t2_counter;   /* used for states tppi in t2           */ 

 double      tau1,         /*  t1 delay */
             tau2,         /*  t2 delay */
             taua,         /*  ~ 1/4JHC =  1.6 ms */
             taub,         /*    1/6JCH =   1.1 ms  */
             BigTC,        /* Carbon constant time period = 1/4Jcc = 7.0 ms */ 
             BigTC1,       /* Carbon constant time period2 < 1/4Jcc to account for relaxation */ 
             pwN,          /* PW90 for 15N pulse @ pwNlvl           */
             pwC,          /* PW90 for c nucleus @ pwClvl         */
             pwcrb180,      /* PW180 for C 180 reburp @ rfrb */
             pwClvl,        /* power level for 13C pulses on dec1  */
             compC, compH,  /* compression factors for H1 and C13 amps */
	     rfrb,       /* power level for 13C reburp pulse     */
             pwNlvl,       /* high dec2 pwr for 15N hard pulses    */
             sw1,          /* sweep width in f1                    */             
             sw2,          /* sweep width in f2                    */             
             tofps,        /* tof for presat                       */ 

	     gt0,
             gt1,
             gt2,
             gt3,
             gt4,

             gstab,
             gzlvl0,
             gzlvl1,
             gzlvl2,
             gzlvl3,
             gzlvl4,
        
             decstep1,
             bw, ofs, ppm,

             pwd1,
             dpwr3_D,
             pwd,
             tpwrs,
             pwHs, 
             dof_me,
             
             tof_dtt,
             tpwrs1,
             pwHs1,

             dpwrsed,
             pwsed,
             dressed,
              
             rfrb_cg,
             pwrb_cg; 
             
   
/* LOAD VARIABLES */

  getstr("fsat",fsat);
  getstr("f1180",f1180);
  getstr("f2180",f2180);
  getstr("fscuba",fscuba);

  getstr("C_flg",C_flg);
  getstr("dtt_flg",dtt_flg); 

  tofps  = getval("tofps");
  taua   = getval("taua"); 
  taub   = getval("taub"); 
  BigTC  = getval("BigTC");
  BigTC1 = getval("BigTC1");
  pwC = getval("pwC");
  pwcrb180 = getval("pwcrb180");
  pwN = getval("pwN");
  tpwr = getval("tpwr");
  pwClvl = getval("pwClvl");
  compC = getval("compC");
  compH = getval("compH");
  dpwr = getval("dpwr");
  pwNlvl = getval("pwNlvl");
  phase = (int) ( getval("phase") + 0.5);
  phase2 = (int) ( getval("phase2") + 0.5);
  sw1 = getval("sw1");
  sw2 = getval("sw2");
  ni = getval("ni");
  ni2 = getval("ni2");

  gt0 = getval("gt0");
  gt1 = getval("gt1");
  gt2 = getval("gt2");
  gt3 = getval("gt3");
  gt4 = getval("gt4");
 
  gstab = getval("gstab");
  gzlvl0 = getval("gzlvl0");
  gzlvl1 = getval("gzlvl1");
  gzlvl2 = getval("gzlvl2");
  gzlvl3 = getval("gzlvl3");
  gzlvl4 = getval("gzlvl4");
 
  decstep1 = getval("decstep1");

  pwd1 = getval("pwd1");
  dpwr3_D = getval("dpwr3_D");
  pwd = getval("pwd");
  pwHs = getval("pwHs");
  dof_me = getval("dof_me");

  pwHs1 = pwHs; 
  tpwrs=-16.0; tpwrs1=tpwrs;
  tof_dtt = getval("tof_dtt");

  dpwrsed = -16;
  pwsed = 1000.0;
  dressed = 90.0;
  pwrb_cg = 0.0;  
  setautocal();                      /* activate auto-calibration */   

  if(FIRST_FID)                                         /* make shapes */
  {
    ppm = getval("dfrq"); 
    bw = 80.0*ppm;  
    rb180 = pbox_make("rb180P", "reburp", bw, 0.0, compC*pwC, pwClvl);
    bw = 8.125*ppm;  ofs = -24.0*ppm;
    rb180_cg = pbox_make("rb180_cgP", "reburp", bw, ofs, compC*pwC, pwClvl);
    bw = 20.0*ppm;  ofs = 136.0*ppm;
    cosed = pbox("COsedP", CODEC, CODECps, dfrq, compC*pwC, pwClvl);
    if(taua < (gt4+106e-6+pwHs)) printf("gt4 or pwHs may be too long! ");
    if(taub < rb180_cg.pw) printf("rb180_cgP pulse may be too long! ");
  }
  pwcrb180 = rb180.pw;   rfrb = rb180.pwrf;             /* set up parameters */
  pwrb_cg = rb180_cg.pw; rfrb_cg = rb180_cg.pwrf;       /* set up parameters */
  tpwrs = tpwr - 20.0*log10(pwHs/((compH*pw)*1.69));    /* sinc=1.69xrect */
  tpwrs = (int) (tpwrs); tpwrs1=tpwrs;              
  dpwrsed = cosed.pwr; pwsed = 1.0/cosed.dmf; dressed = cosed.dres;

/* LOAD PHASE TABLE */

  settable(t1,2,phi1);
  settable(t2,4,phi2);
  settable(t3,4,phi3);
  settable(t4,4,phi4);
  settable(t5,8,phi5);
  settable(t6,8,phi6);
  settable(t7,8,phi7);
  settable(t8,1,phi8);
  settable(t9,2,rec);

/* CHECK VALIDITY OF PARAMETER RANGES */

    if( BigTC - 0.5*(ni2-1)*1/(sw2) - WFG_STOP_DELAY - POWER_DELAY 
              - 4.0e-6
              < 0.2e-6 )
    {
        printf(" ni2 is too big\n");
        psg_abort(1);
    }


    if((dm[A] == 'y' || dm[B] == 'y' || dm[C] == 'y' ))
    {
        printf("incorrect dec1 decoupler flags!  ");
        psg_abort(1);
    }

    if((dm2[A] == 'y' || dm2[B] == 'y' || dm2[C] == 'y' || dm2[D] == 'y'))
    {
        printf("incorrect dec2 decoupler flags! Should be 'nnnn' ");
        psg_abort(1);
    }

    if( satpwr > 6 )
    {
        printf("SATPWR too large !!!  ");
        psg_abort(1);
    }

    if( dpwr > 48 )
    {
        printf("don't fry the probe, DPWR too large!  ");
        psg_abort(1);
    }

    if( dpwr2 > -16 )
    {
        printf("don't fry the probe, DPWR2 too large!  ");
        psg_abort(1);
    }

    if( pw > 200.0e-6 )
    {
        printf("dont fry the probe, pw too high ! ");
        psg_abort(1);
    } 

    if( pwN > 200.0e-6 )
    {
        printf("dont fry the probe, pwN too high ! ");
        psg_abort(1);
    } 

    if( pwC > 200.0e-6 )
    {
        printf("dont fry the probe, pwC too high ! ");
        psg_abort(1);
    } 

    if( pwcrb180 > 500.0e-6 )
    {  
        printf("dont fry the probe, pwcrb180 too high ! ");
        psg_abort(1);
    } 

    if(dpwr3 > 51)
    {
       printf("dpwr3 is too high; < 52\n");
       psg_abort(1);
    }

    if(dpwr3_D > 49)
    {
       printf("dpwr3_D is too high; < 50\n");
       psg_abort(1);
    }

   if(d1 < 1)
    {
       printf("d1 must be > 1\n");
       psg_abort(1);
    }

   if(dpwrsed > 48)
   {
       printf("dpwrsed must be less than 49\n");
       psg_abort(1);
   }

    if(  gt0 > 5.0e-3 || gt1 > 5.0e-3  || gt2 > 5.0e-3 ||
         gt3 > 5.0e-3 || gt4 > 5.0e-3  )
    {  printf(" all values of gti must be < 5.0e-3\n");
        psg_abort(1);
    }

   if(ix==1) {
     printf("make sure that BigTC1 is set properly for your application\n");
     printf("7 ms, neglecting relaxation \n");
   }

/*  Phase incrementation for hypercomplex 2D data */

    if (phase == 2) {
      tsadd(t1,1,4);
      tsadd(t2,1,4);
      tsadd(t3,1,4);
      tsadd(t4,1,4);
    }

    if (phase2 == 2)
      tsadd(t8,1,4);

/*  Set up f1180  tau1 = t1               */
   
    tau1 = d2;
    tau1 = tau1 - 2.0*pw - 4.0/PI*pwC - POWER_DELAY - 2.0e-6 - PRG_START_DELAY
           - PRG_STOP_DELAY - POWER_DELAY - 2.0e-6;

    if(f1180[A] == 'y') {
        tau1 += ( 1.0 / (2.0*sw1) );
        if(tau1 < 0.4e-6) tau1 = 4.0e-7;
    }
        tau1 = tau1/2.0;

/*  Set up f2180  tau2 = t2               */

    tau2 = d3;
    if(f2180[A] == 'y') {
        tau2 += ( 1.0 / (2.0*sw2) ); 
        if(tau2 < 0.4e-6) tau2 = 4.0e-7;
    }
        tau2 = tau2/2.0;

/* Calculate modifications to phases for States-TPPI acquisition          */

   if( ix == 1) d2_init = d2 ;
   t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 );
   if(t1_counter % 2) {
      tsadd(t1,2,4);     
      tsadd(t9,2,4);    
    }

   if( ix == 1) d3_init = d3 ;
   t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );
   if(t2_counter % 2) {
      tsadd(t8,2,4);  
      tsadd(t9,2,4);    
    }

/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   obspower(satpwr);      /* Set transmitter power for 1H presaturation */
   decpower(pwClvl);        /* Set Dec1 power for hard 13C pulses         */
   dec2power(pwNlvl);      /* Set Dec2 to low power       */

/* Presaturation Period */

status(B);
   if (fsat[0] == 'y')
   {
        obsoffset(tofps);
	delay(2.0e-5);
        rgpulse(d1,zero,2.0e-6,2.0e-6);  /* presat with transmitter */
   	obspower(tpwr);      /* Set transmitter power for hard 1H pulses */
	delay(2.0e-5);
	if(fscuba[0] == 'y')
	{
		delay(2.2e-2);
		rgpulse(pw,zero,2.0e-6,0.0);
		rgpulse(2.0*pw,one,2.0e-6,0.0);
		rgpulse(pw,zero,2.0e-6,0.0);
		delay(2.2e-2);
	}
   }
   else
   {
    delay(d1);
   }
   obspower(tpwr);           /* Set transmitter power for hard 1H pulses */
   obsoffset(tof);
   txphase(t1);
   decphase(zero);
   dec2phase(zero);
   delay(1.0e-5);

/* Begin Pulses */

status(C);

   decoffset(dof_me);

   lk_hold();

   rcvroff();
   delay(20.0e-6);

/* ensure that magnetization originates on 1H and not 13C */

   if(dtt_flg[A] == 'y') {
     obsoffset(tof_dtt);
     obspower(tpwrs1);
     shaped_pulse("H2Osinc",pwHs1,zero,10.0e-6,0.0);
     obspower(tpwr);

     obsoffset(tof); 
   }
 
   decrgpulse(pwC,zero,0.0,0.0);
 
   zgradpulse(gzlvl0,gt0);
   delay(gstab);

   rgpulse(pw,zero,0.0,0.0);                    /* 90 deg 1H pulse */

   zgradpulse(gzlvl1,gt1);
   delay(gstab);

   delay(taua - gt1 -gstab); 

   simpulse(2.0*pw,2.0*pwC,zero,zero,0.0,0.0);
   txphase(one);

   delay(taua - gt1 - gstab); 
   	
   zgradpulse(gzlvl1,gt1);
   delay(gstab);


   rgpulse(pw,one,0.0,0.0);

   /* shaped_pulse */
   obspower(tpwrs);
   shaped_pulse("H2Osinc",pwHs,zero,2.0e-6,0.0);
   obspower(tpwr);
   /* shaped_pulse */

   decoffset(dof);  /* jump 13C to 40 ppm */

   zgradpulse(gzlvl2,gt2);
   delay(gstab);

   decrgpulse(pwC,t1,4.0e-6,0.0); decphase(zero); 

   initval(1.0,v3);
   decstepsize(decstep1);
   dcplrphase(v3);

   decpwrf(rfrb);
   delay(BigTC - POWER_DELAY - WFG_START_DELAY);

   decshaped_pulse(rb180.name,pwcrb180,zero,0.0,0.0);
   dcplrphase(zero);
   decphase(t2);

   decpwrf(4095.0);
   delay(BigTC - WFG_STOP_DELAY - POWER_DELAY);

   decrgpulse(pwC,t2,0.0,0.0);
   decphase(zero);

   /* turn on 2H decoupling */
   dec3phase(one);
   dec3power(dpwr3); 
   dec3rgpulse(pwd1,one,4.0e-6,0.0); 
   dec3phase(zero);
   dec3unblank();
   dec3power(dpwr3_D);
   dec3prgon(dseq3,pwd,dres3);
   dec3on();
   /* turn on 2H decoupling */

   initval(1.0,v3);
   decstepsize(decstep1);
   dcplrphase(v3);

   decpwrf(rfrb);

   delay(BigTC1 - POWER_DELAY - 4.0e-6 - pwd1
         - POWER_DELAY - PRG_START_DELAY - POWER_DELAY - WFG_START_DELAY);

   decshaped_pulse(rb180.name,pwcrb180,zero,0.0,0.0);
   dcplrphase(zero);
   decphase(t3);

   decpwrf(4095.0);
   delay(BigTC1 - WFG_STOP_DELAY - POWER_DELAY);

   decrgpulse(pwC,t3,0.0,0.0);
   decpwrf(rfrb_cg); decphase(zero);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - POWER_DELAY - WFG_START_DELAY);
   decshaped_pulse(rb180_cg.name,pwrb_cg,zero,0.0,0.0);
   decpwrf(rfrb);
   
   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - WFG_STOP_DELAY - POWER_DELAY - SAPS_DELAY
         - 2.0e-6 - WFG_START_DELAY);

   initval(1.0,v3);
   decstepsize(decstep1);
   dcplrphase(v3);

   decshaped_pulse(rb180.name,pwcrb180,zero,2.0e-6,0.0);
   dcplrphase(zero);

   decpwrf(rfrb_cg); decphase(zero);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - WFG_STOP_DELAY - SAPS_DELAY 
                  - POWER_DELAY - WFG_START_DELAY);

   decshaped_pulse(rb180_cg.name,pwrb_cg,zero,0.0,0.0);
   decpwrf(4095.0); decphase(t4);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - WFG_STOP_DELAY - POWER_DELAY);

   decrgpulse(pwC,t4,0.0,0.0);

   if(C_flg[A] == 'n') {

   decpower(dpwrsed); decunblank(); decphase(zero); delay(2.0e-6);
   decprgon(cosed.name,pwsed,dressed);
   decon();
  
   delay(tau1);
   rgpulse(2.0*pw,zero,0.0,0.0);
   delay(tau1);

   decoff();
   decprgoff();
   decblank();
   decpower(pwClvl);
   }

   else 
    simpulse(2.0*pw,2.0*pwC,zero,zero,4.0e-6,4.0e-6);

   decrgpulse(pwC,t5,2.0e-6,0.0);
   decpwrf(rfrb_cg); decphase(zero);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - POWER_DELAY - WFG_START_DELAY);
   decshaped_pulse(rb180_cg.name,pwrb_cg,zero,0.0,0.0);
   decpwrf(rfrb);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - WFG_STOP_DELAY - POWER_DELAY - SAPS_DELAY
         - 2.0e-6 - WFG_START_DELAY);

   initval(1.0,v3);
   decstepsize(decstep1);
   dcplrphase(v3);

   decshaped_pulse(rb180.name,pwcrb180,zero,2.0e-6,0.0);
   dcplrphase(zero);

   decpwrf(rfrb_cg); decphase(zero);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - WFG_STOP_DELAY - SAPS_DELAY 
                  - POWER_DELAY - WFG_START_DELAY);

   decshaped_pulse(rb180_cg.name,pwrb_cg,zero,0.0,0.0);
   decpwrf(4095.0); decphase(t6);

   if(taub > pwrb_cg)
     delay(taub/2.0 - pwrb_cg/2.0 - WFG_STOP_DELAY - POWER_DELAY);

   decrgpulse(pwC,t6,0.0,0.0);
   decphase(zero);

   initval(1.0,v3);
   decstepsize(decstep1);
   dcplrphase(v3);

   decpwrf(rfrb);
   delay(BigTC1 - POWER_DELAY - WFG_START_DELAY);

   decshaped_pulse(rb180.name,pwcrb180,zero,0.0,0.0);
   dcplrphase(zero);
   decphase(t7);

   decpwrf(4095.0);
   delay(BigTC1 - WFG_STOP_DELAY - POWER_DELAY
          - PRG_STOP_DELAY - POWER_DELAY - 4.0e-6 - pwd1);

   /* 2H decoupling off */
   dec3off();
   dec3prgoff();
   dec3blank();
   dec3power(dpwr3);
   dec3rgpulse(pwd1,three,4.0e-6,0.0);
   /* 2H decoupling off */

   decrgpulse(pwC,t7,0.0,0.0);
   decphase(zero);

   delay(tau2);
   rgpulse(2.0*pw,zero,0.0,0.0);

   initval(1.0,v3);
   decstepsize(decstep1);
   dcplrphase(v3);

   decpwrf(rfrb);
   delay(BigTC - 2.0*pw - POWER_DELAY - WFG_START_DELAY);

   decshaped_pulse(rb180.name,pwcrb180,zero,0.0,0.0);
   dcplrphase(zero);
   decphase(t8);
   decpwrf(4095.0);

   delay(BigTC - tau2 - WFG_STOP_DELAY - POWER_DELAY - 4.0e-6);

   decrgpulse(pwC,t8,4.0e-6,0.0);


   decoffset(dof_me);

   zgradpulse(gzlvl3,gt3);
   delay(gstab);

   lk_sample();

   /* shaped_pulse */
   obspower(tpwrs);
   shaped_pulse("H2Osinc",pwHs,two,2.0e-6,0.0);
   obspower(tpwr);
   /* shaped_pulse */

   rgpulse(pw,zero,4.0e-6,0.0);

   zgradpulse(gzlvl4,gt4);
   delay(gstab);

   delay(taua - gt4 -gstab 
         - POWER_DELAY - 2.0e-6 - WFG_START_DELAY
         - pwHs - WFG_STOP_DELAY - POWER_DELAY - 2.0e-6);

   /* shaped_pulse */
   obspower(tpwrs);
   shaped_pulse("H2Osinc",pwHs,two,2.0e-6,0.0);
   obspower(tpwr);
   /* shaped_pulse */

   simpulse(2.0*pw,2.0*pwC,zero,zero,2.0e-6,0.0);

   /* shaped_pulse */
   obspower(tpwrs);
   shaped_pulse("H2Osinc",pwHs,two,2.0e-6,0.0);
   obspower(tpwr);
   /* shaped_pulse */

   zgradpulse(gzlvl4,gt4);
   delay(gstab);
 
   delay(taua - POWER_DELAY - WFG_START_DELAY
         - pwHs - WFG_STOP_DELAY - POWER_DELAY 
         - gt4 - gstab - 2.0*POWER_DELAY);

   decpower(dpwr);  /* Set power for decoupling */
   dec2power(dpwr2);

/*   rcvron();  */          /* Turn on receiver to warm up before acq */ 

/* BEGIN ACQUISITION */

status(D);
   setreceiver(t9);

}
Beispiel #2
0
pulsesequence()
{



/* DECLARE AND LOAD VARIABLES */

char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
	    rna_stCdec[MAXSTR],	       /* calls STUD+ waveforms from shapelib */
	    STUD[MAXSTR];   /* apply automatically calculated STUD decoupling */
 
int         icosel1,          			  /* used to get n and p type */
	    icosel2,
            t1_counter,  		        /* used for states tppi in t1 */
            t2_counter,  	 	        /* used for states tppi in t2 */
	    ni2 = getval("ni2");

double      tau1,         				         /*  t1 delay */
            tau2,        				         /*  t2 delay */
	    del = getval("del"),     /* time delays for CH coupling evolution */
	    del1 = getval("del1"),
	    del2 = getval("del2"),
/* STUD+ waveforms automatically calculated by macro "rnacal" */
/* and string parameter rna_stCdec calls them from your shapelib.*/
   stdmf,                              		   /* dmf for STUD decoupling */
   studlvl,	                         /* coarse power for STUD+ decoupling */
   rf80 = getval("rf80"), 			  /* rf in Hz for 80ppm STUD+ */

	pwClvl = getval("pwClvl"), 	        /* coarse power for C13 pulse */
        pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */
	rfC,            	  /* maximum fine power when using pwC pulses */
	dofa,                             /* dof shifted to 80 ppm for ribose */

/* p_d is used to calculate the isotropic mixing on the Cab region */
        p_d,                   	        /* 50 degree pulse for DIPSI-3 at rfd */
        rfd,                   			     /* fine power for 35 ppm */
	ncyc = getval("ncyc"), 			  /* no. of cycles of DIPSI-3 */

   compC = getval("compC"),       /* adjustment for C13 amplifier compression */


	pwNlvl = getval("pwNlvl"),	              /* power for N15 pulses */
        pwN = getval("pwN"),          /* N15 90 degree pulse length at pwNlvl */

	sw1 = getval("sw1"),
	sw2 = getval("sw2"),

 grecov = getval("grecov"),   /* Gradient recovery delay, typically 150-200us */

	gt1 = getval("gt1"),  		       /* coherence pathway gradients */
	gzlvl1 = getval("gzlvl1"),
	gzlvl2 = getval("gzlvl2"),

	gt3 = getval("gt3"),				   /* other gradients */
	gt5 = getval("gt5"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl4 = getval("gzlvl4"),
	gzlvl5 = getval("gzlvl5"),
	gzlvl6 = getval("gzlvl6");

    getstr("STUD",STUD);
    getstr("f1180",f1180);
    getstr("f2180",f2180);

/*   LOAD PHASE TABLE    */

	settable(t3,2,phi3);
	settable(t6,1,phi6);
	settable(t5,4,phi5);
	settable(t10,1,phi10);
	settable(t11,4,rec);

        

/*   INITIALIZE VARIABLES   */

    if( dpwrf < 4095 )
	{ text_error("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
	  psg_abort(1); }

/* maximum fine power for pwC pulses */
	rfC = 4095.0;

/*  Center dof in RIBOSE region on 80 ppm. */
        dofa = dof - 30.0*dfrq;
		
/* dipsi-3 decoupling C-ribose */
 	p_d = (5.0)/(9.0*4.0*7000.0*(sfrq/800.0)); /* DIPSI-3 covers 35 ppm */
 	rfd = (compC*4095.0*pwC*5.0)/(p_d*9.0);
	rfd = (int) (rfd + 0.5);
  	ncyc = (int) (ncyc + 0.5);

/* 80 ppm STUD+ decoupling */
        strcpy(rna_stCdec, "wurst80");
	stdmf = getval("dmf80");
        studlvl = pwClvl + 20.0*log10(compC*pwC*4.0*rf80);
        studlvl = (int) (studlvl + 0.5);


/* CHECK VALIDITY OF PARAMETER RANGES */

  if( gt1 > 0.5*del - 0.5*grecov )
  { text_error(" gt1 is too big. Make gt1 less than %f.\n", (0.5*del - 0.5*grecov)); psg_abort(1);}

  if((dm3[A] == 'y' || dm3[C] == 'y' ))
  { text_error("incorrect dec1 decoupler flags! Should be 'nyn' or 'nnn' "); psg_abort(1); }

  if((dm2[A] == 'y' || dm2[B] == 'y'))
  { text_error("incorrect dec2 decoupler flags! Should be 'nnn' or 'nny' "); psg_abort(1); }

  if((dm[A] == 'y' || dm[B] == 'y'))
  { text_error("incorrect dec1 decoupler flags! Should be 'nny' "); psg_abort(1); }

  if( (((dm[C] == 'y') && (dm2[C] == 'y')) && (STUD[A] == 'y')) )
  { text_error("incorrect dec2 decoupler flags! Should be 'nnn' if STUD='y'"); psg_abort(1); }

  if( dpwr > 50 )
  { text_error("don't fry the probe, DPWR too large!  "); psg_abort(1); }

  if( dpwr2 > 50 )
  { text_error("don't fry the probe, DPWR2 too large!  "); psg_abort(1); }

  if( (pw > 20.0e-6) && (tpwr > 56) )
  { text_error("don't fry the probe, pw too high ! "); psg_abort(1); }

  if( (pwC > 40.0e-6) && (pwClvl > 56) )
  { text_error("don't fry the probe, pwN too high ! "); psg_abort(1); }

  if( (pwN > 100.0e-6) && (pwNlvl > 56) )
  { text_error("don't fry the probe, pwN too high ! "); psg_abort(1); }

  if ((dm3[B] == 'y'  &&   dpwr3 > 44 ))
  { text_error ("Deuterium decoupling power too high ! "); psg_abort(1); }

  if ((ncyc > 1 ) && (ix == 1))
  { text_error("mixing time is %f ms.\n",(ncyc*97.8*4*p_d)); }


/* PHASES AND INCREMENTED TIMES */

/*  Phase incrementation for hypercomplex 2D data, States-Haberkorn element */

    icosel1 = -1;  icosel2 = -1;
    if (phase1 == 2) 
	{ tsadd(t6,2,4); icosel1 = -1*icosel1; }
    if (phase2 == 2) 
	{ tsadd(t10,2,4); icosel2 = -1*icosel2; tsadd(t6,2,4); }


/*  Set up f1180  */
   
    tau1 = d2;
    if((f1180[A] == 'y') && (ni > 1.0)) 
	{ tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; }
    tau1 = tau1/2.0;


/*  Set up f2180  */

    tau2 = d3;
    if((f2180[A] == 'y') && (ni2 > 1.0)) 
	{ tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; }
    tau2 = tau2/2.0;



/* Calculate modifications to phases for States-TPPI acquisition          */

   if( ix == 1) d2_init = d2;
   t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 );
   if(t1_counter % 2) 
	{ tsadd(t3,2,4); tsadd(t11,2,4); }

   if( ix == 1) d3_init = d3;
   t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );
   if(t2_counter % 2) 
	{ tsadd(t5,2,4); tsadd(t11,2,4); }



/*   BEGIN PULSE SEQUENCE   */

status(A);
 if (dm3[B]=='y') lk_sample();
   	delay(d1);
 if (dm3[B]=='y') lk_hold();

	rcvroff();
	obspower(tpwr);
	decpower(pwClvl);
 	dec2power(pwNlvl);
	decpwrf(rfC);
	obsoffset(tof);
        decoffset(dofa);
        dec2offset(dof2);
	txphase(t3);
	delay(1.0e-5);

	decrgpulse(pwC, zero, 0.0, 0.0);	   /*destroy C13 magnetization*/
	zgradpulse(gzlvl1, 0.5e-3);
	delay(grecov/2);
	decrgpulse(pwC, one, 0.0, 0.0);
	zgradpulse(0.7*gzlvl1, 0.5e-3);
	delay(5.0e-4);

   if(dm3[B] == 'y')				  /*optional 2H decoupling on */
        { 
          dec3unblank();
          dec3rgpulse(1/dmf3, one, 0.0, 0.0); 
          dec3unblank();
          setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
         } 
	rgpulse(pw, t3, 0.0, 0.0);                    /* 1H pulse excitation */

        decphase(zero);
	delay(0.5*del + tau1 - 2.0*pwC);

        decrgpulse(2.0*pwC, zero, 0.0, 0.0);

        txphase(zero);
	delay(tau1);

	rgpulse(2.0*pw, zero, 0.0, 0.0);

	zgradpulse(icosel1*gzlvl1, 0.1*gt1);
        decphase(t5);
	delay(0.5*del - 0.1*gt1);

	simpulse(pw, pwC, zero, t5, 0.0, 0.0);

	zgradpulse(gzlvl3, gt3);
        decphase(zero);
	delay(0.5*del2 - gt3);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl3, gt3);
        txphase(t6);
        decphase(one);
	delay(0.5*del2 - gt3);

	simpulse(pw, pwC, t6, one, 0.0, 0.0);

	zgradpulse(gzlvl4, gt3);
        txphase(zero);
        decphase(zero);
	delay(0.5*del1 - gt3);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl4, gt3);
	delay(0.5*del1 - gt3);

	decrgpulse(pwC, zero, 0.0, 0.0);
	decpwrf(rfd);
	delay(2.0e-6);
	initval(ncyc, v2);
	starthardloop(v2);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
     decrgpulse(5.0*p_d,zero,0.0,0.0);
     decrgpulse(5.5*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.6*p_d,two,0.0,0.0);
     decrgpulse(7.2*p_d,zero,0.0,0.0);
     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.4*p_d,zero,0.0,0.0);
     decrgpulse(6.8*p_d,two,0.0,0.0);
     decrgpulse(7.0*p_d,zero,0.0,0.0);
     decrgpulse(5.2*p_d,two,0.0,0.0);
     decrgpulse(5.4*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.5*p_d,zero,0.0,0.0);
     decrgpulse(7.3*p_d,two,0.0,0.0);
     decrgpulse(5.1*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);

     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);
     decrgpulse(5.0*p_d,two,0.0,0.0);
     decrgpulse(5.5*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.6*p_d,zero,0.0,0.0);
     decrgpulse(7.2*p_d,two,0.0,0.0);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.4*p_d,two,0.0,0.0);
     decrgpulse(6.8*p_d,zero,0.0,0.0);
     decrgpulse(7.0*p_d,two,0.0,0.0);
     decrgpulse(5.2*p_d,zero,0.0,0.0);
     decrgpulse(5.4*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.5*p_d,two,0.0,0.0);
     decrgpulse(7.3*p_d,zero,0.0,0.0);
     decrgpulse(5.1*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);

     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);
     decrgpulse(5.0*p_d,two,0.0,0.0);
     decrgpulse(5.5*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.6*p_d,zero,0.0,0.0);
     decrgpulse(7.2*p_d,two,0.0,0.0);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.4*p_d,two,0.0,0.0);
     decrgpulse(6.8*p_d,zero,0.0,0.0);
     decrgpulse(7.0*p_d,two,0.0,0.0);
     decrgpulse(5.2*p_d,zero,0.0,0.0);
     decrgpulse(5.4*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.5*p_d,two,0.0,0.0);
     decrgpulse(7.3*p_d,zero,0.0,0.0);
     decrgpulse(5.1*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);

     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
     decrgpulse(5.0*p_d,zero,0.0,0.0);
     decrgpulse(5.5*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.6*p_d,two,0.0,0.0);
     decrgpulse(7.2*p_d,zero,0.0,0.0);
     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.4*p_d,zero,0.0,0.0);
     decrgpulse(6.8*p_d,two,0.0,0.0);
     decrgpulse(7.0*p_d,zero,0.0,0.0);
     decrgpulse(5.2*p_d,two,0.0,0.0);
     decrgpulse(5.4*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.5*p_d,zero,0.0,0.0);
     decrgpulse(7.3*p_d,two,0.0,0.0);
     decrgpulse(5.1*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
	endhardloop();

        dec2phase(zero);
        decphase(zero);
        txphase(zero);
	decpwrf(rfC);
	delay(tau2);

	sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);

	delay(tau2);
	decpwrf(rfC);
	zgradpulse(-icosel2*gzlvl2, 1.8*gt1);
	delay(grecov+2.0e-6);

	decrgpulse(2.0*pwC, zero, 0.0, 0.0);

	decpwrf(rfC);
	zgradpulse(icosel2*gzlvl2, 1.8*gt1);
	delay(grecov + pwN);

	decrgpulse(pwC, zero, 0.0, 0.0);
	decpwrf(rfC);
	decrgpulse(pwC, zero, 2.0e-6, 0.0);

	zgradpulse(gzlvl5, gt5);
	delay(0.5*del1 - gt5);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl5, gt5);
	txphase(one);
	decphase(t10);
	delay(0.5*del1 - gt5);

	simpulse(pw, pwC, one, t10, 0.0, 0.0);

	zgradpulse(gzlvl6, gt5);
	txphase(zero);
	decphase(zero);
	delay(0.5*del2 - gt5);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl6, gt5);
	delay(0.5*del2 - gt5);

	simpulse(pw, pwC, zero, zero, 0.0, 0.0);

	delay(0.5*del - 0.5*pwC);

	simpulse(2.0*pw,2.0*pwC, zero, zero, 0.0, 0.0);
   if (STUD[A]=='y') decpower(studlvl);

   else
    {
	decpower(dpwr);
	dec2power(dpwr2);
    }
	zgradpulse(gzlvl1, gt1);         		/* 2.0*GRADIENT_DELAY */
   if(dm3[B] == 'y') 
	delay(0.5*del - gt1 -1/dmf3 - 2.0*GRADIENT_DELAY - POWER_DELAY);
      else
	delay(0.5*del - gt1 - 2.0*GRADIENT_DELAY - POWER_DELAY);
   if(dm3[B] == 'y')			         /*optional 2H decoupling off */
        {
          dec3rgpulse(1/dmf3, three, 0.0, 0.0); dec3blank();
          setstatus(DEC3ch, FALSE, 'w', FALSE, dmf3);
          dec3blank();
        }
	decpower(dpwr);				               /* POWER_DELAY */
  if (dm3[B]=='y') lk_sample();
  if ((STUD[A]=='y') && (dm[C] == 'y'))
        {decpower(studlvl);
         decunblank();
         decon();
         decprgon(rna_stCdec,1/stdmf, 1.0);
         startacq(alfa);
         acquire(np, 1.0/sw);
         decprgoff();
         decoff();
         decblank();
        }
      else
	 status(C);
 setreceiver(t11);
}		 
Beispiel #3
0
void pulsesequence() {

//======================================================
// Define Variables and Objects and Get Parameter Values
//======================================================

// --------------------------------
// Acquisition Decoupling
// -------------------------------

   char Xseq[MAXSTR];
   getstr("Xseq",Xseq);
   DSEQ dec = getdseq("X");
   strncpy(dec.t.ch,"dec",3);
   putCmd("chXtppm='dec'\n");
   strncpy(dec.s.ch,"dec",3);
   putCmd("chXspinal='dec'\n");

//-------------------------------------
// Homonuclear Decoupling During Echo
//-------------------------------------

   MPDEC homo1 = getmpdec("hdec1H",0,0.0,0.0,0,1);
   strncpy(homo1.mps.ch,"obs",3);
   putCmd("chHhdec1='obs'\n"); 

// --------------------
// H echo calculation
// --------------------

   double t1Hecho = getval("t1Hecho") - getval("pwHecho")/2.0 - 
                    ((!strcmp(homo1.dm,"y"))?getval("pwHshort1")*2.:0.0);
   if (t1Hecho < 0.0) t1Hecho = 0.0;
   double t2Hecho = getval("t2Hecho") - getval("pwHecho")/2.0 - 
                    ((!strcmp(homo1.dm,"y"))?getval("pwHshort1")*2.:0.0) - 
                    getval("rd")- getval("ad");
   if (t2Hecho < 0.0) t2Hecho = 0.0;
 

   double t1H_echo = 0.0; 
   double t2H_echo = 0.0;
   double t1H_left = 0.0; 
   double t2H_left = 0.0;
   if (!strcmp(homo1.dm,"y")) {
      t2H_echo = homo1.mps.t*((int)(t2Hecho/homo1.mps.t));
      t2H_left = t2Hecho - t2H_echo;
      t1H_echo = t2H_echo;
      t1H_left = t1Hecho - t1H_echo;
   }

//--------------------------------------
// Copy Current Parameters to Processed
//-------------------------------------

   putCmd("groupcopy('current','processed','acquisition')");

//----------------------
// Dutycycle Protection
//----------------------

   DUTY d = init_dutycycle();
   d.dutyon = getval("pwH90");
   d.dutyoff = d1 + 4.0e-6;
   if (!strcmp(homo1.dm,"y"))
     d.dutyon += t1H_echo + t2H_echo;
   else
     d.dutyoff += t1H_echo + t2H_echo;
   d.c1 = d.c1 + (!strcmp(Xseq,"tppm"));
   d.c1 = d.c1 + ((!strcmp(Xseq,"tppm")) && (dec.t.a > 0.0));
   d.t1 = getval("rd") + getval("ad") + at;
   d.c2 = d.c2 + (!strcmp(Xseq,"spinal"));
   d.c2 = d.c2 + ((!strcmp(Xseq,"spinal")) && (dec.s.a > 0.0));
   d.t2 = getval("rd") + getval("ad") + at;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

//------------------------
// Set Phase Tables
//-----------------------

   settable(phH90,4,table1);    
   settable(phHecho,8,table2);
   settable(phRec,4,table3);
   setreceiver(phRec);

//=======================    
// Begin Sequence
//=======================

   txphase(phH90); decphase(zero);
   obspwrf(getval("aH90")); 
   obsunblank(); decunblank(); _unblank34();
   delay(d1);  
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

//------------------------  
// H Direct Polarization 
//------------------------
  
   rgpulse(getval("pwH90"),phH90,0.0,0.0);
   obsunblank(); decunblank(); _unblank34();

// -----------------------------
// H Hahn Echo
// -----------------------------

   if (!strcmp(homo1.dm,"y")) {
      delay (t1H_left);
      if (getval("pwHshort1") > 0.0 ) {
         obspwrf(getval("aHhdec1"));
         rgpulse(getval("pwHshort1"),three,0.0,0.0);  
         obsunblank();
      }
      if (!strcmp(homo1.dm,"y")) _mpseqon(homo1.mps,zero);
      delay(t1H_echo);
      if (!strcmp(homo1.dm,"y")) _mpseqoff(homo1.mps);

      if (getval("pwHshort1") > 0.0 ) {
         obspwrf(getval("aHhdec1")); txphase(one);
         rgpulse(getval("pwHshort1"),one,0.0,0.0);  
         obsunblank();
      }
   }
   else delay(t1Hecho);
   txphase(phHecho);
   obspwrf(getval("aHecho"));
   rgpulse(getval("pwHecho"),phHecho,0.0,0.0);
   obsunblank();

   if (!strcmp(homo1.dm,"y")) {
      if (getval("pwHshort1") > 0.0 ) {
         obspwrf(getval("aHhdec1"));
         rgpulse(getval("pwHshort1"),three,0.0,0.0);  
         obsunblank();
      }
      if (!strcmp(homo1.dm,"y")) _mpseqon(homo1.mps,zero);
      delay(t2H_echo);
      if (!strcmp(homo1.dm,"y")) _mpseqoff(homo1.mps);

      if(getval("pwHshort1")>0 )  {
         obspwrf(getval("aHhdec1"));
         rgpulse(getval("pwHshort1"),one,0.0,0.0);  
         obsunblank();
      }
      delay(t2H_left);
   }
   else delay(t2Hecho);


//====================
// Begin Acquisition 
//====================

   _dseqon(dec);    
   obsblank(); decblank(); _blank34();
   delay(getval("rd"));  
   startacq(getval("ad"));
   acquire(np, 1/sw);
   endacq();
   _dseqoff(dec); 
   obsunblank(); decunblank(); _unblank34();
}
Beispiel #4
0
void pulsesequence()
{
   char    c1d[MAXSTR];               /* option to record only 1D C13 spectrum */
   int     ncyc;
   double  tau1 = 0.002,         			          /*  t1 delay */
           post_del = 0.0,
           pwClvl = getval("pwClvl"), 	  /* coarse power for C13 pulse */
           pwC = getval("pwC"),     	  /* C13 90 degree pulse length at pwClvl */
	   compC = getval("compC"),
	   compH = getval("compH"),
	   mixpwr = getval("mixpwr"),
	   jCH = getval("jCH"),
	   gt0 = getval("gt0"),  		       
	   gt1 = getval("gt1"),  		       
	   gt2 = getval("gt2"),  		       
	   gzlvl0 = getval("gzlvl0"),
	   gzlvl1 = getval("gzlvl1"),
	   gzlvl2 = getval("gzlvl2"),
	   grec = getval("grec"),
	   phase = getval("phase");

           getstr("c1d",c1d);
	   
           ncyc=1;
           if(jCH > 0.0)
             tau1 = 0.25/jCH;

           dbl(ct, v1);                     /* v1 = 0 */
           mod4(v1,oph);
           hlv(ct,v2);
           add(v2,v1,v2);
           if (phase > 1.5)
             incr(v1);                      /* hypercomplex phase increment */           

           initval(2.0*(double)((int)(d2*getval("sw1")+0.5)%2),v10); 
           add(v1,v10,v1);
           add(oph,v10,oph);
           mod4(v1,v1);  mod4(v2,v2); mod4(oph,oph); 
           assign(zero,v3);

           if(FIRST_FID) 
	   {
	     HHmix = pbox_mix("HHmix", "DIPSI2", mixpwr, pw*compH, tpwr);  
	     if(c1d[A] == 'n')
	     {
	       opx("CHdec"); setwave("WURST2 30k/1.2m"); pbox_par("steps","600"); cpx(pwC*compC, pwClvl);
	       CHdec = getDsh("CHdec");
	     }
	   }
	   ncyc = (int) (at/HHmix.pw) + 1;
	   post_del = ncyc*HHmix.pw - at;
	            
             
/* BEGIN PULSE SEQUENCE */

      status(A);

	zgradpulse(gzlvl0, gt0);
	rgpulse(pw, zero, 0.0, 0.0);  /* destroy H-1 magnetization*/
	zgradpulse(gzlvl0, gt0);
	delay(1.0e-4);
	obspower(tpwr);
	txphase(v1);
        decphase(zero);
        dec2phase(zero);

        presat();
	obspower(tpwr);
        	
	delay(1.0e-5);

      status(B);

        if(c1d[A] == 'y')
	{
   	  rgpulse(pw,v1,0.0,0.0);                 /* 1H pulse excitation */
          delay(d2);
   	  rgpulse(pw,two,0.0,0.0);                 /* 1H pulse excitation */
          assign(oph,v3);
	}
	else
	{
          decunblank(); pbox_decon(&CHdec);

   	  rgpulse(pw,v1,0.0,0.0);                 /* 1H pulse excitation */
   	  txphase(zero);
   	
          delay(d2);

          pbox_decoff(); decblank();  
          decpower(pwClvl); decpwrf(4095.0);
   	  
	  delay(tau1 - POWER_DELAY);
          simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);
          txphase(one); decphase(one); dec2phase(one);
	  delay(tau1);
          simpulse(pw, pwC, one, one, 0.0, 0.0);
          txphase(zero); decphase(zero); dec2phase(zero);
	  delay(tau1);
          simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);
	  delay(tau1);
          simpulse(0.0, pwC, zero, zero, 0.0, 0.0);
        }
	zgradpulse(gzlvl1, gt1);
   	delay(grec);
        simpulse(0.0, pwC, zero, v3, 0.0, rof2);
        
        txphase(v2);
        obsunblank(); pbox_xmtron(&HHmix);  

      status(C);
      
        setactivercvrs("ny");
        startacq(alfa);
        acquire(np,1.0/sw);
        endacq();
        
	delay(post_del);
        pbox_xmtroff(); obsblank();
        zgradpulse(gzlvl2, gt2);
        obspower(tpwr);
   	delay(grec);
   	rgpulse(pw,zero,0.0,rof2);                 /* 1H pulse excitation */
   	        
      status(D);
      
        setactivercvrs("yn");
        startacq(alfa);
        acquire(np,1.0/sw);
        endacq();

}		 
Beispiel #5
0
void pulsesequence() {

// Set the Maximum Dynamic Table Number

   settablenumber(10);
   setvvarnumber(30);

// Define Variables and Objects and Get Parameter Values

   WMPA xx = getxx("xxX");
   strncpy(xx.ch,"obs",3);
   putCmd("chXxx='obs'\n");

//--------------------------------------
// Copy Current Parameters to Processed
//-------------------------------------

   putCmd("groupcopy('current','processed','acquisition')");

// Dutycycle Protection
   DUTY d = init_dutycycle();
   d.dutyon = getval("pwXprep") + 2.0*xx.cycles*xx.pw;
   d.dutyoff = d1 + 4.0e-6 + 5.0e-6 + xx.r1 + xx.r2 + 
               at - 2.0*xx.cycles*xx.pw;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   settable(phXprep,4,table1);
   settable(phXxx,4,table2);
   settable(phRec,4,table3);
   setreceiver(phRec);

// Set the Small-Angle Prep Phase

   double obsstep = 360.0/(PSD*8192);
   obsstepsize(obsstep);
   int phfXprep = initphase(getval("phXprep"), obsstep);     
   int phXzero = initphase(0.0, obsstep);

// Begin Sequence

   xmtrphase(phfXprep); txphase(phXprep);
   obspwrf(getval("aXprep"));
   obsunblank(); decunblank(); _unblank34();
   delay(d1);  
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// Preparation Pulse with Initial Point

   startacq(5.0e-6);
   rcvroff();
   delay(xx.r1);
   rgpulse(getval("pwXprep"), phXprep, 0.0, 0.0);
   xmtrphase(phXzero);

// Apply Semi-windowless WHH4 Cycles

   decblank(); _blank34();
   _xx(xx, phXxx);
   endacq();
   obsunblank(); decunblank(); _unblank34();
}
void pulsesequence() {

// Set the Maximum Dynamic Table and v-var Numbers

   settablenumber(20);
   setvvarnumber(30);

// Define Variables and Objects and Get Parameter Values

   MPSEQ dumbo = getdumbogen("dumboX","dcf1X",0,0.0,0.0,0,1);
   strncpy(dumbo.ch,"obs",3); 
   putCmd("chXdumbo='obs'\n");

   MPSEQ c7 = getpostc7("c7X",0,0.0,0.0,0,1);  
   MPSEQ c7ref = getpostc7("c7X",c7.iSuper,c7.phAccum,c7.phInt,1,1);
   strncpy(c7.ch,"obs",3);
   putCmd("chXc7='obs'\n");

   WMPA wdumbo = getwdumbogen("wdumboX","dcfX");
   strncpy(wdumbo.ch,"obs",3);
   putCmd("chXwdumbo='obs'\n");

   double tXzfinit = getval("tXzf");            //Define the Z-filter delay in the sequence
   double tXzf = tXzfinit - 5.0e-6 - wdumbo.r1;

// Set Constant-time Period for d2. 

   if (d2_index == 0) d2_init = getval("d2");
   double d2_ = (ni - 1)/sw1 + d2_init;
   putCmd("d2acqret = %f\n",roundoff(d2_,12.5e-9));
   putCmd("d2dwret = %f\n",roundoff(1.0/sw1,12.5e-9));

//--------------------------------------
// Copy Current Parameters to Processed
//-------------------------------------

   putCmd("groupcopy('current','processed','acquisition')");

// Dutycycle Protection

   DUTY d = init_dutycycle();
   d.dutyon = c7.t + getval("pwXtilt") + d2_ + getval("pwXtilt") + c7ref.t + getval("pwX90") +
                   + wdumbo.q*wdumbo.cycles*wdumbo.pw;
   d.dutyoff = 4.0e-6 + d1 + tXzfinit + wdumbo.r2 + at - wdumbo.q*wdumbo.cycles*wdumbo.pw;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0); 

// Set Phase Tables

   settable(ph1Xc7,4,table1);
   settable(phXdumbo,4,table2);
   settable(ph2Xc7,4,table3);
   settable(phX90,16,table4);
   settable(phXwdumbo,4,table5);
   settable(phRec,16,table6);
   settable(ph1Xtilt,4,table7);
   settable(ph2Xtilt,4,table8);

// Set the Small-Angle Prep Phase

   double obsstep = 360.0/(PSD*8192);
   obsstepsize(obsstep);
   int phfX90 = initphase(0.0, obsstep);

//Add STATES Quadrature Phase

   if (phase1 == 2)
      initval((45.0/obsstep),v1);
   else
      initval(0.0,v1);

   initval((d2*c7.of[0]*360.0/obsstep),v2);
   initval(0.0,v3);
   obsstepsize(obsstep);
   setreceiver(phRec);

// Begin Sequence

   xmtrphase(v1); txphase(ph1Xc7);
   obspwrf(getval("aXc7"));
   obsunblank(); decunblank(); _unblank34();
   delay(d1);
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// C7 Recoupling of 2Q coherence

   _mpseq(c7, ph1Xc7);

// F1 Evolution With DUMBO

   xmtrphase(v3);
   if (!getval("scXdcf1")){
   	obspwrf(getval("aX90"));
   	rgpulse(getval("pwXtilt"),ph1Xtilt,0.0,0.0);
   }
   obspwrf(getval("aXdumbo"));
   obsunblank();
   _mpseqon(dumbo,phXdumbo);
   delay(d2);
   _mpseqoff(dumbo);
   if (!getval("scXdcf1")){
   	obspwrf(getval("aX90"));
   	rgpulse(getval("pwXtilt"),ph2Xtilt,0.0,0.0);
   }
   obspwrf(getval("aX90"));
   obsunblank();

// C7 Transfer to 1Q Coherence

   xmtrphase(v2);
   _mpseq(c7ref, ph2Xc7);

// Z-filter Delay

   delay(tXzf);

// Detection Pulse

   txphase(phX90);
   obspwrf(getval("aX90"));
   startacq(5.0e-6);
   rcvroff();
   delay(wdumbo.r1);
   rgpulse(getval("pwX90"), phX90, 0.0, 0.0);
   obsunblank();
   xmtrphase(v3);
   delay(wdumbo.r2);

// Apply WPMLG Cycles During Acqusition

   decblank(); _blank34();
   _wdumbo(wdumbo,phXwdumbo);
   endacq();
   obsunblank(); decunblank(); _unblank34();  
}
Beispiel #7
0
pulsesequence() {

// Set the Maximum Dynamic Table and v-var Numbers

   settablenumber(10);
   setvvarnumber(30);

// Define Variables and Objects and Get Parameter Values

   double aXprep = getval("aXprep");
   double pwXprep = getval("pwXprep");
   double phvXprep = getval("phXprep");

   WMPA wsam = getwsamn("wsamX");
   strncpy(wsam.ch,"obs",3); 
   putCmd("chXwsam='obs'\n");

//--------------------------------------
// Copy Current Parameters to Processed
//-------------------------------------

   putCmd("groupcopy('current','processed','acquisition')");

// Dutycycle Protection

   DUTY d = init_dutycycle();
   d.dutyon = getval("pwXprep") + wsam.cycles1*wsam.cycles*wsam.pw;
   d.dutyoff = d1 + 4.0e-6 + 5.0e-6 + wsam.r1 + wsam.r2 +
               at - wsam.cycles1*wsam.cycles*wsam.pw;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   settable(phXprep,4,table1);
   settable(phXwsam,4,table2);
   settable(phRec,4,table3);
   setreceiver(phRec);

// Set the Small-Angle Step

   double obsstep = 360.0/(PSD*8192);
   obsstepsize(obsstep);
   int phfXprep = initphase(phvXprep,obsstep);
   int phXzero = initphase(0.0,obsstep);

// Begin Sequence

   xmtrphase(phfXprep); txphase(phXprep);
   obspwrf(aXprep);
   obsunblank(); decunblank(); _unblank34();
   delay(d1);
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// Standard 90-degree prepX pulse for SAM

   startacq(5.0e-6);
   rcvroff();
   delay(wsam.r1);
   rgpulse(pwXprep, phXprep, 0.0, 0.0);
   xmtrphase(phXzero);
   delay(wsam.r2);

// Apply WSAM Cycles

   decblank(); _blank34();
   _wsamn(wsam, phXwsam);
   endacq();
   obsunblank(); decunblank(); _unblank34();
}
Beispiel #8
0
pulsesequence()
{
  /* DECLARE AND LOAD VARIABLES */
  shape offC10P;
  char f1180[MAXSTR],		/* Flag to start t1 @ halfdwell */
       f2180[MAXSTR],		/* Flag to start t2 @ halfdwell */
       mixpat[MAXSTR],		/* Spinlock waveform            */
       H2Opurge[MAXSTR], stCdec[MAXSTR],	/* calls STUD+ waveforms from shapelib */
       STUD[MAXSTR];		/* apply automatically calculated STUD decoupling */

  int ncyc, t1_counter,		/* used for states tppi in t1 */
      first_FID, t2_counter;	/* used for states tppi in t2 */

  double tau1,			/*  t1 delay */
         tau2,			/*  t2 delay */
         ni = getval("ni"), ni2 = getval("ni2"),
	 stdmf = getval("dmf80"),	/* dmf for 80 ppm of STUD decoupling */
         rf80 = getval("rf80"),	/* rf in Hz for 80ppm STUD+ */
         taua = getval("taua"),	/* time delays for CH coupling evolution */
         taub = getval("taub"), tauc = getval("tauc"),
	 /* string parameter stCdec calls stud decoupling waveform from your shapelib. */
         studlvl,		/* coarse power for STUD+ decoupling */
         pwClvl = getval("pwClvl"),	/* coarse power for C13 pulse */
         pwC = getval("pwC"),	/* C13 90 degree pulse length at pwClvl */
         rf0,			/* maximum fine power when using pwC pulses */
         /* the following pulse length for the SLP pulse is automatically calculated   */
         /* by the macro "hcch_tocsyP".  The SLP pulse shape,"offC10P" is created       */
         /* by Pbox "on-the-fly"                                                       */
         pwC10,			/* 180 degree selective sinc pulse on CO(174ppm) */
         rf7,			/* fine power for the pwC10 ("offC10P") pulse */
         compC = getval("compC"),	/* adjustment for C13 amplifier compression */
         mixpwr = getval("mixpwr"), mixpwrf = getval("mixpwrf"), mixdmf = getval("mixdmf"),
         pwmix = getval("pwmix"), mixres = getval("mixres"),
	 pwNlvl = getval("pwNlvl"),		/* power for N15 pulses */
         pwN = getval("pwN"),	/* N15 90 degree pulse length at pwNlvl */
         sw1 = getval("sw1"), sw2 = getval("sw2"),
	 gt0 = getval("gt0"),	/* other gradients */
         gt3 = getval("gt3"), gt4 = getval("gt4"), gt5 = getval("gt5"),
         gt7 = getval("gt7"), gzlvl0 = getval("gzlvl0"), gzlvl3 = getval("gzlvl3"),
         gzlvl4 = getval("gzlvl4"), gzlvl5 = getval("gzlvl5"), gzlvl6 = getval("gzlvl6"),
         gzlvl7 = getval("gzlvl7");

  if ((getval("arraydim") < 1.5) || (ix == 1))
    first_FID = 1;
  else
    first_FID = 0;

  getstr("mixpat", mixpat);
  getstr("f1180", f1180);
  getstr("f2180", f2180);
  getstr("H2Opurge", H2Opurge);
  getstr("STUD", STUD);

  if (first_FID)		/* calculate the shape only once */
  {
    rf7 = 1.0e-6 * 80.5 * 600.0 / sfrq;
    offC10P = pbox_make("offC10P", "sinc180", rf7, 139.0 * dfrq, pwClvl, compC * pwC);
  }
  else
    offC10P = getRsh("offC10P");

  pwC10 = offC10P.pw;
  rf7 = offC10P.pwrf;


  /* 80 ppm STUD+ decoupling */
  strcpy(stCdec, "stCdec80");
  studlvl = pwClvl + 20.0 * log10(compC * pwC * 4.0 * rf80);
  studlvl = (int) (studlvl + 0.5);


  /*   LOAD PHASE TABLE    */
  settable(t3, 2, phi3);
  settable(t5, 4, phi5);
  settable(t11, 4, rec);



  /*   INITIALIZE VARIABLES   */

  if (dpwrf < 4095)
  {
    printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
    psg_abort(1);
  }

  if (pwC > (25.0e-6 * 600.0 / sfrq))
  {
    printf("Increase pwClvl so that pwC < 25*600/sfrq");
    psg_abort(1);
  }

  /* maximum fine power for pwC pulses */
  rf0 = 4095.0;

  /* CHECK VALIDITY OF PARAMETER RANGES */

  if ((dm[A] == 'y' || dm[B] == 'y'))
  {
    printf("incorrect dec1 decoupler flags! Should be 'nny' or 'nnn' ");
    psg_abort(1);
  }

  if ((dm2[A] == 'y' || dm2[B] == 'y' || dm2[C] == 'y'))
  {
    printf("incorrect dec2 decoupler flags! Should be 'nnn' ");
    psg_abort(1);
  }

  if ((dm3[A] == 'y' || dm3[C] == 'y'))
  {
    printf("incorrect dec1 decoupler flags! Should be 'nyn' or 'nnn' ");
    psg_abort(1);
  }

  if (dpwr > 52)
  {
    printf("don't fry the probe, DPWR too large!  ");
    psg_abort(1);
  }

  if (pw > 80.0e-6)
  {
    printf("dont fry the probe, pw too high ! ");
    psg_abort(1);
  }

  if (pwN > 100.0e-6)
  {
    printf("dont fry the probe, pwN too high ! ");
    psg_abort(1);
  }


  /* PHASES AND INCREMENTED TIMES */

  /*  Phase incrementation for hypercomplex 2D data, States-Haberkorn element */
  if (phase1 == 2)
    tsadd(t3, 1, 4);
  if (phase2 == 2)
    tsadd(t5, 1, 4);


  /*  C13 TIME INCREMENTATION and set up f1180  */

  /*  Set up f1180  */
  tau1 = d2;
  if (f1180[A] == 'y')
  {
    tau1 += (1.0 / (2.0 * sw1));
    if (tau1 < 0.2e-6)
      tau1 = 0.0;
  }
  tau1 = tau1 / 2.0;

  /*  Set up f2180  */
  tau2 = d3;
  if (f2180[A] == 'y')
  {
    tau2 += (1.0 / (2.0 * sw2));
    if (tau2 < 0.2e-6)
      tau2 = 0.0;
  }
  tau2 = tau2 / 2.0;

  ncyc = getval("ncyc");
  if (ix < 2)
    printf("ncyc = %d, mix = %.6f\n", ncyc, (double) ncyc * pwmix);

  /* Calculate modifications to phases for States-TPPI acquisition          */
  if (ix == 1)
    d2_init = d2;
  t1_counter = (int) ((d2 - d2_init) * sw1 + 0.5);
  if (t1_counter % 2)
  {
    tsadd(t3, 2, 4);
    tsadd(t11, 2, 4);
  }

  if (ix == 1)
    d3_init = d3;
  t2_counter = (int) ((d3 - d3_init) * sw2 + 0.5);
  if (t2_counter % 2)
  {
    tsadd(t5, 2, 4);
    tsadd(t11, 2, 4);
  }

  /*   BEGIN PULSE SEQUENCE   */

  status(A);
  if (dm3[B] == 'y')
    lk_sample();
  if ((ni / sw1 - d2) > 0)
    delay(ni / sw1 - d2);	/*decreases as t1 increases for const.heating */
  if ((ni2 / sw2 - d3) > 0)
    delay(ni2 / sw2 - d3);	/*decreases as t2 increases for const.heating */
  delay(d1);
  if (dm3[B] == 'y')
  {
    lk_hold();
    lk_sampling_off();
  }				/*freezes z0 correction, stops lock pulsing */
  rcvroff();

  obspower(tpwr);
  decpower(pwClvl);
  dec2power(pwNlvl);
  decpwrf(rf0);
  obsoffset(tof);
  txphase(t3);
  delay(1.0e-5);

  decrgpulse(pwC, zero, 0.0, 0.0);	/*destroy C13 magnetization */
  zgradpulse(gzlvl0, 0.5e-3);
  delay(1.0e-4);
  decrgpulse(pwC, one, 0.0, 0.0);
  zgradpulse(0.7 * gzlvl0, 0.5e-3);
  delay(5.0e-4);

  if (dm3[B] == 'y')
  {
    dec3rgpulse(1 / dmf3, one, 10.0e-6, 2.0e-6);
    dec3unblank();
    dec3phase(zero);
    delay(2.0e-6);
    setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
  }
  rgpulse(pw, t3, 0.0, 0.0);	/* 1H pulse excitation */
  zgradpulse(gzlvl0, gt0);	/* 2.0*GRADIENT_DELAY */
  decphase(zero);
  delay(taua + tau1 - gt0 - 2.0 * GRADIENT_DELAY - 2.0 * pwC);
  decrgpulse(2.0 * pwC, zero, 0.0, 0.0);
  txphase(zero);
  delay(tau1);
  rgpulse(2.0 * pw, zero, 0.0, 0.0);
  zgradpulse(gzlvl0, gt0);
  txphase(one);
  decphase(t5);
  delay(taua - gt0);
  rgpulse(pw, one, 0.0, 0.0);
  zgradpulse(gzlvl3, gt3);
  delay(2.0e-4);
  decrgpulse(pwC, t5, 0.0, 0.0);
  delay(tau2);
  dec2rgpulse(2.0 * pwN, zero, 0.0, 0.0);
  zgradpulse(gzlvl4, gt4);	/* 2.0*GRADIENT_DELAY */
  decphase(zero);
  decpwrf(rf7);
  delay(taub - 2.0 * pwN - gt4 - 2.0 * GRADIENT_DELAY);
  decshaped_pulse("offC10P", pwC10, zero, 0.0, 0.0);
  txphase(zero);
  decpwrf(rf0);
  delay(taub - 2.0 * pw);
  rgpulse(2.0 * pw, zero, 0.0, 0.0);
  delay(tau2);
  decrgpulse(2.0 * pwC, zero, 0.0, 0.0);
  decpwrf(rf7);
  delay(taub);
  decshaped_pulse("offC10P", pwC10, zero, 0.0, 0.0);
  zgradpulse(gzlvl4, gt4);	/* 2.0*GRADIENT_DELAY */
  decpwrf(rf0);
  delay(taub - gt4 - 2.0 * GRADIENT_DELAY);
  decrgpulse(pwC, one, 0.0, 0.0);
  decpower(mixpwr);
  decpwrf(mixpwrf);
  if (ncyc > 0)
    decspinlock(mixpat, 1.0 / mixdmf, mixres, one, ncyc);
  decpower(pwClvl);
  decpwrf(rf0);
  if (H2Opurge[A] == 'y')
  {
    obspwrf(1000.0);
    rgpulse(900 * pw, zero, 0.0, 0.0);
    rgpulse(500 * pw, one, 0.0, 0.0);
    obspwrf(4095.0);
  }
  zgradpulse(gzlvl7, gt7);
  delay(50.0e-6);
  rgpulse(pw, zero, 0.0, 0.0);
  zgradpulse(gzlvl7, gt7 / 1.6);
  decrgpulse(pwC, three, 100.0e-6, 0.0);
  zgradpulse(gzlvl5, gt5);
  decphase(zero);
  delay(tauc - gt5);
  simpulse(2.0 * pw, 2.0 * pwC, zero, zero, 0.0, 0.0);
  zgradpulse(gzlvl5, gt5);
  delay(tauc - gt5);
  decrgpulse(pwC, zero, 0.0, 0.0);
  zgradpulse(gzlvl3, gt3);
  if (dm3[B] == 'y')
  {
    setstatus(DEC3ch, FALSE, 'c', FALSE, dmf3);
    dec3rgpulse(1 / dmf3, three, 2.0e-6, 2.0e-6);
    dec3blank();
    lk_autotrig();		/* resumes lock pulsing */
  }
  delay(2.0e-4);
  rgpulse(pw, zero, 0.0, 0.0);
  zgradpulse(gzlvl6, gt5);
  delay(taua - gt5 + rof1);
  simpulse(2.0 * pw, 2.0 * pwC, zero, zero, 0.0, rof1);
  zgradpulse(gzlvl6, gt5);
  delay(taua - gt5 - 2.0 * pwC - 2.0 * POWER_DELAY);
  decrgpulse(pwC, zero, 0.0, 0.0);
  decrgpulse(pwC, one, 0.0, 0.0);
  if (STUD[A] == 'y')
    decpower(studlvl);
  else
    decpower(dpwr);
  dec2power(dpwr2);
  rgpulse(pw, zero, 0.0, rof2);
  rcvron();
  if (dm3[B] == 'y')
    lk_sample();
  setreceiver(t11);
  if ((STUD[A] == 'y') && (dm[C] == 'y'))
  {
        decunblank();
        decon();
        decprgon(stCdec,1/stdmf, 1.0);
        startacq(alfa);
        acquire(np, 1.0/sw);
        decprgoff();
        decoff();
        decblank();
    if (dm2[C] == 'y')
    {
      setstatus(DEC2ch, TRUE, dmm2[C], FALSE, dmf2);
    }
  }
  else
    status(C);
}
Beispiel #9
0
static void WET(codeint phaseA, codeint phaseB)
{
  double finepwr,gzlvlw,gtw,gswet,dmfwet,dpwrwet,dofwet,wetpwr,pwwet,dz,
  ref_pw90 = getval("ref_pw90"),
         ref_pwr = getval("ref_pwr"),
        slp0bw = getval("slp0bw"),
        slpbw = getval("slpbw"),
        slp2bw = getval("slp2bw"),
        slp3bw = getval("slp3bw"),
        slp4bw = getval("slp4bw"),
        slp5bw = getval("slp5bw"),
        slp6bw = getval("slp6bw"),
        slp0,slp,slp2,
        slp3,slp4,slp5,slp6;
  int   slp0w,slpw,slp2w,slp3w,slp4w,slp5w,slp6w,c13wet;
  char  wetshape[MAXSTR];

  c13wet=getflag("c13wet");        /* C13 satellite suppression flag    */
  getstr("wetshape",wetshape);     /* Selective pulse shape (basename)  */
  wetpwr=getval("wetpwr");         /* User enters power for 90 deg.     */
  pwwet=getval("pwwet");           /* User enters power for 90 deg.     */
  dmfwet=getval("dmfwet");         /* dmf for the C13 decoupling        */
  dpwrwet=getval("dpwrwet");       /* Power fot the C13 decoupling      */
  dofwet=getval("dofwet");         /* Offset for the C13 decoupling     */
  dz=getval("dz");                 /* Post WET delay                    */
  slp0w=getflag("slp0w");          /* Flags whether user is requesting  */
  slpw=getflag("slpw");            /* WET suppression on each solvent   */
  slp2w=getflag("slp2w");          /* signal                            */
  slp3w=getflag("slp3w");
  slp4w=getflag("slp4w");
  slp5w=getflag("slp5w");
  slp6w=getflag("slp6w");

/*      On-the fly calculation of the WET shapes.
        d.a. March 2001
        First check if any of the WET related parameters are arrayed,
        in order to avoid extra pulse shaping  */

   if ((getval("arraydim") < 1.5) || (ix==1) || (isarry("ref_pwr")) || (isarry("ref_pw90")) || (isarry("tof")) || (isarry("slp0bw")) || (isarry("slp")) || (isarry("slpbw")) || (isarry("slp2bw")) || (isarry("slp3bw")) || (isarry("slp4bw")) || (isarry("slp5bw")) || (isarry("slp6bw")) || (isarry("slp0")) || (isarry("slp2")) || (isarry("slp3")) || (isarry("slp4")) || (isarry("slp5")) || (isarry("slp6")) || (isarry("slp0w")) || (isarry("slpw")) || (isarry("slp2w")) || (isarry("slp3w")) || (isarry("slp4w")) || (isarry("slp5w")) || (isarry("slp6w")))
{

/*      Set the name of the shape file to wetshape if not arrayed,
        for compatibility reasons with the other sequences of the LC
        and VAST package.
        If something is arrayed then the first elements named with
        wetshape and all subsequent with wetshape_n, where n is
        the array index    */

  if (ix==1)
  sprintf(wetarr, "%s", wetshape);
  else
  sprintf(wetarr, "%s_%d", wetshape, ix);

/* Open Pbox and start pulse shape calculation   */

  opx(wetarr);

/*      Explicitly check whether each one of the seven solvent lines
        is chosen to be suppressed. If the slpN parameter is set to
        'n' or the slpNw flag is set to 'n' then no wave is put into Pbox. 
        Otherwise the proper line with the SEDUCE shape is addded.
        var_active information can be found in /vnmr/psg/active.c    */

  if ((var_active("slp0",1)) && (slp0w))
        { slp0 = getval("slp0");
          putwave("seduce",slp0bw/2,slp0,0.0,0.0,90.0); }
  if ((var_active("slp",1)) && (slpw))
        { slp = getval("slp");
          putwave("seduce",slpbw/2,slp,0.0,0.0,90.0); }
  if ((var_active("slp2",1)) && (slp2w))
        { slp2 = getval("slp2");
          putwave("seduce",slp2bw/2,slp2,0.0,0.0,90.0); }
  if ((var_active("slp3",1)) && (slp3w))
        { slp3 = getval("slp3");
          putwave("seduce",slp3bw/2,slp3,0.0,0.0,90.0); }
  if ((var_active("slp4",1)) && (slp4w))
        { slp4 = getval("slp4");
          putwave("seduce",slp4bw/2,slp4,0.0,0.0,90.0); }
  if ((var_active("slp5",1)) && (slp5w))
        { slp5 = getval("slp5");
          putwave("seduce",slp5bw/2,slp5,0.0,0.0,90.0); }
  if ((var_active("slp6",1)) && (slp6w))
        { slp6 = getval("slp6");
          putwave("seduce",slp6bw/2,slp6,0.0,0.0,90.0); }

/*      Add additional control parameters, close Pbox and retrieve
        the shape parameters into the proper variables   */

  pbox_par("attn","i");
  pbox_par("reps","2");
  cpx(ref_pw90,ref_pwr);
  pbox_get();
  wetpwr = pbox_pwr;
  pwwet = pbox_pw;
}
else
{   /* Read the pbx.RF shape file and retrieve the wetpwr and pwwet values */
    dumshape=getRsh(wetshape);
    wetpwr = dumshape.pwr;
    pwwet = dumshape.pw;
}


finepwr=wetpwr-(int)wetpwr;  /* Adjust power to 152 deg. pulse */
  wetpwr=(double)((int)wetpwr);
  if (finepwr==0.0) {wetpwr=wetpwr+5; finepwr=4095.0; }
  else {wetpwr=wetpwr+6; finepwr=4095.0*(1-((1.0-finepwr)*0.12)); }
  rcvroff();
  if (c13wet)
    {
    decunblank(); decon();
    decoffset(dofwet);
    decpower(dpwrwet);
    if (rfwg[DECch-1]=='y')
         decprgon("garp1",1/dmfwet,1.0);
      else
         setstatus(DECch,FALSE,'g',FALSE,dmfwet);
    }
  obspower(wetpwr);         /* Set to low power level        */
  gzlvlw=getval("gzlvlw");      /* Z-Gradient level              */
  gtw=getval("gtw");            /* Z-Gradient duration           */
  gswet=getval("gswet");        /* Post-gradient stability delay */
  CHESS(finepwr*0.5056,wetarr,pwwet,phaseA,20.0e-6,rof2,gzlvlw,gtw,gswet,c13wet);
  CHESS(finepwr*0.6298,wetarr,pwwet,phaseB,20.0e-6,rof2,gzlvlw/2.0,gtw,gswet,c13wet);
  CHESS(finepwr*0.4304,wetarr,pwwet,phaseB,20.0e-6,rof2,gzlvlw/4.0,gtw,gswet,c13wet);
  CHESS(finepwr*1.00,wetarr,pwwet,phaseB,20.0e-6,rof2,gzlvlw/8.0,gtw,gswet,c13wet);
  if (c13wet)
    {
    if (rfwg[DECch-1]=='y')
         decprgoff();
      else
         setstatus(DECch,FALSE,'c',FALSE,dmf);
    decoffset(dof);
    decpower(dpwr);
    decoff(); decblank();
    }
  obspower(tpwr); obspwrf(tpwrf);    /* Reset to normal power level   */
  rcvron();
  delay(dz);
}
Beispiel #10
0
pulsesequence()
{



/* DECLARE AND LOAD VARIABLES */

char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
	    ribose[MAXSTR],	 		    /* ribose CHn groups only */
	    AH2H8[MAXSTR],		         /* Adenine H2-H8 correlation */
	    H2Opurge[MAXSTR],
	    rna_stCdec[MAXSTR],	       /* calls STUD+ waveforms from shapelib */
	    STUD[MAXSTR];   /* apply automatically calculated STUD decoupling */
 
int         t1_counter,  		        /* used for states tppi in t1 */
            t2_counter;  	 	        /* used for states tppi in t2 */

double      tau1,         				         /*  t1 delay */
            tau2,        				         /*  t2 delay */
            stdmf = getval("dmf80"),     /* dmf for 80 ppm of STUD decoupling */
            rf80 = getval("rf80"),       	  /* rf in Hz for 80ppm STUD+ */
	    taua = getval("taua"),   /* time delays for CH coupling evolution */
	    taub = getval("taub"),
	    tauc = getval("tauc"),

/* string parameter rna_stCdec calls stud decoupling waveform from your shapelib.*/
   studlvl,	                         /* coarse power for STUD+ decoupling */

	pwClvl = getval("pwClvl"), 	        /* coarse power for C13 pulse */
        pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */
	rfC,            	  /* maximum fine power when using pwC pulses */
	dofa,	    /* dof shifted to 80 ppm for ribose and 145 ppm for AH2H8 */
	tofa,	    		    /* tof shifted to 7.5 ppm in t1 for AH2H8 */

/* p_d is used to calculate the isotropic mixing on the C-ribose region */
        p_d,                 	       /* 50 degree pulse for DIPSI-3 at rfdC */
        rfdC,               /* fine power for 7.5 kHz or 4.0 kHz rf at 500MHz */
	ncyc = getval("ncyc"), 			  /* no. of cycles of DIPSI-3 */

   compC = getval("compC"),       /* adjustment for C13 amplifier compression */

	pwNlvl = getval("pwNlvl"),	              /* power for N15 pulses */
        pwN = getval("pwN"),          /* N15 90 degree pulse length at pwNlvl */

	sw1 = getval("sw1"),
	sw2 = getval("sw2"),

 grecov = getval("grecov"),   /* Gradient recovery delay, typically 150-200us */

	gt0 = getval("gt0"),				   /* other gradients */
	gt3 = getval("gt3"),
	gt4 = getval("gt4"),
	gt5 = getval("gt5"),
	gt7 = getval("gt7"),
	gzlvl0 = getval("gzlvl0"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl4 = getval("gzlvl4"),
	gzlvl5 = getval("gzlvl5"),
	gzlvl6 = getval("gzlvl6"),
	gzlvl7 = getval("gzlvl7");

    getstr("f1180",f1180);
    getstr("f2180",f2180);
    getstr("ribose",ribose);
    getstr("AH2H8",AH2H8);
    getstr("H2Opurge",H2Opurge);
    getstr("STUD",STUD);

/*   LOAD PHASE TABLE    */

	settable(t3,2,phi3);
	settable(t5,4,phi5);
	settable(t9,8,phi9);
	settable(t11,8,rec);


/*   INITIALIZE VARIABLES   */

/* maximum fine power for pwC pulses */
	rfC = 4095.0;

  if (ribose[A] == 'y')
   {
/*  Center dof in RIBOSE region on 80ppm. */
	tofa = tof;
        dofa = dof - 30.0*dfrq;
		
/* dipsi-3 decoupling on C-ribose */	
 	p_d = (5.0)/(9.0*4.0*7000.0*(sfrq/800));  /* 35ppm DIPSI-3 */
     	rfdC = (compC*4095.0*pwC*5.0)/(p_d*9.0); 
	rfdC = (int) (rfdC + 0.5);
  	ncyc = (int) (ncyc + 0.5);
   }
  else
   {
/*  Center dof in adenine C2-C4-C6-C8-C5 region on 145 ppm. */
	tofa = tof + 2.5*sfrq;
        dofa = dof + 35.0*dfrq;

/* dipsi-3 decoupling on C-aromatic */
        p_d = (5.0)/(9.0*4.0*8000.0*(sfrq/800));  /* 40ppm DIPSI-3 */
        rfdC = (compC*4095.0*pwC*5.0)/(p_d*9.0);
        rfdC = (int) (rfdC + 0.5);
        ncyc = (int) (ncyc + 0.5);
   }

/* 80 ppm STUD+ decoupling */
        strcpy(rna_stCdec, "wurst80");
        studlvl = pwClvl + 20.0*log10(compC*pwC*4.0*rf80);
        studlvl = (int) (studlvl + 0.5);


/* CHECK VALIDITY OF PARAMETER RANGES */


    if((ribose[A] == 'y' && AH2H8[A] == 'y' ))
    { text_error("Choose either ribose='y' or AH2H8='y' !! ");
        psg_abort(1); }

    if((dm[A] == 'y' || dm[B] == 'y' ))
    { text_error("incorrect dec1 decoupler flags! Should be 'nny' or 'nnn' ");
        psg_abort(1); }

    if((dm2[A] == 'y' || dm2[B] == 'y'))
    { text_error("incorrect dec2 decoupler flags! Should be 'nny' or 'nnn' ");
        psg_abort(1); }

    if( (((dm[C] == 'y') && (dm2[C] == 'y')) && (STUD[A] == 'y')) )
    { text_error("incorrect dec2 decoupler flags! Should be 'nnn' if STUD='y'"); psg_abort(1); }

    if((dm3[A] == 'y' || dm3[C] == 'y' ))
    { text_error("incorrect dec1 decoupler flags! Should be 'nyn' or 'nnn' "); psg_abort(1); }

    if( dpwr > 50 )
    { text_error("don't fry the probe, DPWR too large!  "); psg_abort(1); }

    if( dpwr2 > 50 )
    { text_error("don't fry the probe, DPWR2 too large!  "); psg_abort(1); }

    if( (pw > 20.0e-6) && (tpwr > 56) )
    { text_error("don't fry the probe, pw too high ! "); psg_abort(1); }

    if( (pwC > 40.0e-6) && (pwClvl > 56) )
    { text_error("don't fry the probe, pwN too high ! "); psg_abort(1); }

    if( (pwN > 100.0e-6) && (pwNlvl > 56) )
    { text_error("don't fry the probe, pwN too high ! "); psg_abort(1); }
 
    if ((dm3[B] == 'y'  &&   dpwr3 > 44 ))
    { text_error ("Deuterium decoupling power too high ! "); psg_abort(1); }

    if ((ncyc > 1 ) && (ix == 1))
    { text_error("mixing time is %f ms.\n",(ncyc*97.8*4*p_d)); }


/* PHASES AND INCREMENTED TIMES */

/*  Phase incrementation for hypercomplex 2D data, States-Haberkorn element */

    if (phase1 == 2) 
	 tsadd(t3,1,4);  
    if (phase2 == 2) 
	 tsadd(t5,1,4);

/*  C13 TIME INCREMENTATION and set up f1180  */

/*  Set up f1180  */
   
    tau1 = d2;

    if(f1180[A] == 'y') 
	{ tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; }

    tau1 = tau1/2.0;


/*  Set up f2180  */

    tau2 = d3;

    if(f2180[A] == 'y') 
	{ tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; }

    tau2 = tau2/2.0;



/* Calculate modifications to phases for States-TPPI acquisition          */

   if( ix == 1) d2_init = d2;
   t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 );
   if(t1_counter % 2) 
	{ tsadd(t3,2,4); tsadd(t11,2,4); }

   if( ix == 1) d3_init = d3;
   t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );
   if(t2_counter % 2) 
	{ tsadd(t5,2,4); tsadd(t11,2,4); }



/*   BEGIN PULSE SEQUENCE   */

status(A);
        if (dm3[B] == 'y') lk_sample();
	delay(d1);
        if (dm3[B] == 'y') lk_hold();
	rcvroff();

	obspower(tpwr);
	decpower(pwClvl);
 	dec2power(pwNlvl);
	decpwrf(rfC);
	obsoffset(tofa);
	decoffset(dofa);
	dec2offset(dof2);
	txphase(t3);
	delay(1.0e-5);

	decrgpulse(pwC, zero, 0.0, 0.0);	   /*destroy C13 magnetization*/
	zgradpulse(gzlvl0, 0.5e-3);
	delay(grecov/2);
	decrgpulse(pwC, one, 0.0, 0.0);
	zgradpulse(0.7*gzlvl0, 0.5e-3);
	delay(5.0e-4);

        if (dm3[B] == 'y')	  /*optional 2H decoupling on */
        {
          dec3unblank();
          dec3rgpulse(1/dmf3, one, 0.0, 0.0); 
          dec3unblank();
          setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
         } 

	rgpulse(pw, t3, 0.0, 0.0);                    /* 1H pulse excitation */
	zgradpulse(gzlvl0, gt0);		/* 2.0*GRADIENT_DELAY */	
        decphase(zero);
	delay(taua + tau1 - gt0 - 2.0*GRADIENT_DELAY - 2.0*pwC);
        decrgpulse(2.0*pwC, zero, 0.0, 0.0);
        txphase(zero);
	delay(tau1);
	rgpulse(2.0*pw, zero, 0.0, 0.0);
	zgradpulse(gzlvl0, gt0);
        txphase(one);
	decphase(t5);
	obsoffset(tof);
	delay(taua - gt0);
	rgpulse(pw, one, 0.0, 0.0);
	zgradpulse(gzlvl3, gt3);
	delay(grecov);
        decrgpulse(pwC, t5, 0.0, 0.0);
	delay(tau2);
	dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
	zgradpulse(gzlvl4, gt4);		        /* 2.0*GRADIENT_DELAY */
        decphase(zero);
	delay(taub - 2.0*pwN - gt4 - 2.0*GRADIENT_DELAY);
        txphase(zero);
	decpwrf(rfC);
	delay(taub - 2.0*pw);
	rgpulse(2.0*pw, zero, 0.0, 0.0);
	delay(tau2);
	decrgpulse(2.0*pwC, zero, 0.0, 0.0);
	delay(taub);
	zgradpulse(gzlvl4, gt4);	        /* 2.0*GRADIENT_DELAY */	
	decpwrf(rfdC);
	delay(taub - gt4 - 2.0*GRADIENT_DELAY);
	decrgpulse(1.0e-3, zero, 0.0, 0.0);
	initval(ncyc, v2);
	starthardloop(v2);
     decrgpulse(4.9*p_d,one,0.0,0.0);
     decrgpulse(7.9*p_d,three,0.0,0.0);
     decrgpulse(5.0*p_d,one,0.0,0.0);
     decrgpulse(5.5*p_d,three,0.0,0.0);
     decrgpulse(0.6*p_d,one,0.0,0.0);
     decrgpulse(4.6*p_d,three,0.0,0.0);
     decrgpulse(7.2*p_d,one,0.0,0.0);
     decrgpulse(4.9*p_d,three,0.0,0.0);
     decrgpulse(7.4*p_d,one,0.0,0.0);
     decrgpulse(6.8*p_d,three,0.0,0.0);
     decrgpulse(7.0*p_d,one,0.0,0.0);
     decrgpulse(5.2*p_d,three,0.0,0.0);
     decrgpulse(5.4*p_d,one,0.0,0.0);
     decrgpulse(0.6*p_d,three,0.0,0.0);
     decrgpulse(4.5*p_d,one,0.0,0.0);
     decrgpulse(7.3*p_d,three,0.0,0.0);
     decrgpulse(5.1*p_d,one,0.0,0.0);
     decrgpulse(7.9*p_d,three,0.0,0.0);

     decrgpulse(4.9*p_d,three,0.0,0.0);
     decrgpulse(7.9*p_d,one,0.0,0.0);
     decrgpulse(5.0*p_d,three,0.0,0.0);
     decrgpulse(5.5*p_d,one,0.0,0.0);
     decrgpulse(0.6*p_d,three,0.0,0.0);
     decrgpulse(4.6*p_d,one,0.0,0.0);
     decrgpulse(7.2*p_d,three,0.0,0.0);
     decrgpulse(4.9*p_d,one,0.0,0.0);
     decrgpulse(7.4*p_d,three,0.0,0.0);
     decrgpulse(6.8*p_d,one,0.0,0.0);
     decrgpulse(7.0*p_d,three,0.0,0.0);
     decrgpulse(5.2*p_d,one,0.0,0.0);
     decrgpulse(5.4*p_d,three,0.0,0.0);
     decrgpulse(0.6*p_d,one,0.0,0.0);
     decrgpulse(4.5*p_d,three,0.0,0.0);
     decrgpulse(7.3*p_d,one,0.0,0.0);
     decrgpulse(5.1*p_d,three,0.0,0.0);
     decrgpulse(7.9*p_d,one,0.0,0.0);

     decrgpulse(4.9*p_d,three,0.0,0.0);
     decrgpulse(7.9*p_d,one,0.0,0.0);
     decrgpulse(5.0*p_d,three,0.0,0.0);
     decrgpulse(5.5*p_d,one,0.0,0.0);
     decrgpulse(0.6*p_d,three,0.0,0.0);
     decrgpulse(4.6*p_d,one,0.0,0.0);
     decrgpulse(7.2*p_d,three,0.0,0.0);
     decrgpulse(4.9*p_d,one,0.0,0.0);
     decrgpulse(7.4*p_d,three,0.0,0.0);
     decrgpulse(6.8*p_d,one,0.0,0.0);
     decrgpulse(7.0*p_d,three,0.0,0.0);
     decrgpulse(5.2*p_d,one,0.0,0.0);
     decrgpulse(5.4*p_d,three,0.0,0.0);
     decrgpulse(0.6*p_d,one,0.0,0.0);
     decrgpulse(4.5*p_d,three,0.0,0.0);
     decrgpulse(7.3*p_d,one,0.0,0.0);
     decrgpulse(5.1*p_d,three,0.0,0.0);
     decrgpulse(7.9*p_d,one,0.0,0.0);

     decrgpulse(4.9*p_d,one,0.0,0.0);
     decrgpulse(7.9*p_d,three,0.0,0.0);
     decrgpulse(5.0*p_d,one,0.0,0.0);
     decrgpulse(5.5*p_d,three,0.0,0.0);
     decrgpulse(0.6*p_d,one,0.0,0.0);
     decrgpulse(4.6*p_d,three,0.0,0.0);
     decrgpulse(7.2*p_d,one,0.0,0.0);
     decrgpulse(4.9*p_d,three,0.0,0.0);
     decrgpulse(7.4*p_d,one,0.0,0.0);
     decrgpulse(6.8*p_d,three,0.0,0.0);
     decrgpulse(7.0*p_d,one,0.0,0.0);
     decrgpulse(5.2*p_d,three,0.0,0.0);
     decrgpulse(5.4*p_d,one,0.0,0.0);
     decrgpulse(0.6*p_d,three,0.0,0.0);
     decrgpulse(4.5*p_d,one,0.0,0.0);
     decrgpulse(7.3*p_d,three,0.0,0.0);
     decrgpulse(5.1*p_d,one,0.0,0.0);
     decrgpulse(7.9*p_d,three,0.0,0.0);

	endhardloop();
        decrgpulse(9.0*p_d/5.0, t9, 2.0e-6, 0.0);
     if( H2Opurge[A] == 'y' )
         {obspwrf(1000.0); rgpulse(900*pw, zero, 0.0, 0.0);
	   rgpulse(500*pw, one, 0.0, 0.0); obspwrf(4095.0); }
	zgradpulse(gzlvl7, gt7);
	decpwrf(rfC);
	delay(50.0e-6);
        rgpulse(pw,zero,0.0,0.0);
	zgradpulse(gzlvl7, gt7/1.6);
        decrgpulse(pwC, three, 100.0e-6, 0.0); 
	zgradpulse(gzlvl5, gt5);
	decphase(zero);
	delay(tauc - gt5);
	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);
	zgradpulse(gzlvl5, gt5);
	delay(tauc - gt5);
	decrgpulse(pwC, zero, 0.0, 0.0);
	zgradpulse(gzlvl3, gt3);
        if(dm3[B] == 'y')	         /*optional 2H decoupling off */
        {
         dec3rgpulse(1/dmf3, three, 0.0, 0.0);
         dec3blank();
         setstatus(DEC3ch, FALSE, 'w', FALSE, dmf3);
         dec3blank();
        }
	delay(grecov);
	rgpulse(pw, zero, 0.0, 0.0);
	zgradpulse(gzlvl6, gt5);
	delay(taua - gt5);
	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);
	zgradpulse(gzlvl6, gt5);
  if (STUD[A]=='y') decpower(studlvl);

  else
   {
	decpower(dpwr);
	dec2power(dpwr2);
   }
	delay(taua - gt5);
	rgpulse(pw, zero, 0.0, rof2);
        rcvron();
        if (dm3[B] == 'y') lk_sample();
	setreceiver(t11);
  if ((STUD[A]=='y') && (dm[C] == 'y'))
       {
        decpower(studlvl);
        decunblank();
        decon();
        decprgon(rna_stCdec,1/stdmf, 1.0);
        startacq(alfa);
        acquire(np, 1.0/sw);
        decprgoff();
        decoff();
        decblank();
       }
   else	
	 status(C);
}		 
Beispiel #11
0
pulsesequence()
{

  double j1min = getval("j1min"),
         j1max = getval("j1max"),
         gzlvlE = getval("gzlvlE"),
         gtE = getval("gtE"),
	 pwx180 = getval("pwx180"),
	 pwxlvl180 = getval("pwxlvl180"),
         EDratio = getval("EDratio"),
         gstab = getval("gstab"),
         hsglvl = getval("hsglvl"),
         hsgt = getval("hsgt"),
         dmfct = getval("dmfct"),
         dpwrct = getval("dpwrct"),
         tau,
	 tau1,
	 tau3,
         bigT = getval("BigT");

  char   pwx180ad[MAXSTR],
	 dmct[MAXSTR],
	 pwx180adR[MAXSTR];

  int	 icosel,
	 MAXni,
         prgcycle = (int)(getval("prgcycle")+0.5),
	 phase1 = (int)(getval("phase")+0.5);

//synchronize gradients to srate for probetype='nano'
//   Preserve gradient "area"
        gtE = syncGradTime("gtE","gzlvlE",1.0);
        gzlvlE = syncGradLvl("gtE","gzlvlE",1.0);

  getstr("pwx180ad",pwx180ad);
  getstr("pwx180adR",pwx180adR);
  getstr("dmct",dmct);

  tau1 = 1/(2*(j1min + 0.07*(j1max - j1min)));
  tau3 = 1/(2*(j1max - 0.07*(j1max - j1min)));
  tau = 1 / (j1min+j1max);

/*  Make sure ni does not exceed what is allowed by BigT */

  MAXni = (((bigT/2 - 1/(j1min+j1max) - 2*gtE - 2*gstab - pwx180)*2*sw1) - 2);
  if ((ni > MAXni) && (ix==1))
  {
	ni = MAXni;
	putCmd("setvalue('ni',%.0f)\n",ni);
	putCmd("setvalue('ni',%.0f,'processed')\n",ni);
	fprintf(stdout, "ni set to maximum value of %0.f.\n",ni);
  }

  icosel = 1;

  assign(ct,v17);
  assign(zero,v18);
  assign(zero,v19);

  if (getflag("prgflg") && (satmode[0] == 'y') && (prgcycle > 1.5))
    {
        hlv(ct,v17);
        mod2(ct,v18); dbl(v18,v18);
        if (prgcycle > 2.5)
           {
                hlv(v17,v17);
                hlv(ct,v19); mod2(v19,v19); dbl(v19,v19);
           }
     }

  settable(t1, 4, ph1);
  settable(t2, 8, ph2);
  settable(t3, 16, ph3);
  settable(t6, 2, ph6);

  getelem(t1, v17, v1);
  getelem(t2, v17, v2);
  getelem(t6, v17, oph);
  getelem(t3, v17, v3);

  assign(zero,v6);
  add(oph,one,v5);
  assign(zero,v4);

  add(oph,v18,oph);
  add(oph,v19,oph);

/*
  mod2(id2, v10);
  dbl(v10,v10);
*/

  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v10);

  add(v2, v10, v2);
  add(v4, v10, v4);
  add(oph, v10, oph);

  if ((phase1 == 2) || (phase1 == 5))
    icosel = -1;

  status(A);

   delay(5.0e-5);
   if (getflag("sspul"))
        steadystate();

   if (satmode[0] == 'y')
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
        if (getflag("slpsat"))
           {
                shaped_satpulse("relaxD",satdly,zero);
                if (getflag("prgflg"))
                   shaped_purge(v6,zero,v18,v19);
           }
        else
           {
                satpulse(satdly,zero,rof1,rof1);
                if (getflag("prgflg"))
                   purge(v6,zero,v18,v19);
           }
     }
   else
        delay(d1);

   if (getflag("wet"))
     wet4(zero,one);

    obspower(tpwr);
    decpower(pwxlvl);

    if (getflag("nullflg"))
    {
      rgpulse(0.5 * pw, zero, rof1, rof1);
      delay(tau);
      decpower(pwxlvl180);
      decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
      rgpulse(2.0 * pw, zero, rof1, rof1);
      delay(tau + 2 * POWER_DELAY);
      decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
      decpower(pwxlvl);
      rgpulse(1.5 * pw, two, rof1, rof1);
      zgradpulse(hsglvl, hsgt);
      delay(1e-3);
    }

  status(B);

    rgpulse(pw, v6, rof1, rof1);

  if (getflag("dmct"))
  {
    decpower(dpwrct);
    decprgon("garp1",1/dmfct,1.0);
/*
    setstatus(DECch, TRUE, 'g', FALSE, dmfct);
*/
    decunblank();
    decon();
  }
    delay(bigT/2 - d2/2  - tau - 2*gtE - 2*gstab - pwx180 );
    rgpulse(2*pw,zero,rof1,rof1);
    delay(bigT/2 - d2/2  - tau - 2*gtE - 2*gstab - pwx180 );
  if (getflag("dmct"))
  {
    decoff();
    decblank();
    decprgoff();
/*
    setstatus(DECch, FALSE, 'c', FALSE, dmf);
*/
    decpower(pwxlvl);
  }

    delay(4*pw/PI+2*rof1);

    delay(tau);
    decrgpulse(pwx,v2,rof1,rof1);
    decpower(pwxlvl180);
    delay(gtE+2*GRADIENT_DELAY+gstab+pw-2*pwx/PI-POWER_DELAY);
    decshaped_pulse(pwx180ad,pwx180,v4,rof1,rof1);

    delay(d2/2);
    zgradpulse(icosel*gzlvlE,gtE);
    delay(gstab);
    rgpulse(2*pw,zero,rof1,rof1);
    zgradpulse(icosel*gzlvlE,gtE);
    delay(gstab);
    delay(d2/2);

    decshaped_pulse(pwx180ad,pwx180,v3,rof1,rof1);
    delay(gtE+2*GRADIENT_DELAY+gstab+pw-2*pwx/PI-POWER_DELAY);
    decpower(pwxlvl);
    decrgpulse(pwx,v1,rof1,rof1);
    delay(tau);

    simpulse(pw,pwx,one,zero,rof1,rof1);
    zgradpulse(6*gzlvlE/(10*EDratio),gtE);
    delay(tau3 - gtE - 2*GRADIENT_DELAY);
    decrgpulse(pwx,zero,rof1,rof1);
    zgradpulse(14*gzlvlE/(10*EDratio),gtE);
    delay(tau - gtE - 2*GRADIENT_DELAY);
    simpulse(2*pw,pwx,zero,zero,rof1,rof1);
    zgradpulse(40*gzlvlE/(10*EDratio),gtE);
    delay(tau1 - gtE - 2*GRADIENT_DELAY - POWER_DELAY);
    decpower(dpwr);

  status(C);

    delay(tau+tau3+3*pwx+6*rof1-tau1+WFG_START_DELAY);

}
Beispiel #12
0
pulsesequence()
{

  double j1min = getval("j1min"),
         j1max = getval("j1max"),
         gzlvlE = getval("gzlvlE"),
         gtE = getval("gtE"),
         mult = getval("mult"),
	 pwx180 = getval("pwx180"),
	 pwxlvl180 = getval("pwxlvl180"),
	 pw180 = getval("pw180"),
         pwx180r = getval("pwx180r"),
         pwxlvl180r = getval("pwxlvl180r"),
	 tpwr180 = getval("tpwr180"),
         EDratio = getval("EDratio"),
         hsglvl = getval("hsglvl"),
         hsgt = getval("hsgt"),
         gstab = getval("gstab"),
         dmfct = getval("dmfct"),
         dpwrct = getval("dpwrct"),
         tau,
	 tau1,
	 tau3,
	 taug,
         bigT = getval("BigT");

  char   pwx180ad[MAXSTR],
	 pw180ad[MAXSTR],
	 dmct[MAXSTR],
	 bipflg[MAXSTR],
         pwx180ref[MAXSTR],
         dmmct[MAXSTR];

  int	 icosel,
         igcorr,
         prgcycle = (int)(getval("prgcycle")+0.5),
	 phase1 = (int)(getval("phase")+0.5);

//synchronize gradients to srate for probetype='nano'
//   Preserve gradient "area"
        gtE = syncGradTime("gtE","gzlvlE",1.0);
        gzlvlE = syncGradLvl("gtE","gzlvlE",1.0);

  getstr("pwx180ad",pwx180ad);
  getstr("pw180ad",pw180ad);
  getstr("dmct",dmct);
  getstr("pwx180ref", pwx180ref);
  getstr("dmmct", dmmct);

  getstr("bipflg",bipflg);
  if (bipflg[0] == 'y')
  {
        tpwr180=getval("tnbippwr");
        pw180=getval("tnbippw");
        getstr("tnbipshp",pw180ad);
  }
  if (bipflg[1] == 'y')
  {
        pwxlvl180=getval("dnbippwr");
        pwx180=getval("dnbippw");
        getstr("dnbipshp",pwx180ad);
  }

  tau1 = 1/(2*(j1min + 0.07*(j1max - j1min)));
  tau3 = 1/(2*(j1max - 0.07*(j1max - j1min)));
  tau = 1 / (j1min+j1max);

  taug = tau + getval("tauC");

  icosel = 1;
  igcorr = 2;
  
  if (mult > 0.5)
    igcorr = 1;

  assign(ct,v17);
  assign(zero,v18);
  assign(zero,v19);

  if (getflag("prgflg") && (satmode[0] == 'y') && (prgcycle > 1.5))
    {
        hlv(ct,v17);
        mod2(ct,v18); dbl(v18,v18);
        if (prgcycle > 2.5)
           {
                hlv(v17,v17);
                hlv(ct,v19); mod2(v19,v19); dbl(v19,v19);
           }
     }

  settable(t1, 4, ph1);
  settable(t2, 8, ph2);
  settable(t3, 16, ph3);
  settable(t6, 2, ph6);
  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t2, v17, v2);
  getelem(t6, v17, oph);
  assign(zero, v4);

  assign(zero,v6);
  add(oph,v18,oph);
  add(oph,v19,oph);

  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v14);
/*
  mod2(id2, v14);
  dbl(v14,v14);
*/
  add(v2, v14, v2);
  add(v4, v14, v4);
  add(oph, v14, oph);

  if ((phase1 == 2) || (phase1 == 5))
    icosel = -1;

  status(A);

   delay(5.0e-5);
   if (getflag("sspul"))
        steadystate();

   if (satmode[0] == 'y')
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
        if (getflag("slpsat"))
           {
                shaped_satpulse("relaxD",satdly,zero);
                if (getflag("prgflg"))
                   shaped_purge(v6,zero,v18,v19);
           }
        else
           {
                satpulse(satdly,zero,rof1,rof1);
                if (getflag("prgflg"))
                   purge(v6,zero,v18,v19);
           }
     }
   else
        delay(d1);

   if (getflag("wet"))
     wet4(zero,one);

    obspower(tpwr);
    decpower(pwxlvl);

    if (getflag("nullflg"))
    {
      decpower(pwxlvl180);
      rgpulse(0.5 * pw, zero, rof1, rof1);
      obspower(tpwr180);
      delay(tau/2.0);
      simshaped_pulse(pw180ad,pwx180ad,pw180,pwx180,zero,zero,rof1,rof1);
      delay(tau/2.0+POWER_DELAY+rof1);
      delay(tau/2.0+POWER_DELAY+rof1);
      simshaped_pulse(pw180ad,pwx180ad,pw180,pwx180,two,two,rof1,rof1);
      obspower(tpwr);
      delay(tau/2.0);
      rgpulse(0.5 * pw, zero, rof1, rof1);
      decpower(pwxlvl);
      zgradpulse(hsglvl, 1.4*hsgt);
      delay(1e-3);
    }

  status(B);

    rgpulse(pw, zero, rof1, rof1);
  if (getflag("dmct"))
  {
    decpower(dpwrct);
    decprgon("garp1",1/dmfct,1.0);
/*
    setstatus(DECch, FALSE, 'g', FALSE, dmfct);
*/
    decunblank();
    decon();
  }
    obspower(tpwr180);
    delay(bigT/2 - d2/2  - tau - taug - pwx180r);
    delay(pw180+WFG_START_DELAY+WFG_STOP_DELAY);
    shaped_pulse(pw180ad,pw180,zero,rof1,rof1);
    delay(bigT/2 - d2/2  - tau - taug - pwx180r);
    delay(4*pw/PI+2*rof1+POWER_DELAY+4*pwx/PI+2*POWER_DELAY);
  if (getflag("dmct"))
  {
    decoff();
    decblank();
    decprgoff();
/*
    setstatus(DECch, FALSE, 'c', FALSE, dmf);
*/
    decpower(pwxlvl);
  }

    if (mult > 0.5)
    {
     delay(tau-gtE-2*GRADIENT_DELAY-gstab);
     zgradpulse(icosel*gzlvlE,gtE);
     delay(gstab);
    }
    else
    {
     delay(tau);
    }

    decrgpulse(pwx,v2,rof1,rof1);

    if (mult > 0.5)
    {
    decpower(pwxlvl180r);
    delay(taug);
    decshaped_pulse(pwx180ref, pwx180r, v4, rof1, rof1);

    delay(d2/2);
    shaped_pulse(pw180ad,pw180,zero,rof1,rof1);
    delay(d2/2);
    zgradpulse(icosel*gzlvlE,gtE);

    delay(taug-gtE-2*GRADIENT_DELAY+(4*pwx/PI+2*rof1+2*POWER_DELAY-(WFG_START_DELAY+pw180+WFG_STOP_DELAY+2*rof1)));
    decshaped_pulse(pwx180ref, pwx180r, v3, rof1, rof1);
    }

    else
    {
    decpower(pwxlvl180);
    delay(taug/2+(pwx180r-pwx180)/2);
    decshaped_pulse(pwx180ad, pwx180, v4, rof1, rof1);
    delay(taug/2+(pwx180r-pwx180)/2.0-gtE-2*GRADIENT_DELAY-gstab);

    zgradpulse(icosel*gzlvlE,gtE);
    delay(gstab);

    delay(d2/2);
    shaped_pulse(pw180ad,pw180,zero,rof1,rof1);
    delay(d2/2);

    zgradpulse(icosel*gzlvlE,gtE);

    delay(taug/2+(pwx180r-pwx180)/2.0+(4*pwx/PI+2*rof1+2*POWER_DELAY-WFG_START_DELAY-pw180-WFG_STOP_DELAY-2*rof1)-gtE-2*GRADIENT_DELAY);
    decshaped_pulse(pwx180ad, pwx180, v3, rof1, rof1);
  
    delay(taug/2+(pwx180r-pwx180)/2);
    }

    decpower(pwxlvl);
    decrgpulse(pwx,v1,rof1,rof1);

    obspower(tpwr);

    delay(tau);

    rgpulse(pw,one,rof1,rof2);
    decrgpulse(pwx,zero,rof1,rof1);
    obspower(tpwr180);
    zgradpulse(igcorr*3*gzlvlE/(10*EDratio),gtE);
    delay(tau3 - gtE - 2*GRADIENT_DELAY);
    decrgpulse(pwx,zero,rof1,rof1);
    zgradpulse(igcorr*7*gzlvlE/(10*EDratio),gtE);
    delay(tau - gtE - 2*GRADIENT_DELAY);
    decrgpulse(pwx,zero,rof1,rof1);
    shaped_pulse(pw180ad,pw180,zero,rof1,rof1);
    zgradpulse(igcorr*2*gzlvlE/EDratio,gtE);
    delay(tau1 - gtE - 2*GRADIENT_DELAY - POWER_DELAY);
    decpower(dpwr);

  status(C);

    delay(tau+tau3+3*pwx+6*rof1-tau1+WFG_START_DELAY+WFG_STOP_DELAY);
}
Beispiel #13
0
void pulsesequence() {

// Set the Maximum Dynamic Table Number

   settablenumber(10);
   setvvarnumber(30);
  
// Define Variables and Objects and Get Parameter Values

   WMPA swwhh4 = getswwhh4("swwhh4X");
   strncpy(swwhh4.ch,"obs",3); 
   putCmd("chXswwhh4='obs'\n");

//--------------------------------------
// Copy Current Parameters to Processed
//-------------------------------------

   putCmd("groupcopy('current','processed','acquisition')");

// Dutycycle Protection

   DUTY d = init_dutycycle();
   d.dutyon = getval("pwXprep") + 4.0*swwhh4.cycles*swwhh4.pw;
   d.dutyoff = d1 + 4.0e-6 + 5.0e-6 + swwhh4.r1 + swwhh4.r2 +
               at - 4.0*swwhh4.cycles*swwhh4.pw;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   settable(phXprep,4,table3);
   settable(phXswwhh4,4,table4);
   settable(phRec,4,table5);
   setreceiver(phRec);

// Set the Small-Angle Prep Phase

   double obsstep = 360.0/(PSD*8192);
   obsstepsize(obsstep);
   int phfXprep = initphase(getval("phXprep"), obsstep);
   int phXzero = initphase(0.0, obsstep);

// Set the Realtime pwXprep adXprep

   settable(pw90Xprep,4,table1);
   settable(pw55Xprep,4,table2);
   int phase90 = (int) (getval("pwXprep")/0.0125e-6);
   int phase55 = (int) (getval("pwXprep")*54.7/(90.0*0.0125e-6));
   tsmult(pw90Xprep,phase90,0);
   tsmult(pw55Xprep,phase55,0);
   getelem(pw90Xprep,ct,v1);
   getelem(pw55Xprep,ct,v2);
   add(v1,v2,pwXprep);
   sub(v1,v2,adXprep);

// Begin Sequence

   xmtrphase(phfXprep); txphase(phXprep);
   obspwrf(getval("aXprep"));
   obsunblank(); decunblank(); _unblank34();
   delay(d1);
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// Incremented Preparation Pulse

   startacq(5.0e-6);
   rcvroff();
   delay(swwhh4.r1);
   vdelay(NSEC,adXprep);  // Keep Total Time Constant
   xmtron();
   vdelay(NSEC,pwXprep);
   xmtroff();
   xmtrphase(phXzero);
   delay(swwhh4.r2);

// Apply Semi-windowless WHH4 Cycles

   decblank(); _blank34();
   _swwhh4(swwhh4, phXswwhh4);
   endacq();
   obsunblank(); decunblank(); _unblank34();
}
Beispiel #14
0
pulsesequence() {

// Set the Maximum Dynamic Table and v-var Numbers

   settablenumber(10);
   setvvarnumber(30);

// Define Variables and Objects and Get Parameter Values

   double aXprep1 = getval("aXprep1");  // Define Tilted Pulses using "prep1X".
   double pw1Xprep1 = getval("pw1Xprep1");
   double pw2Xprep1 = getval("pw2Xprep1");
   double phXprep1 = getval("phXprep1");

   WMPA wpmlg = getwpmlg("wpmlgX");
   strncpy(wpmlg.ch,"obs",3); 
   putCmd("chXwpmlg='obs'\n");

//--------------------------------------
// Copy Current Parameters to Processed
//-------------------------------------

   putCmd("groupcopy('current','processed','acquisition')");

// Dutycycle Protection

   DUTY d = init_dutycycle();
   d.dutyon = getval("pw1Xprep1") + getval("pw2Xprep1") + 2.0*wpmlg.q*wpmlg.cycles*wpmlg.pw;
   d.dutyoff = d1 + 4.0e-6 + 5.0e-6 + wpmlg.r1 + wpmlg.r2 + 
               at - 2.0*wpmlg.q*wpmlg.cycles*wpmlg.pw;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   settable(ph1Xprep1,4,table1);
   settable(ph2Xprep1,4,table2);
   settable(phXwpmlg,4,table3);
   settable(phRec,4,table4);
   setreceiver(phRec);

// Set the Small-Angle Step

   double obsstep = 360.0/(PSD*8192);
   obsstepsize(obsstep);
   int phfXprep1 = initphase(phXprep1, obsstep);
   int phXzero = initphase(0.0, obsstep);

// Begin Sequence

   xmtrphase(phfXprep1); txphase(ph1Xprep1);
   obspwrf(aXprep1);
   obsunblank(); decunblank(); _unblank34();
   delay(d1);
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// Tilted Preparation Pulse for FSLG or PMLG "prep1X"

   startacq(5.0e-6);
   rcvroff();
   delay(wpmlg.r1);
   rgpulse(pw1Xprep1, ph1Xprep1, 0.0, 0.0);
   rgpulse(pw2Xprep1, ph2Xprep1, 0.0, 0.0);
   xmtrphase(phXzero);
   delay(wpmlg.r2);

// Apply WPMLG Cycles

   decblank(); _blank34();
   _wpmlg(wpmlg, phXwpmlg);
   endacq();
   obsunblank(); decunblank(); _unblank34();
}
Beispiel #15
0
pulsesequence()
{

/* DECLARE AND LOAD VARIABLES */

char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
            RELAY[MAXSTR],                         /* Insert HCCH-relay delay */
            ribose[MAXSTR],                         /* ribose CHn groups only */
            aromatic[MAXSTR],                     /* aromatic CHn groups only */
            rna_stCshape[MAXSTR],     /* calls sech/tanh pulses from shapelib */
            rna_stCdec[MAXSTR],        /* calls STUD+ waveforms from shapelib */
	    mag_flg[MAXSTR],             /* Flag to use magic-angle gradients */
	    H2O_flg[MAXSTR],
	    sspul[MAXSTR],
            SHAPE[MAXSTR],
	    STUD[MAXSTR];   /* apply automatically calculated STUD decoupling */
 
int         t1_counter,  		        /* used for states tppi in t1 */
            t2_counter,  	 	        /* used for states tppi in t2 */
            ni2 = getval("ni2");

double      tau1,         				         /*  t1 delay */
            tau2,        				         /*  t2 delay */
            delta1,delta2,
               ni = getval("ni"),
            lambda = 0.94/(4*getval("JCH")),       /* 1/4J H1 evolution delay */
            tCH = 1/(6.0*getval("JCH")),          /* 1/4J C13 evolution delay */
            tCC = 1/(8*getval("JCC")),

        pwClvl = getval("pwClvl"),              /* coarse power for C13 pulse */
        pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */
   rfC,                           /* maximum fine power when using pwC pulses */
   compC = getval("compC"),       /* adjustment for C13 amplifier compression */
                               /* temporary Pbox parameters */
   bw, pws, ofs, ppm, nst,     /* bandwidth, pulsewidth, offset, ppm, # steps */

/* Sech/tanh inversion pulses automatically calculated by macro "rna_cal"     */
/* and string parameter rna_stCshape calls them from your shapelib.           */
   rfst = 0.0,          /* fine power for the rna_stCshape pulse, initialised */
   dofa,        /* dof shifted to 80 or 120ppm for ribose or aromatic spectra */

/* string parameter stCdec calls stud decoupling waveform from your shapelib.*/
   studlvl,	                         /* coarse power for STUD+ decoupling */
            stdmf = getval("dmf80"),     /* dmf for 80 ppm of STUD decoupling */
            rf80 = getval("rf80"),                /* rf in Hz for 80ppm STUD+ */

	pwNlvl = getval("pwNlvl"),	              /* power for N15 pulses */
        pwN = getval("pwN"),          /* N15 90 degree pulse length at pwNlvl */

	sw1 = getval("sw1"),
	sw2 = getval("sw2"),

	gt3 = getval("gt3"),
	gt4 = getval("gt4"),
	gt5 = getval("gt5"),
	gt7 = getval("gt7"),
	gt8 = getval("gt8"),
	gt9 = getval("gt9"),
        gzcal = getval("gzcal"),
	grecov = getval("grecov"),
	gzlvl0 = getval("gzlvl0"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl4 = getval("gzlvl4"),
	gzlvl5 = getval("gzlvl5"),

	gzlvl7 = getval("gzlvl7"),		/* triax option */
	gzlvl8 = getval("gzlvl8"),
	gzlvl9 = getval("gzlvl9");

    getstr("f1180",f1180);
    getstr("mag_flg",mag_flg);
    getstr("f2180",f2180);
    getstr("RELAY",RELAY);
    getstr("ribose",ribose);
    getstr("aromatic",aromatic);
    getstr("H2O_flg",H2O_flg);
    getstr("sspul",sspul);
    getstr("SHAPE",SHAPE);
    getstr("STUD",STUD);


/*   INITIALIZE VARIABLES   */

/* maximum fine power for pwC pulses */
        rfC = 4095.0;

  setautocal();                        /* activate auto-calibration flags */ 

  if (autocal[0] == 'n') 
  {
      /* 50ppm sech/tanh inversion */
      rfst = (compC*4095.0*pwC*4000.0*sqrt((7.5*sfrq/600+3.85)/0.41));
      rfst = (int) (rfst + 0.5);
  }
  else        /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
  {
    if(FIRST_FID)                                            /* call Pbox */
    {
      ppm = getval("dfrq"); 
      bw = 50.0*ppm; pws = 0.001; ofs = 0.0; nst = 500.0; 
      stC50 = pbox_makeA("rna_stC50", "sech", bw, pws, ofs, compC*pwC, pwClvl, nst);
      if (dm3[B] == 'y') H2ofs = 3.2;
      ofs_check(H1ofs, C13ofs, N15ofs, H2ofs);
    }
    rfst = stC50.pwrf; 
  }
        strcpy(rna_stCshape, "rna_stC50");
        strcpy(rna_stCdec, "wurst80");
        studlvl = pwClvl + 20.0*log10(compC*pwC*4.0*rf80);
        studlvl = (int) (studlvl + 0.5);

/*  RIBOSE spectrum only, centered on 80ppm. */
  if (ribose[A]=='y')
        dofa = dof - 30.0*dfrq;

/*  AROMATIC spectrum only, centered on 120ppm */
  else
        dofa = dof + 10*dfrq;


/* CHECK VALIDITY OF PARAMETER RANGES */

  if( dpwrf < 4095 )
        { printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
          psg_abort(1); }

  if( pwC > (24.0e-6*600.0/sfrq) )
        { printf("Increase pwClvl so that pwC < 24*600/sfrq");
          psg_abort(1); }

  if((dm[A] == 'y' || dm[B] == 'y' ))
	{ printf("incorrect Dec1 decoupler flags!  "); psg_abort(1);}

  if((dm2[A] == 'y' || dm2[B] == 'y'))
	{ printf("incorrect Dec2 decoupler flags!  "); psg_abort(1);}

  if((dm3[A] == 'y' || dm3[C] == 'y' ))
	{printf("incorrect dec1 decoupler flags! Should be 'nyn' or 'nnn' ");
								psg_abort(1); }
  if ((dm3[B] == 'y'  &&   dpwr3 > 44 ))
	{ printf("Deuterium decoupling power too high ! "); psg_abort(1);}

  if( dpwr > 50 )
	{ printf("don't fry the probe, dpwr too large!  "); psg_abort(1);}

  if( dpwr2 > 50 )
	{ printf("don't fry the probe, dpwr2 too large!  "); psg_abort(1); }


/*  CHOICE OF PULSE SEQUENCE */

  if ( ((ribose[A]=='y') && (aromatic[A]=='y')) )
   { text_error("Choose  ONE  of  ribose='y'  OR  aromatic='y' ! ");
        psg_abort(1); }

  if ( ((aromatic[A]=='y') && (RELAY[A]=='y')) )
   { text_error("No RELAY with aromatic='y' ! ");
        psg_abort(1); }


/* LOAD VARIABLES */

   settable(t1, 2, phi1);
   settable(t2, 4, phi2);
   settable(t3, 16, phi3);
   settable(t4, 2, phi4);
   settable(t11,8, rec);


/* INITIALIZE VARIABLES */

/* Phase incrementation for hypercomplex data */

   if ( phase1 == 2 )     /* Hypercomplex in t1 */
     tsadd(t1,1,4);

   if ( phase2 == 2 )
     tsadd(t2,1,4);

/* calculate modification to phases based on current t1 values
   to achieve States-TPPI acquisition */

   if(ix == 1) d2_init = d2;
   t1_counter = (int)((d2-d2_init)*sw1 + 0.5);
   if(t1_counter % 2)     
   {
       tsadd(t1,2,4);
       tsadd(t11,2,4);
   }

/* calculate modification to phases based on current t2 values
   to achieve States-TPPI acquisition */

   if(ix == 1) d3_init = d3;
   t2_counter = (int)((d3-d3_init)*sw2 + 0.5);
   if(t2_counter % 2)     
   {
       tsadd(t2,2,4);
       tsadd(t11,2,4);
   }
 
/* set up so that get (90, -180) phase corrects in F1 if f1180 flag is y */

   tau1 = d2;
   if(f1180[A] == 'y')
   {
      tau1 += (1.0/(2.0*sw1));
   }
   if (tau1 < 1.0e-6) tau1 = 0.0;
   tau1 = tau1/2.0;

/* set up so that get (90, -180) phase corrects in F2 if f2180 flag is y */

   tau2 = d3;
   if(f2180[A] == 'y')
   {
      tau2 += (1.0/(2.0*sw2));
   }
   if (tau2 < 1.0e-6) tau2 = 0.0;
   tau2 = tau2/2.0;

   if (ni > 1)
      delta1 = (double)(t1_counter*(lambda - gt5 - 0.2e-3))/((double)(ni-1));
   else delta1 = 0.0;
   if (ni2 > 1)
      delta2 = (double)(t2_counter*(tCC - 0.6e-3))/((double)(ni2-1));
   else delta2 = 0.0;

   initval(7.0, v1);
   obsstepsize (45.0);

/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   obsoffset(tof);
   decoffset(dofa);
   dec2offset(dof2);
   obspower(tpwr-12);                   
   decpower(pwClvl);
   decpwrf(rfC);
   dec2power(pwNlvl);                  
   decphase(zero);
   dec2phase(zero);
   if (sspul[0] == 'y')
   {
      rgpulse(200*pw, one, 10.0e-6, 0.0e-6);
      rgpulse(200*pw, zero, 0.0e-6, 1.0e-6);
   }
   obspower(tpwr);                   
   xmtrphase(v1);
   txphase(t1);
   if (dm3[B] == 'y') lk_sample();
   delay(d1);
   if (dm3[B] == 'y') lk_hold();
   rcvroff();

       decrgpulse(pwC, zero, rof1, rof1);
       delay(rof1);
       zgradpulse(gzlvl0,0.5e-3); 
       delay(grecov);

   if(dm3[B] == 'y')				  /*optional 2H decoupling on */
        { 
          dec3unblank();
          dec3rgpulse(1/dmf3, one, 0.0, 0.0); 
          dec3unblank();
          setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
         } 

status(B);
	rgpulse(pw, t1, 1.0e-4, rof1);
	xmtrphase(zero);
	txphase(zero);

	zgradpulse(gzlvl5,gt5); 

/*
        decpwrf(rfst);
        delay(lambda - gt5 - rof1 - SAPS_DELAY - GRADIENT_DELAY - POWER_DELAY -
                        WFG2_START_DELAY - 0.5e-3 + 70.0e-6 + tau1);

        decshaped_pulse(rna_stCshape, 1.0e-3, zero, 0.0, 0.0);

        delay(tau1 - delta1);

        rgpulse(2.0*pw, zero, 0.0, rof1);
        txphase(one);
        decpwrf(rfC);

        zgradpulse(gzlvl5,gt5);
        delay(lambda - delta1 - gt5 - rof1 - GRADIENT_DELAY - POWER_DELAY - 0.5e-3 + 70.0e-6);
*/


        delay(lambda - gt5 - rof1 - SAPS_DELAY - GRADIENT_DELAY + tau1);

        decrgpulse(2*pwC, zero, 0.0, 0.0);

        delay(tau1 - delta1);

        rgpulse(2.0*pw, zero, 0.0, rof1);
        txphase(one);

        zgradpulse(gzlvl5,gt5);
        delay(lambda - delta1 - gt5 - rof1 - GRADIENT_DELAY);

	rgpulse(pw, one, 0.0, rof1);
	decphase(t2);
	txphase(zero);

   if(mag_flg[A] == 'y')
      magradpulse(gzcal*gzlvl3,gt3); 
   else
      zgradpulse(gzlvl3,gt3); 

	delay(grecov);

	decrgpulse(pwC, t2, rof1, 0.0);
	decphase(zero);

	delay(tau2);
	
	dec2rgpulse(2.0*pwN,zero,0.0,0.0);

	delay(tCH - 2*pwN);

	rgpulse(2.0*pw, zero, 0.0, 0.0);
	decphase(t3);

	delay(tCC - tCH + tau2 - delta2 - 2.0*pw);
	
	decrgpulse(2.0*pwC, t3, 0.0, 0.0);
	decphase(t4);

	delay(tCC - delta2);

	decrgpulse(pwC, t4, 0.0, rof1);
	txphase(zero);
	decphase(zero);

  if(RELAY[A] == 'y')
   {
        zgradpulse(gzlvl4, gt4);
        delay(tCC - gt4 - GRADIENT_DELAY - pwC);

        decrgpulse(2.0*pwC, zero, 0.0, 0.0);

        zgradpulse(gzlvl4, gt4);
        delay(tCC - gt4 - GRADIENT_DELAY - pwC);

        decrgpulse(pwC, zero, 0.0, 0.0);
   }

	zgradpulse(gzlvl4,gt4); 
   	delay(tCC - gt4);

   	decrgpulse(2.0*pwC, zero, 0.0, rof1);

   if (H2O_flg[A] == 'y')
   {
      delay(tCC - gt4 - grecov - POWER_DELAY);

      zgradpulse(gzlvl4,gt4); 

      txphase(one);
      decphase(one);
      delay(grecov);

      decrgpulse(pwC, one, 0.0, rof1);
      rgpulse(900*pw, one, 0.0, rof1);
      txphase(zero);

      rgpulse(500*pw, zero, rof1, rof1);
      decphase(one);

      if(mag_flg[A] == 'y')
         magradpulse(gzcal*gzlvl7,gt7);
      else
         zgradpulse(gzlvl7,gt7);
      delay(200.0e-6);

      simpulse(pw, pwC, zero, one, 0.0, rof1);
      decphase(zero);

      zgradpulse(gzlvl4,gt4); 
      delay(tCH - gt4);

      simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, rof1);

      zgradpulse(gzlvl4,gt4); 
      delay(tCH - gt4);
   }
   else
   {
      delay(tCC - tCH - 2.0*pw - POWER_DELAY);
      rgpulse(2.0*pw, zero, 0.0, rof1);

      zgradpulse(gzlvl4,gt4); 
      delay(tCH - gt4 - rof1);
   }
   
	decrgpulse(pwC, zero, 0.0, rof1);
	txphase(zero);

   if(mag_flg[A] == 'y')
      magradpulse(gzcal*gzlvl8,gt8); 
   else
      zgradpulse(gzlvl8,gt8); 

	delay(grecov);

        if(dm3[B] == 'y')	         /*optional 2H decoupling off */
        {
         dec3rgpulse(1/dmf3, three, 0.0, 0.0);
         dec3blank();
         setstatus(DEC3ch, FALSE, 'w', FALSE, dmf3);
         dec3blank();
        }

	rgpulse(pw, zero, 0.0, rof1);

  if (SHAPE[A] =='y')
   {
	decpwrf(rfst);

   if(mag_flg[A] == 'y')
      magradpulse(gzcal*gzlvl9,gt9);
   else
      zgradpulse(gzlvl9,gt9);

	delay(lambda - gt9 - GRADIENT_DELAY - POWER_DELAY - WFG2_START_DELAY - 0.5e-3 + 70.0e-6);

        simshaped_pulse("",rna_stCshape,2*pw, 1.0e-3, zero, zero, 0.0, rof1);
        decphase(zero);

   if(mag_flg[A] == 'y')
      magradpulse(gzcal*gzlvl9,gt9);
   else
      zgradpulse(gzlvl9,gt9);

	decpwrf(rfC);

if (STUD[A]=='y') decpower(studlvl); else decpower(dpwr);

	delay(lambda - gt9 -rof1 -0.5*pw - 2*POWER_DELAY - GRADIENT_DELAY - 0.5e-3 + 70.0e-6);
   }
  else
   {
   if(mag_flg[A] == 'y')
      magradpulse(gzcal*gzlvl9,gt9);
   else
      zgradpulse(gzlvl9,gt9);

        delay(lambda - gt9 - GRADIENT_DELAY);

        simpulse(2*pw, 2*pwC, zero, zero, 0.0, rof1);

   if(mag_flg[A] == 'y')
      magradpulse(gzcal*gzlvl9,gt9);
   else
      zgradpulse(gzlvl9,gt9);

if (STUD[A]=='y') decpower(studlvl); else decpower(dpwr);

        delay(lambda - gt9 -rof1 -0.5*pw - POWER_DELAY - GRADIENT_DELAY);
     } 

	rgpulse(pw, zero, rof1, rof2);
	rcvron();
if (dm3[B] == 'y') lk_sample();
	setreceiver(t11);

if ((STUD[A]=='y') && (dm[C] == 'y'))
	{
        decunblank();
        decon();
        decprgon(rna_stCdec,1/stdmf, 1.0);
        startacq(alfa);
        acquire(np, 1.0/sw);
        decprgoff();
        decoff();
        decblank();
        }
   else	
	 status(C);
setreceiver(t11);
}
Beispiel #16
0
void pulsesequence()
{

/* DECLARE AND LOAD VARIABLES */

char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            mag_flg[MAXSTR],                            /*magic angle gradient*/
            f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
	    stCdec[MAXSTR],	       /* calls STUD+ waveforms from shapelib */
	    STUD[MAXSTR];   /* apply automatically calculated STUD decoupling */
 
int         icosel1,          			  /* used to get n and p type */
	    icosel2,
            t1_counter,  		        /* used for states tppi in t1 */
            t2_counter,  	 	        /* used for states tppi in t2 */
	    ni2 = getval("ni2");

double      tau1,         				         /*  t1 delay */
            tau2,        				         /*  t2 delay */
	    del = getval("del"),     /* time delays for CH coupling evolution */
         BPdpwrspinlock,        /*  user-defined upper limit for spinlock(Hz) */
         BPpwrlimits,           /*  =0 for no limit, =1 for limit             */

	    del1 = getval("del1"),
	    del2 = getval("del2"),
/* STUD+ waveforms automatically calculated by macro "biocal"  	      */
/* and string parameter stCdec calls them from your shapelib. 	              */
   stdmf,                                /* dmf for STUD decoupling           */
   studlvl,	                         /* coarse power for STUD+ decoupling */
   rf80 = getval("rf80"), 			  /* rf in Hz for 80ppm STUD+ */
   bw, ofs, ppm,                            /* temporary Pbox parameters */
	pwClvl = getval("pwClvl"), 	        /* coarse power for C13 pulse */
        pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */
	rf0,            	  /* maximum fine power when using pwC pulses */

/* p_d is used to calculate the isotropic mixing on the Cab region            */
        spinlock = getval("spinlock"), /* DIPSI-3 spinlock field strength in Hz */
        p_d,                  	       /* 50 degree pulse for DIPSI-2 at rfd  */
        rfd,                    /* fine power for 7 kHz rf for 500MHz magnet  */
	ncyc = getval("ncyc"), 			  /* no. of cycles of DIPSI-3 */

/* the following pulse lengths for SLP pulses are automatically calculated    */
/* by the macro "ghcch_tocsy" .  SLP pulse shapes, "offC10" etc are called   */
/* directly from your shapelib.                    			      */
   pwC10,                       /* 180 degree selective sinc pulse on CO(174ppm) */
   pwZ,					  /* the largest of pwC10 and 2.0*pwN */
   rf10,	                 /* fine power for the pwC10 ("offC10") pulse */

   compC = getval("compC"),         /* adjustment for C13 amplifier compression */

	pwNlvl = getval("pwNlvl"),	              /* power for N15 pulses */
        pwN = getval("pwN"),          /* N15 90 degree pulse length at pwNlvl */

	sw1 = getval("sw1"),
	sw2 = getval("sw2"),

	gt1 = getval("gt1"),  		       /* coherence pathway gradients */
	gzcal = getval("gzcal"),               /* G/cm to DAC coversion factor*/
        gzlvl1 = getval("gzlvl1"),
	gzlvl2 = getval("gzlvl2"),

	gt3 = getval("gt3"),				   /* other gradients */
	gt5 = getval("gt5"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl4 = getval("gzlvl4"),
	gzlvl5 = getval("gzlvl5"),
	gzlvl6 = getval("gzlvl6");

    getstr("STUD",STUD);
    getstr("mag_flg",mag_flg);
    getstr("f1180",f1180);
    getstr("f2180",f2180);
   strcpy(stCdec, "stCdec80");
   stdmf = getval("dmf80");
   studlvl = pwClvl + 20.0*log10(compC*pwC*4.0*rf80);
   studlvl = (int) (studlvl + 0.5);
  P_getreal(GLOBAL,"BPpwrlimits",&BPpwrlimits,1);
  P_getreal(GLOBAL,"BPdpwrspinlock",&BPdpwrspinlock,1);


/*   LOAD PHASE TABLE    */

	settable(t3,2,phi3);
	settable(t6,1,phi6);
	settable(t5,4,phi5);
	settable(t10,1,phi10);
	settable(t11,4,rec);

        

/*   INITIALIZE VARIABLES   */


  if (BPpwrlimits > 0.5)
  {
   if (spinlock > BPdpwrspinlock)
    {
     spinlock = BPdpwrspinlock;  
     printf("spinlock too large, reset to user-defined limit (BPdpwrspinlock)");
     psg_abort(1);
    }
  }
    if( dpwrf < 4095 )
	{ printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
	  psg_abort(1); }

    /* maximum fine power for pwC pulses */
	rf0 = 4095.0;

      setautocal();                        /* activate auto-calibration flags */ 
        
      if (autocal[0] == 'n') 
      {
        /* "offC10": 180 degree one-lobe sinc pulse on CO, null at Ca 139ppm away */
        pwC10 = getval("pwC10");
	  rf10 = (compC*4095.0*pwC*2.0*1.65)/pwC10;     /* needs 1.65 times more     */
	  rf10 = (int) (rf10 + 0.5);		           /* power than a square pulse */

        if( pwC > (24.0e-6*600.0/sfrq) )
	  { printf("Increase pwClvl so that pwC < 24*600/sfrq");
	    psg_abort(1); 
        }
      }
      else        /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
      {
        if(FIRST_FID)                                            /* call Pbox */
        {
          ppm = getval("dfrq"); 
          bw = 118.0*ppm; ofs = 139.0*ppm;
          offC10 = pbox_make("offC10", "sinc180n", bw, ofs, compC*pwC, pwClvl);
          if(dm3[B] == 'y') H2ofs = 3.2;    
          ofs_check(H1ofs, C13ofs, N15ofs, H2ofs);
        }
        rf10 = offC10.pwrf;  pwC10 = offC10.pw;
      }
				
   /* dipsi-3 decoupling on CbCa */	
 	p_d = (5.0)/(9.0*4.0*spinlock);      /*  DIPSI-3 Field Strength */
 	rfd = (compC*4095.0*pwC*5.0)/(p_d*9.0);
	rfd = (int) (rfd + 0.5);
  	ncyc = (int) (ncyc + 0.5);


/* CHECK VALIDITY OF PARAMETER RANGES */

    if( gt1 > 0.5*del - 1.0e-4)
    {
        printf(" gt1 is too big. Make gt1 less than %f.\n", (0.5*del - 1.0e-4));
        psg_abort(1);
    }

    if( dm[A] == 'y' )
    {
        printf("incorrect dec1 decoupler flag! Should be 'nny' or 'nnn' ");
        psg_abort(1);
    }

    if((dm2[A] == 'y' || dm2[C] == 'y'))
    {
        printf("incorrect dec2 decoupler flags! Should be 'nnn' ");
        psg_abort(1);
    }
    if((dm3[A] == 'y' || dm3[C] == 'y'))
    {
        printf("incorrect dec3 decoupler flags! Should be 'nnn' or 'nyn' ");
        psg_abort(1);
    }

    if( dpwr > 52 )
    {
        printf("don't fry the probe, DPWR too large!  ");
        psg_abort(1);
    }

    if( pw > 50.0e-6 )
    {
        printf("dont fry the probe, pw too high ! ");
        psg_abort(1);
    } 
  
    if( pwN > 100.0e-6 )
    {
        printf("dont fry the probe, pwN too high ! ");
        psg_abort(1);
    } 
 

/* PHASES AND INCREMENTED TIMES */

/*  Phase incrementation for hypercomplex 2D data, States-Haberkorn element */

    icosel1 = -1;  icosel2 = -1;
    if (phase1 == 2) 
	{ tsadd(t6,2,4); icosel1 = -1*icosel1; }
    if (phase2 == 2) 
	{ tsadd(t10,2,4); icosel2 = -1*icosel2; tsadd(t6,2,4); }


/*  Set up f1180  */
   
    tau1 = d2;
    if((f1180[A] == 'y') && (ni > 1.0)) 
	{ tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; }
    tau1 = tau1/2.0;


/*  Set up f2180  */

    tau2 = d3;
    if((f2180[A] == 'y') && (ni2 > 1.0)) 
	{ tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; }
    tau2 = tau2/2.0;



/* Calculate modifications to phases for States-TPPI acquisition          */

   if( ix == 1) d2_init = d2;
   t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 );
   if(t1_counter % 2) 
	{ tsadd(t3,2,4); tsadd(t11,2,4); }

   if( ix == 1) d3_init = d3;
   t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );
   if(t2_counter % 2) 
	{ tsadd(t5,2,4); tsadd(t11,2,4); }



/*   BEGIN PULSE SEQUENCE   */

status(A);
        if ( dm3[B] == 'y' )
          lk_sample();  
        if ((ni/sw1-d2)>0) 
         delay(ni/sw1-d2);       /*decreases as t1 increases for const.heating*/
        if ((ni2/sw2-d3)>0) 
         delay(ni2/sw2-d3);      /*decreases as t2 increases for const.heating*/
   	delay(d1);
        if ( dm3[B] == 'y' )
          { lk_hold(); lk_sampling_off();}  /*freezes z0 correction, stops lock pulsing*/

	rcvroff();
	obspower(tpwr);
	decpower(pwClvl);
 	dec2power(pwNlvl);
	decpwrf(rf0);
	obsoffset(tof);
	txphase(t3);
	delay(1.0e-5);

	decrgpulse(pwC, zero, 0.0, 0.0);	   /*destroy C13 magnetization*/
	zgradpulse(gzlvl1, 0.5e-3);
	delay(1.0e-4);
	decrgpulse(pwC, one, 0.0, 0.0);
	zgradpulse(0.7*gzlvl1, 0.5e-3);
	delay(5.0e-4);

      if ( dm3[B] == 'y' )     /* begins optional 2H decoupling */
        {
          dec3rgpulse(1/dmf3,one,10.0e-6,2.0e-6);
          dec3unblank();
          dec3phase(zero);
          delay(2.0e-6);
          setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
        }
	rgpulse(pw, t3, 0.0, 0.0);                    /* 1H pulse excitation */

        decphase(zero);
	delay(0.5*del + tau1 - 2.0*pwC);

        decrgpulse(2.0*pwC, zero, 0.0, 0.0);

        txphase(zero);
	delay(tau1);

	rgpulse(2.0*pw, zero, 0.0, 0.0);

                if (mag_flg[A] == 'y')
                {
                   magradpulse(icosel1*gzcal*gzlvl1,0.1*gt1);
                }
                else
                {
                   zgradpulse(icosel1*gzlvl1, 0.1*gt1);
                }
        decphase(t5);
	delay(0.5*del - 0.1*gt1);

	simpulse(pw, pwC, zero, t5, 0.0, 0.0);

	zgradpulse(gzlvl3, gt3);
        decphase(zero);
	delay(0.5*del2 - gt3);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl3, gt3);
        txphase(t6);
        decphase(one);
	delay(0.5*del2 - gt3);

	simpulse(pw, pwC, t6, one, 0.0, 0.0);

	zgradpulse(gzlvl4, gt3);
        txphase(zero);
        decphase(zero);
	delay(0.5*del1 - gt3);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl4, gt3);
	delay(0.5*del1 - gt3);

	decrgpulse(pwC, zero, 0.0, 0.0);
	decpwrf(rfd);
	delay(2.0e-6);
	initval(ncyc, v2);
	starthardloop(v2);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
     decrgpulse(5.0*p_d,zero,0.0,0.0);
     decrgpulse(5.5*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.6*p_d,two,0.0,0.0);
     decrgpulse(7.2*p_d,zero,0.0,0.0);
     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.4*p_d,zero,0.0,0.0);
     decrgpulse(6.8*p_d,two,0.0,0.0);
     decrgpulse(7.0*p_d,zero,0.0,0.0);
     decrgpulse(5.2*p_d,two,0.0,0.0);
     decrgpulse(5.4*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.5*p_d,zero,0.0,0.0);
     decrgpulse(7.3*p_d,two,0.0,0.0);
     decrgpulse(5.1*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);

     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);
     decrgpulse(5.0*p_d,two,0.0,0.0);
     decrgpulse(5.5*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.6*p_d,zero,0.0,0.0);
     decrgpulse(7.2*p_d,two,0.0,0.0);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.4*p_d,two,0.0,0.0);
     decrgpulse(6.8*p_d,zero,0.0,0.0);
     decrgpulse(7.0*p_d,two,0.0,0.0);
     decrgpulse(5.2*p_d,zero,0.0,0.0);
     decrgpulse(5.4*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.5*p_d,two,0.0,0.0);
     decrgpulse(7.3*p_d,zero,0.0,0.0);
     decrgpulse(5.1*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);

     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);
     decrgpulse(5.0*p_d,two,0.0,0.0);
     decrgpulse(5.5*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.6*p_d,zero,0.0,0.0);
     decrgpulse(7.2*p_d,two,0.0,0.0);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.4*p_d,two,0.0,0.0);
     decrgpulse(6.8*p_d,zero,0.0,0.0);
     decrgpulse(7.0*p_d,two,0.0,0.0);
     decrgpulse(5.2*p_d,zero,0.0,0.0);
     decrgpulse(5.4*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.5*p_d,two,0.0,0.0);
     decrgpulse(7.3*p_d,zero,0.0,0.0);
     decrgpulse(5.1*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);

     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
     decrgpulse(5.0*p_d,zero,0.0,0.0);
     decrgpulse(5.5*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.6*p_d,two,0.0,0.0);
     decrgpulse(7.2*p_d,zero,0.0,0.0);
     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.4*p_d,zero,0.0,0.0);
     decrgpulse(6.8*p_d,two,0.0,0.0);
     decrgpulse(7.0*p_d,zero,0.0,0.0);
     decrgpulse(5.2*p_d,two,0.0,0.0);
     decrgpulse(5.4*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.5*p_d,zero,0.0,0.0);
     decrgpulse(7.3*p_d,two,0.0,0.0);
     decrgpulse(5.1*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
	endhardloop();

        dec2phase(zero);
        decphase(zero);
        txphase(zero);
	decpwrf(rf10);
	delay(tau2);
							  /* WFG3_START_DELAY */
	sim3shaped_pulse("", "offC10", "", 2.0*pw, pwC10, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
        if(pwC10>2.0*pwN) pwZ=0.0; else pwZ=2.0*pwN - pwC10;

	delay(tau2);
	decpwrf(rf0);
                if (mag_flg[A] == 'y')
                {
                   magradpulse(-icosel2*gzcal*gzlvl2, 1.8*gt1);
                }
                else
                {
                   zgradpulse(-icosel2*gzlvl2, 1.8*gt1);
                }
	delay(2.02e-4);

	decrgpulse(2.0*pwC, zero, 0.0, 0.0);

	decpwrf(rf10);
                if (mag_flg[A] == 'y')
                {
                   magradpulse(icosel2*gzcal*gzlvl2, 1.8*gt1);
                }
                else
                {
                   zgradpulse(icosel2*gzlvl2, 1.8*gt1);
                }
	delay(2.0e-4 + WFG3_START_DELAY + pwZ);

	decshaped_pulse("offC10", pwC10, zero, 0.0, 0.0);
	decpwrf(rf0);
	decrgpulse(pwC, zero, 2.0e-6, 0.0);

	zgradpulse(gzlvl5, gt5);
	delay(0.5*del1 - gt5);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl5, gt5);
	txphase(one);
	decphase(t10);
	delay(0.5*del1 - gt5);

	simpulse(pw, pwC, one, t10, 0.0, 0.0);

	zgradpulse(gzlvl6, gt5);
	txphase(zero);
	decphase(zero);
	delay(0.5*del2 - gt5);

	simpulse(2.0*pw, 2.0*pwC, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl6, gt5);
	delay(0.5*del2 - gt5);

	simpulse(pw, pwC, zero, zero, 0.0, 0.0);

	delay(0.5*del - 0.5*pwC);

	simpulse(2.0*pw,2.0*pwC, zero, zero, 0.0, 0.0);
        if (mag_flg[A] == 'y')
            magradpulse(gzcal*gzlvl1, gt1);
        else
            zgradpulse(gzlvl1, gt1);
        rcvron();
   if ((STUD[A]=='n') && (dm[C] == 'y'))
        decpower(dpwr);
        if ( dm3[B] == 'y' )   /* turns off 2H decoupling  */
        {
           delay(0.5*del-40.0e-6 -gt1 -1/dmf3);
           setstatus(DEC3ch, FALSE, 'c', FALSE, dmf3);
           dec3rgpulse(1/dmf3,three,2.0e-6,2.0e-6);
           dec3blank();
           lk_autotrig();   /* resumes lock pulsing */
           lk_sample();
           if (mag_flg[A] == 'y')
            statusdelay(C,40.0e-6  - 2.0*VAGRADIENT_DELAY - POWER_DELAY);
           else
            statusdelay(C,40.0e-6  - 2.0*GRADIENT_DELAY - POWER_DELAY);
        }
      else
        {
         delay(0.5*del-40.0e-6 -gt1);
        if (mag_flg[A] == 'y')
         statusdelay(C,40.0e-6  - 2.0*VAGRADIENT_DELAY - POWER_DELAY);
        else
         statusdelay(C,40.0e-6  - 2.0*GRADIENT_DELAY - POWER_DELAY);
        }
  if ((STUD[A]=='y') && (dm[C] == 'y'))
        {decpower(studlvl);
         decunblank();
         decon();
         decprgon(stCdec,1/stdmf, 1.0);
         startacq(alfa);
         acquire(np, 1.0/sw);
         decprgoff();
         decoff();
         decblank();
        }
 setreceiver(t11);
}		 
Beispiel #17
0
pulsesequence()
{

  /* DECLARE AND LOAD VARIABLES */

  char f1180[MAXSTR],		/* Flag to start t1 @ halfdwell */
       f2180[MAXSTR],		/* Flag to start t2 @ halfdwell */
       mag_flg[MAXSTR],		/* Flag to use magic-angle gradients */
       H2O_flg[MAXSTR], stCdec[MAXSTR],		/* calls STUD+ waveforms from shapelib */
       STUD[MAXSTR];		/* apply automatically calculated STUD decoupling */

  int t1_counter,		/* used for states tppi in t1 */
      t2_counter;		/* used for states tppi in t2 */

  double tau1,			/*  t1 delay */
         tau2,			/*  t2 delay */
         delta1, delta2, TC = getval("TC"),	/*  3.5 ms  */
         ni = getval("ni"), ni2 = getval("ni2"),
	 stdmf = getval("dmf80"),	/* dmf for 80 ppm of STUD decoupling */
         rf80 = getval("rf80"),	/* rf in Hz for 80ppm STUD+ */
         taua = getval("taua"),	/* time delays for CH coupling evolution */
         taub = getval("taub"), tauc = getval("tauc"),
	 /* string parameter stCdec calls stud decoupling waveform from your shapelib. */
         studlvl,		/* coarse power for STUD+ decoupling */
         bw, ofs, ppm,		/* temporary Pbox parameters */
         pwClvl = getval("pwClvl"),	/* coarse power for C13 pulse */
         pwC = getval("pwC"),	/* C13 90 degree pulse length at pwClvl */
  /* the following pulse length for the SLP pulse is automatically calculated   */
  /* by the macro "hcch_cosy".  The SLP pulse shape,"offC10" is called          */
  /* directly from your shapelib.                                               */
         pwC10,			/* 180 degree selective sinc pulse on CO(174ppm) */
         rf7,			/* fine power for the pwC10 ("offC10") pulse */
         compC = getval("compC"),	/* adjustment for C13 amplifier compression */
         pwmax, pwNlvl = getval("pwNlvl"),	/* power for N15 pulses */
         pwN = getval("pwN"),	/* N15 90 degree pulse length at pwNlvl */
         sw1 = getval("sw1"), sw2 = getval("sw2"), gt1 = getval("gt1"),
         gt2 = getval("gt2"), gt3 = getval("gt3"), gt4 = getval("gt4"),
         gt5 = getval("gt5"), gt7 = getval("gt7"), gt8 = getval("gt8"),
         gt9 = getval("gt9"), gzcal = getval("gzcal"), gzlvl1 = getval("gzlvl1"),
         gzlvl2 = getval("gzlvl2"), gzlvl3 = getval("gzlvl3"), gzlvl4 = getval("gzlvl4"),
         gzlvl5 = getval("gzlvl5"), gzlvl7 = getval("gzlvl7"), gzlvl8 = getval("gzlvl8"),
         gzlvl9 = getval("gzlvl9");

  getstr("f1180", f1180);
  getstr("f2180", f2180);
  getstr("H2O_flg", H2O_flg);
  getstr("STUD", STUD);
  /* 80 ppm STUD+ decoupling */
  strcpy(stCdec, "stCdec80");
  studlvl = pwClvl + 20.0 * log10(compC * pwC * 4.0 * rf80);
  studlvl = (int) (studlvl + 0.5);


  /*   INITIALIZE VARIABLES   */

  if (dpwrf < 4095)
  {
    printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
    psg_abort(1);
  }

  setautocal();			/* activate auto-calibration flags */

  if (autocal[0] == 'n')
  {
    /* "offC10": 180 degree one-lobe sinc pulse on CO, null at Ca 139ppm away */
    pwC10 = getval("pwC10");
    rf7 = (compC * 4095.0 * pwC * 2.0 * 1.65) / pwC10;	/* needs 1.65 times more     */
    rf7 = (int) (rf7 + 0.5);	/* power than a square pulse */

    if (pwC > (24.0e-6 * 600.0 / sfrq))
    {
      printf("Increase pwClvl so that pwC < 24*600/sfrq");
      psg_abort(1);
    }
  }
  else
    /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
  {
    if (FIRST_FID)		/* call Pbox */
    {
      ppm = getval("dfrq");
      bw = 118.0 * ppm;
      ofs = 139.0 * ppm;
      offC10 = pbox_make("offC10", "sinc180n", bw, ofs, compC * pwC, pwClvl);
      if (dm3[B] == 'y')
	H2ofs = 3.2;
      ofs_check(H1ofs, C13ofs, N15ofs, H2ofs);
    }
    rf7 = offC10.pwrf;
    pwC10 = offC10.pw;
  }

  if ((dm3[A] == 'y' || dm3[C] == 'y'))
  {
    printf("incorrect dec1 decoupler flags! Should be 'nyn' or 'nnn' ");
    psg_abort(1);
  }


  getstr("f1180", f1180);
  getstr("f2180", f2180);
  getstr("mag_flg", mag_flg);
  getstr("H2O_flg", H2O_flg);

  pwmax = 2.0 * pwN;
  if (pwC10 > pwmax)
    pwmax = pwC10;

  /* check validity of parameter range */

  if ((dm[A] == 'y' || dm[B] == 'y'))
  {
    printf("incorrect Dec1 decoupler flags!  ");
    psg_abort(1);
  }

  if ((dm2[A] == 'y' || dm2[B] == 'y' || dm2[C] == 'y'))
  {
    printf("incorrect Dec2 decoupler flags! Should be nnn  ");
    psg_abort(1);
  }

  if (dpwr > 50)
  {
    printf("don't fry the probe, dpwr too large!  ");
    psg_abort(1);
  }

  if (dpwr2 > 50)
  {
    printf("don't fry the probe, dpwr2 too large!  ");
    psg_abort(1);
  }

  /* LOAD VARIABLES */

  settable(t1, 2, phi1);
  settable(t2, 4, phi2);
  settable(t3, 16, phi3);
  settable(t4, 2, phi4);

  settable(t11, 8, rec);

  /* INITIALIZE VARIABLES */

  /* Phase incrementation for hypercomplex data */

  if (phase1 == 2)		/* Hypercomplex in t1 */
  {
    tsadd(t1, 1, 4);
  }

  if (phase2 == 2)
  {
    tsadd(t2, 1, 4);
  }

  /* calculate modification to phases based on current t1 values
   to achieve States-TPPI acquisition */

  if (ix == 1)
    d2_init = d2;
  t1_counter = (int) ((d2 - d2_init) * sw1 + 0.5);
  if (t1_counter % 2)
  {
    tsadd(t1, 2, 4);
    tsadd(t11, 2, 4);
  }

  /* calculate modification to phases based on current t2 values
   to achieve States-TPPI acquisition */

  if (ix == 1)
    d3_init = d3;
  t2_counter = (int) ((d3 - d3_init) * sw2 + 0.5);
  if (t2_counter % 2)
  {
    tsadd(t2, 2, 4);
    tsadd(t11, 2, 4);
  }

  /* set up so that get (90, -180) phase corrects in F1 if f1180 flag is y */

  tau1 = d2;
  if (f1180[A] == 'y')
  {
    tau1 += (1.0 / (2.0 * sw1));
  }
  if (tau1 < 1.0e-6)
    tau1 = 0.0;
  tau1 = tau1 / 2.0;

  /* set up so that get (90, -180) phase corrects in F2 if f2180 flag is y */

  tau2 = d3;
  if (f2180[A] == 'y')
  {
    tau2 += (1.0 / (2.0 * sw2));
  }
  if (tau2 < 1.0e-6)
    tau2 = 0.0;
  tau2 = tau2 / 2.0;

  if (ni > 1)
    delta1 = (double) (t1_counter * (taua - gt2 - 0.2e-3)) / ((double) (ni - 1));
  else
    delta1 = 0.0;
  if (ni2 > 1)
    delta2 = (double) (t2_counter * (TC - 0.6e-3)) / ((double) (ni2 - 1));
  else
    delta2 = 0.0;

  initval(7.0, v1);
  obsstepsize(45.0);

  /* BEGIN ACTUAL PULSE SEQUENCE */

  status(A);
  delay(10.0e-6);
  obspower(tpwr);
  decpower(pwClvl);
  decpwrf(4095.0);
  dec2power(pwNlvl);
  decphase(zero);
  dec2phase(zero);
  xmtrphase(v1);
  txphase(t1);
  if (dm3[B] == 'y')
    lk_sample();
  delay(d1);
  if (dm3[B] == 'y')
  {
    lk_hold();
    lk_sampling_off();
  }				/*freezes z0 correction, stops lock pulsing */
  rcvroff();

  if (gt1 > 0.2e-6)
  {
    decrgpulse(pwC, zero, rof1, rof1);
    delay(2.0e-6);
    zgradpulse(gzlvl1, gt1);
    delay(1.0e-3);
  }

  if (dm3[B] == 'y')		/* begins optional 2H decoupling */
  {
    dec3rgpulse(1 / dmf3, one, 10.0e-6, 2.0e-6);
    dec3unblank();
    dec3phase(zero);
    delay(2.0e-6);
    setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
  }

  status(B);
  rgpulse(pw, t1, 1.0e-4, 2.0e-6);
  xmtrphase(zero);
  zgradpulse(gzlvl2, gt2);
  delay(taua - gt2 - 2.0 * pwC - 2.0e-6 - SAPS_DELAY);
  txphase(zero);
  delay(tau1);
  decrgpulse(2.0 * pwC, zero, 0.0, 0.0);
  delay(tau1 - delta1);
  rgpulse(2.0 * pw, zero, 0.0, 2.0e-6);
  zgradpulse(gzlvl2, gt2);
  txphase(one);
  delay(taua - delta1 - gt2 - 2.0e-6);
  rgpulse(pw, one, 0.0, 2.0e-6);

  if (mag_flg[A] == 'y')
  {
    magradpulse(gzcal * gzlvl3, gt3);
  }
  else
  {
    zgradpulse(gzlvl3, gt3);
  }
  decphase(t2);
  txphase(zero);
  delay(200.0e-6);

  decrgpulse(pwC, t2, 2.0e-6, 0.0);

  decphase(zero);
  decpwrf(rf7);
  delay(tau2);
  sim3shaped_pulse("", "offC10", "", 0.0, pwC10, 2.0 * pwN, zero, zero, zero, 0.0, 0.0);
  delay(taub - pwmax - WFG_START_DELAY - WFG_STOP_DELAY - POWER_DELAY);
  rgpulse(2.0 * pw, zero, 0.0, 0.0);

  decphase(t3);
  decpwrf(4095.0);
  delay(TC - taub + tau2 - delta2 - 2.0 * pw - POWER_DELAY);
  decrgpulse(2.0 * pwC, t3, 0.0, 0.0);
  decphase(t4);
  delay(TC - delta2 - POWER_DELAY);

  decrgpulse(pwC, t4, 0.0, 2.0e-6);
  zgradpulse(gzlvl4, gt4);
  txphase(zero);
  decphase(zero);
  delay(tauc - gt4);
  decrgpulse(2.0 * pwC, zero, 0.0, 2.0e-6);

  if (H2O_flg[A] == 'y')
  {
    delay(tauc - gt4 - 500.0e-6 - POWER_DELAY);
    zgradpulse(gzlvl4, gt4);
    decphase(one);
    obspwrf(1000.0);
    delay(500.0e-6);
    decrgpulse(pwC, one, 0.0, 1.0e-6);
    rgpulse(900 * pw, one, rof1, 0.0);
    txphase(zero);
    rgpulse(500 * pw, zero, 2.0e-6, 2.0e-6);
    obspwrf(4095.0);
    if (mag_flg[A] == 'y')
    {
      magradpulse(gzcal * gzlvl5, gt5);
    }
    else
    {
      zgradpulse(gzlvl5, gt5);
    }
    decphase(one);
    delay(200.0e-6);
    simpulse(pw, pwC, zero, one, 0.0, 2.0e-6);
    zgradpulse(gzlvl7, gt7);
    decphase(zero);
    delay(taub - gt7);
    simpulse(2.0 * pw, 2.0 * pwC, zero, zero, 0.0, 2.0e-6);
    zgradpulse(gzlvl7, gt7);
    delay(taub - gt7);
  }
  else
  {
    delay(tauc - taub - 2.0 * pw - POWER_DELAY);
    rgpulse(2.0 * pw, zero, 0.0, 2.0e-6);
    zgradpulse(gzlvl4, gt4);
    delay(taub - gt4 - 2.0e-6);
  }

  decrgpulse(pwC, zero, 0.0, 2.0e-6);
  if (mag_flg[A] == 'y')
  {
    magradpulse(gzcal * gzlvl8, gt8);
  }
  else
  {
    zgradpulse(gzlvl8, gt8);
  }
  txphase(zero);
  delay(200.0e-6);
  if (dm3[B] == 'y')		/* turns off 2H decoupling  */
  {
    setstatus(DEC3ch, FALSE, 'c', FALSE, dmf3);
    dec3rgpulse(1 / dmf3, three, 2.0e-6, 2.0e-6);
    dec3blank();
    lk_autotrig();		/* resumes lock pulsing */
  }
  rgpulse(pw, zero, 0.0, 2.0e-6);
  if (mag_flg[A] == 'y')
  {
    magradpulse(gzcal * gzlvl9, gt9);
  }
  else
  {
    zgradpulse(gzlvl9, gt9);
  }
  delay(taua - gt9);
  simpulse(2.0 * pw, 2.0 * pwC, zero, zero, 0.0, 2.0e-6);
  if (mag_flg[A] == 'y')
  {
    magradpulse(gzcal * gzlvl9, gt9);
  }
  else
  {
    zgradpulse(gzlvl9, gt9);
  }

  if (STUD[A] == 'y')
    decpower(studlvl);
  else
    decpower(dpwr);
  dec2power(dpwr2);

  delay(taua - gt9 - rof1 - 0.5 * pw - 2.0 * POWER_DELAY);
  rgpulse(pw, zero, rof1, rof2);
  rcvron();
  if (dm3[B] == 'y')
    lk_sample();
  setreceiver(t11);

  if ((STUD[A] == 'y') && (dm[C] == 'y'))
  {
        decunblank();
        decon();
        decprgon(stCdec,1/stdmf, 1.0);
        startacq(alfa);
        acquire(np, 1.0/sw);
        decprgoff();
        decoff();
        decblank();
    if (dm2[C] == 'y')
    {
      setstatus(DEC2ch, TRUE, dmm2[C], FALSE, dmf2);
    }
  }
  else
    status(C);
  setreceiver(t11);
}