Example #1
0
void pulsesequence()

{
   double   pwxlvl,
            pwx,
		gzlvl1,
		gt1,
		gzlvl3,
		gt3,
		gstab,
            tau,
            j1xh;

   pwxlvl = getval("pwxlvl");
   pwx    = getval("pwx");
   gzlvl1 = getval("gzlvl1");
   gzlvl3 = getval("gzlvl3");
   gt1 = getval("gt1");
   gt3 = getval("gt3");
   gstab = getval("gstab");
   j1xh    = getval("j1xh");
   tau  = 1/(4*j1xh);

   assign(zero,oph);

   status(A);
     decpower(pwxlvl);
     obspower(tpwr);
      delay(d1);

    status(B);

     rgpulse(pw,zero,rof1,rof1);
     delay(tau);
     simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
     delay(tau);
     simpulse(pw,pwx,one,zero,rof1,rof1);

     delay(gt1+gstab + 2*GRADIENT_DELAY);
     decrgpulse(2*pwx,zero,rof1,rof1);
     zgradpulse(gzlvl1,gt1);
     delay(gstab);
     
     simpulse(pw,pwx,zero,zero,rof1,rof1);
     delay(tau - (2*pw/PI) - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof2);
     decpower(dpwr);
     zgradpulse(gzlvl3,gt3);
     delay(tau - gt3 - 2*GRADIENT_DELAY - POWER_DELAY);

   status(C);
}
Example #2
0
void pulsesequence()
{
   double jc13,jtau;

 
   jc13 = getval("jc13");
   jtau = 1.0 / (2.0 * jc13);

   mod4(ct, v1);		/*  v1 = 0 1 2 3 */
   dbl(v1, v10);		/* v10 = 0 2 0 2 */
   hlv(ct, v2);
   hlv(v2, v2);
   mod4(v2, v2);		/* v2 = 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 */
   add(v2, v1, v1);
   assign(v2, oph);
   add(v10, oph, oph);

   status(A);
   hsdelay(d1);
   if (getflag("wet")) wet4(zero,one);

   status(C);
   rgpulse(pw, v2, rof1, rof2);
   jtau -= pw + rof2;
   delay(jtau - rof1);
   simpulse(2*pw, pwx, v1, zero, rof1, rof2);
   delay(jtau);

   status(C);
}
Example #3
0
pulsesequence()
{
   double	pp;
		

   pp = getval("pp");
   
/* calculate phases */
  mod2(ct,v1);  /* 0101 */
  dbl(v1,v1);   /* 0202 */
  hlv(ct,v2);   /* 0011 2233 */
  mod2(v2,v2);  /* 0011 0011 */
  add(v1,v2,v1);  /* 0213 0213*/
  assign(v1,oph); 


  

   status(A);
      hsdelay(d1);
   status(B);
      pulse(pw, v1);
      delay(d2);
         if (declvlonoff)
            declvlon();         /* sets power to pplvl */
         else
            decpower(pplvl);
      simpulse(p1, pp, v1, v1, rof1, rof1);
         if (declvlonoff)
            declvloff();
         else
            decpower(dpwr);
      delay(d2);
   status(C);
}
Example #4
0
void pulsesequence()
{
   double          j1xh,
		   pwxlvl,
		   pwx,
		   tau;

   pwxlvl = getval("pwxlvl");
   pwx = getval("pwx");
   j1xh = getval("j1xh");
   tau = 1.0 / (2.0*j1xh);

  settable(t1, 4, ph1);
  settable(t2, 4, ph2);
  getelem(t1, ct, v1);
  getelem(t2, ct, oph);

/* BEGIN ACTUAL PULSE SEQUENCE CODE */
   status(A);
      decpower(pwxlvl);
      delay(d1);

   status(B);

      rgpulse(pw, zero, rof1, rof1);
      delay(tau - (2*pw/PI) - 2*rof1);
      simpulse(2*pw,pwx,v1,zero,rof1,rof2);
      decpower(dpwr);
      delay(tau - POWER_DELAY);

   status(C);
}
Example #5
0
void pulsesequence()
{
   int		rxgate;
   double	pp,
		pplvl;

   pp = getval("pp");
   pplvl = getval("pplvl");

   rxgate = (rof1 == 0.0);
   if (rxgate)
      rof1 = 1.0e-6;			/* phase switching time */

   if (newdecamp)
   {
      if (rxgate)
         rof1 = 40.0e-6;
   }

   status(A);
      hsdelay(d1);
   status(B);
      settable(t1,4,phasecycle);
      pulse(pw, t1);
      delay(d2);
      if (newdecamp)
      {
         pplvl  = getval("pplvl");
         decpower(pplvl);  /* sets DEC atten = pplvl */
      }
      else
      {
         declvlon();         /* sets dhp = 255 level */
      }

      simpulse(p1, pp, t1, t1, rof1, rof1);
      if (newdecamp)
      {
         decpower(dpwr);  /* sets DEC atten = dpwr */
      }
      else
      {
         declvloff();
      }

      delay(d2);
   status(C);
   setreceiver(t1);
}
Example #6
0
pulsesequence()
{
char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
	    f2180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            CCdseq[MAXSTR],
            CChomodec[MAXSTR],          /* Setup for C-imino - C-H6 */
	    pwC_Sel_Shape[MAXSTR],	       /* Selective C 180 refocusing pulse */
	    pwH_Sel_Shape[MAXSTR];	       /* Selective H 180 refocusing pulse */
 
int         icosel,          			  /* used to get n and p type */
            t1_counter,  		        /* used for states tppi in t1 */
	    ni2 = getval("ni2"),
            t2_counter;  		        /* used for states tppi in t2 */

double      tau1,         				          /* t1 delay */
	    tau2,         				          /* t2 delay */
            CCdpwr = getval("CCdpwr"),    /*   power level for CC decoupling */
            CCdres = getval("CCdres"),    /*   dres for CC decoupling */
            CCdmf = getval("CCdmf"),      /*   dmf for CC decoupling */

	    lambda = 1.0/(4*getval("JCH")),	   /* 1/4J H1 evolution delay */
	    taucc = 1.0/(4*getval("JCC")),	   /* 1/4J CC evolution delay */
	    delta_cc = 1.0/(4*getval("JCC")),	   /* 1/4J CC evolution delay */
	    pwH_Sel_pw = getval("pwH_Sel_pw"),	/* 180 Pulse selective pulse*/
	    pwH_Sel_lvl = getval("pwH_Sel_lvl"),	/* 180 Pulse selective pulse power level*/
	    pwC_Sel_pw = getval("pwC_Sel_pw"),	/* 180 C Pulse selective pulse*/
	    pwC_Sel_lvl = getval("pwC_Sel_lvl"),	/* 180 C Pulse selective pulse power level*/
            pwClvl = getval("pwClvl"), 	  	        /* coarse power for C13 pulse */
            pwC = getval("pwC"),     	      /* C13 90 degree pulse length at pwClvl */
            calC = getval("calC"),        /* multiplier on a pwC pulse for calibration */

            dofa,

            calH = getval("calH"),        /* multiplier on a pw pulse for H1 calibration */

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


	    sw1 = getval("sw1"),

            gstab = getval("gstab"),   /* Gradient recovery delay, probe-dependent */

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

	gt3 = getval("gt3"),
	gt4 = getval("gt4"),
	gt5 = getval("gt5"),
	gzlvl0 = getval("gzlvl0"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl4 = getval("gzlvl4"),
	gzlvl5 = getval("gzlvl5"),
	gzlvl6 = getval("gzlvl6");

    getstr("f1180",f1180);
    getstr("CCdseq",CCdseq);
    getstr("CChomodec",CChomodec);
    getstr("f2180",f2180);
    getstr("pwH_Sel_Shape",pwH_Sel_Shape);
    getstr("pwC_Sel_Shape",pwC_Sel_Shape);



/*   LOAD PHASE TABLE    */

        settable(t1,8,phi1);
        settable(t2,4,phi2);
	settable(t3,2,phi3);
	settable(t4,1,phi4);
	settable(t5,1,phi5);
	settable(t6,1,phi6);
	settable(t9,16,phi9);
	settable(t11,16,rec);

/* reset calH and calC if the user forgets */
  if (ni>1.0)
   {
	calH=1.0; calC=1.0;
   }

/* CHECK VALIDITY OF PARAMETER RANGES */

  if ((ni/sw1) > (4*taucc - 2*gt4))
  { text_error( " ni is too big. Make ni equal to %d or less.\n",    
      ((int)((4*taucc - 2*gt4)*sw1)) );					    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( dpwr > 49 )
  { text_error("don't fry the probe, DPWR too large!  ");   	    psg_abort(1); }

  if( dpwr2 > 47 )
  { 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 ( ni/sw1 > 4.0*taucc)
  { text_error( " ni is too big. Make ni equal to %d or less.\n",
      ((int)(4*taucc*sw1)) );                                       psg_abort(1); }

/* PHASES AND INCREMENTED TIMES */

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

	icosel=1;

	if (phase1 == 2) 
	{
		tsadd(t1,1,4);
		tsadd(t4,1,4);
		tsadd(t5,1,4);
	}

	if (phase2 == 2) 
	{
		tsadd(t6,2,4);
		icosel = -1;
	}
	else icosel = 1;

/*  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(t1,2,4);
	tsadd(t4,2,4);
	tsadd(t5,2,4);
	tsadd(t11,2,4);
   }

/* Calculate modifications to phases for States-TPPI acquisition          */
  if( ix == 1) d3_init = d3;

	t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );

/* BEGIN PULSE SEQUENCE */

status(A);
        dofa = dof - 35.0*dfrq; /*start at C2' */
	obspower(tpwr);
	decpower(pwClvl);
 	dec2power(pwNlvl);
	obsoffset(tof);
	decoffset(dofa);
	dec2offset(dof2);
	txphase(zero);
	decphase(zero);
        dec2phase(zero);

	delay(d1);
        rcvroff();

status(B);

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

   	rgpulse(calH*pw,zero,0.0,0.0);                 /* 1H pulse excitation */
   	decphase(t4);
        delay(2.0*lambda);
        decrgpulse(calC*pwC, t4, 0.0, 0.0);
	zgradpulse(gzlvl3, gt3);
	obspower(pwH_Sel_lvl);
   	decphase(zero);
        delay(taucc -lambda - gt3 - WFG2_START_DELAY - pwH_Sel_pw/2.0 + 70.0e-6);

        shaped_pulse(pwH_Sel_Shape, pwH_Sel_pw, zero, 0.0, 0.0);
        delay(lambda - pwH_Sel_pw/2.5);

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

        zgradpulse(gzlvl3, gt3);
	obspower(tpwr);
   	decphase(t5);
   	txphase(t2);
        delay(taucc - gt3);

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

        zgradpulse(gzlvl4, gt4);       	/* 2.0*GRADIENT_DELAY */
        txphase(zero);
	decphase(t3);
	delay(2*taucc + tau1 - gt4);

    	decrgpulse(2.0*pwC, t3, 0.0, 0.0);
        zgradpulse(gzlvl4, gt4);       	/* 2.0*GRADIENT_DELAY */
    	decphase(zero);
		
        delay(2.0*taucc - tau1 - gt4);

        dofa = dof - 17.5*dfrq; /*change to C1' */
	decoffset(dofa);
/*  ffffffffffffffffffff   BEGIN SENSITIVITY ENHANCE   fffffffffffffffffffff  */
        decrgpulse(pwC, zero, 0.0, 0.0);

if (CChomodec[A]=='y')
 {
	delay(delta_cc);
    	decrgpulse(2.0*pwC, zero, 0.0, 0.0);
	delay(delta_cc);
        decpower(CCdpwr); decphase(zero);
        decprgon(CCdseq,1.0/CCdmf,CCdres);
        decon();  /* CC decoupling on */
	delay(tau2);
    	dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
	delay(tau2);

        decoff(); decprgoff();        /* CC decoupling off */
	decpower(pwC_Sel_lvl);

        zgradpulse(icosel*gzlvl1, gt1/2.0);       	/* 2.0*GRADIENT_DELAY */
        delay(gstab);
        decshaped_pulse(pwC_Sel_Shape, pwC_Sel_pw, t9, 0.0, 0.0);
        zgradpulse(-1.0*icosel*gzlvl1, gt1/2.0);       	/* 2.0*GRADIENT_DELAY */
	decphase(t6);
        decpower(pwClvl);
        delay(gstab);
		
 }
else
 {
	decphase(zero);
        zgradpulse(icosel*gzlvl1, gt1/2.0);       	/* 2.0*GRADIENT_DELAY */
	delay(delta_cc + tau2);
    	decrgpulse(2.0*pwC, t9, 0.0, 0.0);
        zgradpulse(-1.0*icosel*gzlvl1, gt1/2.0);       	/* 2.0*GRADIENT_DELAY */
	decphase(t6);
	delay(delta_cc - tau2);
 }		
	simpulse(pw, pwC, zero, t6, 0.0, 0.0);
	decpower(pwC_Sel_lvl);
	decphase(two);
	zgradpulse(gzlvl5, gt5);
	delay(lambda - pwC_Sel_pw/2.0 - gt5);
        simshaped_pulse("",pwC_Sel_Shape, 2.0*pw,pwC_Sel_pw, zero, two, 0.0, 0.0);
	decpower(pwClvl);
	zgradpulse(gzlvl5, gt5);
	txphase(one);
	decphase(one);
	delay(lambda - pwC_Sel_pw/2.0 - gt5);
	simpulse(pw, pwC, one, one, 0.0, 0.0);
	decpower(pwC_Sel_lvl);
	txphase(zero);
	decphase(zero);
	zgradpulse(gzlvl6, gt5);
	delay(lambda - pwC_Sel_pw/2.0 - gt5);
        simshaped_pulse("",pwC_Sel_Shape, 2.0*pw,pwC_Sel_pw, zero, zero, 0.0, 0.0);
	zgradpulse(gzlvl6, gt5);
	delay(lambda - pwC_Sel_pw/2.0 - gt5);
	rgpulse(pw, zero, 0.0, 0.0);
        zgradpulse(gzlvl2, gt1/8.0);         		/* 2.0*GRADIENT_DELAY */
	delay(gstab/2-2.0*GRADIENT_DELAY);		
	rgpulse(2.0*pw, zero, 0.0, 0.0);
	decpower(dpwr);					       /* POWER_DELAY */
	dec2power(dpwr2);				      /* POWER_DELAY */
        zgradpulse(-1.0*gzlvl2, gt1/8.0);         		/* 2.0*GRADIENT_DELAY */
	delay(gstab/2 -2.0*POWER_DELAY-2.0*GRADIENT_DELAY);		
status(C);
		 
	setreceiver(t11);
}		 
Example #7
0
pulsesequence()

{
   double   gzlvlE = getval("gzlvlE"),
	    gtE = getval("gtE"),
	    EDratio = getval("EDratio"),
	    gstab = getval("gstab"),
	    mult = getval("mult"),
            hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            tau,
            evolcorr,
            taug;
   int	    icosel,
	    phase1 = (int)(getval("phase")+0.5),
	    ZZgsign;

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

   tau  = 1/(4*(getval("j1xh")));
   evolcorr = 2*pw+4.0e-6;

   if (mult > 0.5)
    taug = 2*tau;
   else
    taug = gtE + gstab + 2*GRADIENT_DELAY;
   ZZgsign=-1;
   if (mult == 2) ZZgsign=1;
   icosel = 1;

   settable(t1,4,ph1);
   settable(t2,2,ph2);
   settable(t3,8,ph3);
   settable(t4,16,ph4);
   settable(t5,16,ph5);

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

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

   add(v2,v14,v2);
   add(oph,v14,oph);

status(A);
   obspower(tpwr);

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

   if (satmode[0] == 'y')
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
        satpulse(satdly,zero,rof1,rof1);
     }
   else
	delay(d1);

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

   decpower(pwxlvl);

status(B);

      if (getflag("nullflg"))
      {
        rgpulse(0.5*pw,zero,rof1,rof1);
        delay(2*tau);
        simpulse(2.0*pw,2.0*pwx,zero,zero,rof1,rof1);
        delay(2*tau);
        rgpulse(1.5*pw,two,rof1,rof1);
        zgradpulse(hsglvl,hsgt);
        delay(1e-3);
      }

     rgpulse(pw,zero,rof1,rof1);
     delay(tau);
     simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
     delay(tau);
     rgpulse(pw,t1,rof1,rof1);
	zgradpulse(hsglvl,2*hsgt);
	delay(1e-3);
     decrgpulse(pwx,v2,rof1,2.0e-6);
     
      delay(d2/2);
     rgpulse(2*pw,zero,2.0e-6,2.0e-6);
      delay(d2/2);
     zgradpulse(gzlvlE,gtE);
     delay(taug - gtE - 2*GRADIENT_DELAY);
     simpulse(mult*pw,2*pwx,zero,zero,rof1,rof1);
     delay(taug + evolcorr); 
     
     decrgpulse(pwx,t4,2.0e-6,rof1);
	zgradpulse(ZZgsign*0.6*hsglvl,1.2*hsgt);
	delay(1e-3);
     rgpulse(pw,t3,rof1,rof1);
     delay(tau - (2*pw/PI) - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof2);
     decpower(dpwr);
     zgradpulse(icosel*2.0*gzlvlE/EDratio,gtE/2.0);
     delay(tau - gtE/2.0 - 2*GRADIENT_DELAY - POWER_DELAY);
   status(C);
}
Example #8
0
pulsesequence()
{
   double   hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            slpwT = getval("slpwT"),
            slpwrT = getval("slpwrT"),
            trim = getval("trim"),
            mixT = getval("mixT"),
            mult = getval("mult"),
            tau,
            null = getval("null");
   char     slpatT[MAXSTR];
   int	    phase1 = (int)(getval("phase")+0.5);

   tau  = 1/(4*(getval("j1xh")));
   getstr("slpatT",slpatT);

   if (strcmp(slpatT,"mlev17c") &&
        strcmp(slpatT,"dipsi2") &&
        strcmp(slpatT,"dipsi3") &&
        strcmp(slpatT,"mlev17") &&
        strcmp(slpatT,"mlev16"))
        abort_message("SpinLock pattern %s not supported!.\n", slpatT);

   settable(t1,8,phs1);
   settable(t2,8,phs2);
   settable(t3,2,phs3);
   settable(t4,1,phs4);
   settable(t5,4,phs5);

   getelem(t3,ct,v6);
   getelem(t2,ct,oph);

   assign(two,v3);
   sub(v3,one,v2);
   add(v3,one,v4);
   add(v3,two,v5);
/*
   mod2(id2,v14);
   dbl(v14,v14);
*/
  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v14);

   if (phase1 == 2)
      incr(v6);

   add(v14, v6, v6);
   add(v14, oph, oph);


/* BEGIN ACTUAL PULSE SEQUENCE CODE */
   status(A);

   obspower(tpwr);

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

   if (satmode[0] == 'y')
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
        satpulse(satdly,zero,rof1,rof1);
     }
   else
        delay(d1);

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

   decpower(pwxlvl);

status(B);
 
    if ((getflag("PFGflg")) && (getflag("nullflg")))
     {
        rgpulse(0.5*pw,zero,rof1,rof1);
        delay(2*tau);
        simpulse(2.0*pw,2.0*pwx,zero,zero,rof1,rof1);
        delay(2*tau);
        rgpulse(1.5*pw,two,rof1,rof1);
        zgradpulse(hsglvl,hsgt);
        delay(1e-3);
     }
     else if (null != 0.0)
     {
        rgpulse(pw,zero,rof1,rof1);
        delay(2*tau);
        simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
        delay(2*tau);
        rgpulse(pw,two,rof1,rof1);
        if (satmode[1] == 'y')
           satpulse(null,zero,rof1,rof1);
        else
           delay(null);
      }
    
      rgpulse(pw, t1, rof1, rof1);
      delay(2*tau - (2*pw/PI) - 2*rof1);

      decrgpulse(pwx, v6, rof1, 1.0e-6);
      if (d2 > 0.0)
       delay(d2/2.0 - pw - 3.0e-6 - (2*pwx/PI));
      else
       delay(d2/2.0);
      rgpulse(2.0*pw, t4, 2.0e-6, 2.0e-6);
      if (d2 > 0.0) 
       delay(d2/2.0 - pw - 3.0e-6 - (2*pwx/PI)); 
      else 
       delay(d2/2.0);
      decrgpulse(pwx, t5, 1.0e-6, rof1);
      obspower(slpwrT);
      decpower(dpwr);
      delay(2*tau - rof1 - 2*POWER_DELAY);

     if (mixT > 0.0)
     {
        rgpulse(trim,v5,0.0,0.0);
        if (dps_flag)
          rgpulse(mixT,v3,0.0,0.0);
        else
          SpinLock(slpatT,mixT,slpwT,v2,v3,v4,v5,v9);
     }

     if (mult > 0.5)
     {
      obspower(tpwr);
      obspower(pwxlvl);
      delay(2*tau - POWER_DELAY - rof1);
      simpulse(2*pw,mult*pwx,zero,zero,rof1,rof2);
      decpower(dpwr);
      delay(2*tau);
     }
     else
	delay(rof2);

   status(C);
}
Example #9
0
void pulsesequence()
{

/* DECLARE AND LOAD VARIABLES */

char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
            mag_flg[MAXSTR],      /* magic-angle coherence transfer gradients */
 	    TROSY[MAXSTR];			    /* do TROSY on N15 and H1 */
 
int         icosel,          			  /* used to get n and p type */
            t1_counter,  		        /* used for states tppi in t1 */
            t2_counter,  	 	        /* used for states tppi in t2 */
            PRexp,                          /* projection-reconstruction flag */
	    ni = getval("ni"),
	    ni2 = getval("ni2");

double      tau1,         				         /*  t1 delay */
            tau2,        				         /*  t2 delay */
	    tauCH = getval("tauCH"), 		         /* 1/4J delay for CH */
	    zeta = getval("zeta"),   /* zeta delay, 0.006 for 1D, 0.011 for 2D*/
            timeTN = getval("timeTN"),     /* constant time for 15N evolution */
	    timeCH = 1.1e-3,				      /* other delays */
	    timeAB = 3.3e-3,
	    kappa = 5.4e-3,
	    lambda = 2.4e-3,
            csa, sna,
            pra = M_PI*getval("pra")/180.0,
        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 */

/* 90 degree pulse at Cab(46ppm), first off-resonance null at CO (174ppm)     */
        pwC1,		              /* 90 degree pulse length on C13 at rf1 */
        rf1,		       /* fine power for 5.1 kHz rf for 600MHz magnet */

/* 180 degree pulse at Cab(46ppm), first off-resonance null at CO(174ppm)     */
        pwC2,		                    /* 180 degree pulse length at rf2 */
        rf2,		      /* fine power for 11.4 kHz rf for 600MHz magnet */

/* the following pulse lengths for SLP pulses are automatically calculated    */
/* by the macro "biocal".  SLP pulse shapes, "offC7" etc are called       */
/* directly from your shapelib.                    			      */
   pwC7,                     /* 180 degree selective sinc pulse on CO(174ppm) */
   rf7,	                           /* fine power for the pwC7 ("offC7") pulse */

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

   	pwH,	    		        /* H1 90 degree pulse length at tpwr1 */
   	tpwr1,	  	                     /* 9.2 kHz rf magnet for DIPSI-2 */
   	DIPSI2time,     	        /* total length of DIPSI-2 decoupling */
        ncyc_dec,
        waltzB1=getval("waltzB1"),

	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 conversion factor */
	gzlvl1 = getval("gzlvl1"),
	gzlvl2 = getval("gzlvl2"),

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

    getstr("f1180",f1180);
    getstr("f2180",f2180);
    getstr("mag_flg",mag_flg);
    getstr("TROSY",TROSY);
 
    csa = cos(pra);
    sna = sin(pra);


/*   LOAD PHASE TABLE    */

	settable(t3,1,phx);
	settable(t4,1,phx);
   if (TROSY[A]=='y')
       {settable(t8,2,phi8T);
	settable(t9,1,phx);
 	settable(t10,1,phy);
	settable(t11,1,phx);
	settable(t12,2,recT);}
    else
       {settable(t8,2,phi8);
	settable(t9,8,phi9);
	settable(t10,1,phx);
	settable(t11,1,phy);
	settable(t12,4,rec);}




/*   INITIALIZE VARIABLES   */

    if( dpwrf < 4095 )
	{ printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
	  psg_abort(1); }
 
    /* set zeta to 6ms for 1D spectral check, otherwise it will be the    */
    /* value in the dg2 parameter set (about 11ms) for 2D/13C and 3D work */
        if (ni>1)  zeta = zeta;
	else  zeta = 0.006;
	
    /* maximum fine power for pwC pulses */
	rf0 = 4095.0;

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

      if (autocal[0] == 'n') 
      {
    /* 90 degree pulse on Cab, null at CO 128ppm away */
	pwC1 = sqrt(15.0)/(4.0*128.0*dfrq);
        rf1 = 4095.0*(compC*pwC/pwC1);
	rf1 = (int) (rf1 + 0.5);
	
    /* 180 degree pulse on Cab, null at CO 128ppm away */
        pwC2 = sqrt(3.0)/(2.0*128.0*dfrq);
	rf2 = (4095.0*compC*pwC*2.0)/pwC2;
	rf2 = (int) (rf2 + 0.5);	
	if( rf2 > 4295 )
       { printf("increase pwClvl"); psg_abort(1);}
	if(( rf2 < 4296 ) && (rf2>4095)) rf2=4095;
	
    /* 180 degree one-lobe sinc pulse on CO, null at Ca 118m away */
        pwC7 = getval("pwC7");
	rf7 = (compC*4095.0*pwC*2.0*1.65)/pwC7;	/* needs 1.65 times more     */
	rf7 = (int) (rf7 + 0.5);		/* power than a square pulse */
	}
      else        /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
      {  
        if(FIRST_FID)                                            /* call Pbox */
        {          
          ppm = getval("dfrq"); 
          bw = 128.0*ppm; ofs = bw;           
          offC1 = pbox_Rcal("square90n", bw, compC*pwC, pwClvl);
          offC2 = pbox_Rcal("square180n", bw, compC*pwC, pwClvl); 
          bw = 118.0*ppm; 
          offC7 = pbox_make("offC7", "sinc180n", bw, ofs, compC*pwC, pwClvl);
          if (dm3[B] == 'y') H2ofs = 3.2;     
          ofs_check(H1ofs, C13ofs, N15ofs, H2ofs); 
        }
        pwC1 = offC1.pw; rf1 = offC1.pwrf;
        pwC2 = offC2.pw; rf2 = offC2.pwrf;
        pwC7 = offC7.pw; rf7 = offC7.pwrf;  

   /* Example of semi-automatic calibration - use parameters, if they exist : 

        if ((autocal[0] == 's') || (autocal[1] == 's'))       
        { 
          if (find("pwC1") > 0) pwC1 = getval("pwC1");
          if (find("rf1") > 0) rf1 = getval("rf1");
        }
   */
      }	
	
    /* power level and pulse times for DIPSI 1H decoupling */
	DIPSI2time = 2.0*zeta + 2.0*timeTN - 5.4e-3 + pwC1 + 5.0*pwN + gt3 + 5.0e-5 + 2.0*GRADIENT_DELAY + 3.0*POWER_DELAY;
        pwH=1.0/(4.0*waltzB1);

	ncyc_dec = (DIPSI2time*90.0)/(pwH*2590.0*4.0);
        ncyc_dec = (int) (ncyc_dec +0.5);

	pwH = (DIPSI2time*90.0)/(ncyc_dec*2590.0*4.0);   /* adjust pwH  */
	tpwr1 = 4095.0*(compH*pw/pwH);
	tpwr1 = (int) (2.0*tpwr1 + 0.5);  /* x2 because obs atten will be reduced by 6dB  */
 
/* CHECK VALIDITY OF PARAMETER RANGES */

    if ( 0.5*ni*1/(sw1) > timeAB - gt4 - WFG_START_DELAY - pwC7 )
       { printf(" ni is too big. Make ni equal to %d or less.\n",
         ((int)((timeAB - gt4 - WFG_START_DELAY - pwC7)*2.0*sw1))); psg_abort(1);}
    PRexp = 0;
    if((pra > 0.0) && (pra < 90.0)) PRexp = 1;

    if (PRexp) 
    {
      if( 0.5*ni*sna/sw1 > timeTN - WFG3_START_DELAY)
        { printf(" ni is too big. Make ni equal to %d or less.\n",
        ((int)((timeTN - WFG3_START_DELAY)*2.0*sw1/sna))); psg_abort(1);}
    }
    else 
    {
      if ( 0.5*ni2*1/(sw2) > timeTN - WFG3_START_DELAY)
       { printf(" ni2 is too big. Make ni2 equal to %d or less.\n", 
         ((int)((timeTN - WFG3_START_DELAY)*2.0*sw2))); psg_abort(1);}
    }

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

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

    if ( dm3[A] == 'y' || dm3[C] == 'y' )
       { printf("incorrect dec3 decoupler flags! Should be 'nyn' or 'nnn' ");
							             psg_abort(1);}
    if ( dpwr2 > 50 )
       { printf("dpwr2 too large! recheck value  "); psg_abort(1);}

    if ( pw > 20.0e-6 )
       { printf(" pw too long ! recheck value "); psg_abort(1);} 
  
    if ( pwN > 100.0e-6 )
       { printf(" pwN too long! recheck value "); psg_abort(1);} 
 
    if ( TROSY[A]=='y' && dm2[C] == 'y')
       { text_error("Choose either TROSY='n' or dm2='n' ! "); psg_abort(1);}


/* PHASES AND INCREMENTED TIMES */

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

    if (phase1 == 2)   tsadd(t3,1,4);  
    if (TROSY[A]=='y')
	 {  if (phase2 == 2)   				      icosel = +1;
            else 	    {tsadd(t4,2,4);  tsadd(t10,2,4);  icosel = -1;}
	 }
    else {  if (phase2 == 2)  {tsadd(t10,2,4); icosel = +1;}
            else 			       icosel = -1;    
	 }


/*  Set up f1180  */
   
    
    if(PRexp)                /* set up Projection-Reconstruction experiment */
      tau1 = d2*csa;
    else
      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  */

    if(PRexp)
      tau2 = d2*sna;
    else
    {
      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(t12,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(t12,2,4); }



/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   	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(zero);
   	delay(1.0e-5);
        if (TROSY[A] == 'n')
	dec2rgpulse(pwN, zero, 0.0, 0.0);  /*destroy N15 and C13 magnetization*/
	decrgpulse(pwC, zero, 0.0, 0.0);
	zgradpulse(gzlvl0, 0.5e-3);
	delay(1.0e-4);
        if (TROSY[A] == 'n')
	dec2rgpulse(pwN, one, 0.0, 0.0);
	decrgpulse(pwC, zero, 0.0, 0.0);
	zgradpulse(0.7*gzlvl0, 0.5e-3);
	delay(5.0e-4);

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

   	decphase(zero);
	zgradpulse(gzlvl0, gt0);
	delay(tauCH - gt0);

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

   	txphase(one);
	decphase(t3);
	zgradpulse(gzlvl0, gt0);
	delay(tauCH - gt0);

   	rgpulse(pw, one, 0.0, 0.0);
	zgradpulse(gzlvl3, gt3);
	delay(2.0e-4);
      if ( dm3[B] == 'y' )     /* begins optional 2H decoupling */
        {
          gt4=0.0;             /* no gradients during 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);
        }
   	decrgpulse(pwC, t3, 0.0, 0.0);                         	
								/* point a */	
	txphase(zero);
	decphase(zero);
        decpwrf(rf7);
     	delay(tau1);

						        /*  WFG3_START_DELAY  */
	sim3shaped_pulse("", "offC7", "", 0.0, pwC7, 2.0*pwN, zero, zero, zero, 
								     0.0, 0.0);

	zgradpulse(gzlvl4, gt4);
        decpwrf(rf2);	
        if ( pwC7 > 2.0*pwN)
     	   {delay(timeCH - pwC7 - gt4 - WFG3_START_DELAY - 2.0*pw);}
        else
     	   {delay(timeCH - 2.0*pwN - gt4 - WFG3_START_DELAY - 2.0*pw);}

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

     	delay(timeAB - timeCH);

     	decrgpulse(pwC2, zero, 0.0, 0.0);

	zgradpulse(gzlvl4, gt4);
        decpwrf(rf7);
     	delay(timeAB - tau1 - gt4 - WFG_START_DELAY - pwC7 - 2.0e-6);

 							/*  WFG_START_DELAY   */
     	decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
                                                              
	decpwrf(rf1);					       	/* point b */
   	decrgpulse(pwC1, zero, 2.0e-6, 0.0);                   		
	obspwrf(tpwr1); obspower(tpwr-6);				       /* POWER_DELAY */
	obsprgon("dipsi2", pwH, 5.0);		           /* PRG_START_DELAY */
	xmtron();
								/* point c */
	dec2phase(zero);
	decpwrf(rf2);
	delay(zeta - POWER_DELAY - PRG_START_DELAY);

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

	decpwrf(rf1);
	dec2phase(t8);
	delay(zeta);
								/* point d */
	decrgpulse(pwC1, zero, 0.0, 0.0);                        
        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 */
           }

/*  xxxxxxxxxxxxxxxxxx    OPTIONS FOR N15 EVOLUTION    xxxxxxxxxxxxxxxxxxxxx  */

	zgradpulse(gzlvl3, gt3);
        if (TROSY[A]=='y') { xmtroff(); obsprgoff(); }
 	delay(2.0e-4);
	dec2rgpulse(pwN, t8, 0.0, 0.0);
								/* point e */

	decpwrf(rf2);
	decphase(zero);
	dec2phase(t9);
	delay(timeTN - WFG3_START_DELAY - tau2);
							 /* WFG3_START_DELAY  */
	sim3pulse(0.0, pwC2, 2.0*pwN, zero, zero, t9, 0.0, 0.0);

	dec2phase(t10);
        decpwrf(rf7);

if (TROSY[A]=='y')
{
    if (tau2 > gt1 + 2.0*GRADIENT_DELAY + 1.0e-4)
	{
	  txphase(t4);
          delay(timeTN - pwC7 - WFG_START_DELAY);          /* WFG_START_DELAY */
          decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
          delay(tau2 - gt1 - 2.0*GRADIENT_DELAY - 1.0e-4);
          if (mag_flg[A]=='y')  magradpulse(gzcal*gzlvl1, gt1);
          else  zgradpulse(gzlvl1, gt1);   	/* 2.0*GRADIENT_DELAY */
	  obspwrf(4095.0); obspower(tpwr);				       /* POWER_DELAY */
	  delay(1.0e-4 - 2.0*POWER_DELAY);
	}
    else
	{
	  txphase(t4);
          delay(timeTN -pwC7 -WFG_START_DELAY -gt1 -2.0*GRADIENT_DELAY -1.0e-4);
          if (mag_flg[A]=='y')    magradpulse(gzcal*gzlvl1, gt1);
          else  zgradpulse(gzlvl1, gt1);	   	/* 2.0*GRADIENT_DELAY */
	  obspwrf(4095.0); obspower(tpwr);				       /* POWER_DELAY */
	  delay(1.0e-4 - 2.0*POWER_DELAY);                    /* WFG_START_DELAY */
          decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
          delay(tau2);
	}
}
else
{
    if (tau2 > kappa)
	{
          delay(timeTN - pwC7 - WFG_START_DELAY);     	   /* WFG_START_DELAY */
          decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
          delay(tau2 - kappa - PRG_STOP_DELAY);
          xmtroff();
          obsprgoff();					    /* PRG_STOP_DELAY */
	  txphase(t4);
          delay(kappa - gt1 - 2.0*GRADIENT_DELAY - 1.0e-4);
          if (mag_flg[A]=='y')    magradpulse(gzcal*gzlvl1, gt1);
          else    zgradpulse(gzlvl1, gt1);   	/* 2.0*GRADIENT_DELAY */
	  obspwrf(4095.0); obspower(tpwr);				       /* POWER_DELAY */
	  delay(1.0e-4 - 2.0*POWER_DELAY);
	}
    else if (tau2 > (kappa - pwC7 - WFG_START_DELAY))
	{
          delay(timeTN + tau2 - kappa - PRG_STOP_DELAY);
          xmtroff();
          obsprgoff();					    /* PRG_STOP_DELAY */
	  txphase(t4);                                     /* WFG_START_DELAY */
          decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
          delay(kappa -pwC7 -WFG_START_DELAY -gt1 -2.0*GRADIENT_DELAY -1.0e-4);
          if (mag_flg[A]=='y')    magradpulse(gzcal*gzlvl1, gt1);
          else    zgradpulse(gzlvl1, gt1);   	/* 2.0*GRADIENT_DELAY */
	  obspwrf(4095.0); obspower(tpwr);				       /* POWER_DELAY */
	  delay(1.0e-4 - 2.0*POWER_DELAY);
	}
    else if (tau2 > gt1 + 2.0*GRADIENT_DELAY + 1.0e-4)
	{
          delay(timeTN + tau2 - kappa - PRG_STOP_DELAY);
          xmtroff();
          obsprgoff();					    /* PRG_STOP_DELAY */
	  txphase(t4);
          delay(kappa - tau2 - pwC7 - WFG_START_DELAY);    /* WFG_START_DELAY */
          decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
          delay(tau2 - gt1 - 2.0*GRADIENT_DELAY - 1.0e-4);
          if (mag_flg[A]=='y')    magradpulse(gzcal*gzlvl1, gt1);
          else    zgradpulse(gzlvl1, gt1);   	/* 2.0*GRADIENT_DELAY */
	  obspwrf(4095.0); obspower(tpwr);				       /* POWER_DELAY */
	  delay(1.0e-4 - 2.0*POWER_DELAY);
	}
    else
	{
          delay(timeTN + tau2 - kappa - PRG_STOP_DELAY);
          xmtroff();
	  obsprgoff();					    /* PRG_STOP_DELAY */
	  txphase(t4);
    	  delay(kappa-tau2-pwC7-WFG_START_DELAY-gt1-2.0*GRADIENT_DELAY-1.0e-4);
          if (mag_flg[A]=='y')    magradpulse(gzcal*gzlvl1, gt1);
          else    zgradpulse(gzlvl1, gt1);   	/* 2.0*GRADIENT_DELAY */
	  obspwrf(4095.0); obspower(tpwr);				       /* POWER_DELAY */
	  delay(1.0e-4 - 2.0*POWER_DELAY);                    /* WFG_START_DELAY */
          decshaped_pulse("offC7", pwC7, zero, 0.0, 0.0);
          delay(tau2);
	}
}                                                            	/* point f */
/*  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  */
	if (TROSY[A]=='y')  rgpulse(pw, t4, 0.0, 0.0);
	else                sim3pulse(pw, 0.0, pwN, t4, zero, t10, 0.0, 0.0);

	txphase(zero);
	dec2phase(zero);
	zgradpulse(gzlvl5, gt5);
	if (TROSY[A]=='y')   delay(lambda - 0.65*(pw + pwN) - gt5);
	else   delay(lambda - 1.3*pwN - gt5);

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

	zgradpulse(gzlvl5, gt5);
	txphase(one);
	dec2phase(t11);
	delay(lambda - 1.3*pwN - gt5);

	sim3pulse(pw, 0.0, pwN, one, zero, t11, 0.0, 0.0);

	txphase(zero);
	dec2phase(zero);
	zgradpulse(gzlvl6, gt5);
	delay(lambda - 1.3*pwN - gt5);

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

	dec2phase(t10);
	zgradpulse(gzlvl6, gt5);
	if (TROSY[A]=='y')   delay(lambda - 1.6*pwN - gt5);
	else   delay(lambda - 0.65*pwN - gt5);

	if (TROSY[A]=='y')   dec2rgpulse(pwN, t10, 0.0, 0.0); 
	else    	     rgpulse(pw, zero, 0.0, 0.0); 

	delay((gt1/10.0) + 1.0e-4 +gstab - 0.5*pw + 2.0*GRADIENT_DELAY + POWER_DELAY);

	rgpulse(2.0*pw, zero, 0.0, rof1);
	dec2power(dpwr2);				       /* POWER_DELAY */
        if (mag_flg[A] == 'y')    magradpulse(icosel*gzcal*gzlvl2, gt1/10.0);
        else   zgradpulse(icosel*gzlvl2, gt1/10.0);            /* 2.0*GRADIENT_DELAY */
        delay(gstab);
        rcvron();
statusdelay(C,1.0e-4 - rof1);
   if (dm3[B]=='y') lk_sample();

	setreceiver(t12);
}		 
Example #10
0
void pulsesequence()
{
/* DECLARE VARIABLES */

 char        coshape[MAXSTR],   /* dec pattern for CO decoupling  */
             fhfdwt1[MAXSTR],   /* Flag to indicate half dwell start in t1 */
             fhfdwt2[MAXSTR];   /* Flag to indicate half dwell start in t2 */

 int       
	     satmove;

 double      tauhc,            /* 1 / 4*J[13C-H]     [~1.5ms]          */
	     tau1,		/* t1-evolution variable */
	     tau2,		/* t2-evolutionvariable */
             pwca,             /* PW90 for 13C nucleus                 */
             pwco,             /* PW90 for 13C carbonyl decoupling      */
             pwcalvl,           /* power level for 13C pulses on dec1   */
             pwcolvl,          /* power level for C=O decoupling pulse   */
             jch,              /* coupling for C-C  (set to 40 Hz   )  */
             ncyc,             /* # cycles through dipsi loop          */
             trim,             /* trim pulse length(sec)               */
             dipsipwr,         /* power level for 13C spin lock        */
             delta1,delta2;

/* LOAD VARIABLES */
  dipsipwr = getval("dipsipwr");
  ncyc = getval("ncyc");
  trim = getval("trim");
  sw1 = getval("sw1");
  sw2 = getval("sw2");
  pwca = getval("pwca");
  pwco = getval("pwco");
  pwcalvl = getval("pwcalvl");
  pwcolvl = getval("pwcolvl");
  jch = getval("jch");       /*   Use 152   [overestimate; true J ~140 ] */
  getstr("coshape",coshape);
  getstr("fhfdwt1",fhfdwt1);
  getstr("fhfdwt2",fhfdwt2);


/* calculate delays */
  tauhc = (1.0/(4*jch)); 
  delta1 = (1.0/(6.0*jch));
  delta2 = (delta1);
  satmove = (fabs(tof - satfrq) >= 0.2);

/* CHECK VALIDITY OF PARAMETER RANGE */

    if((dm[A] != 'n') || (dm[B] != 'n'))
    {
        printf("dm should be 'nnn' or 'nny' ");
        psg_abort(1);
    }

    if((dm2[A] != 'n') || (dm2[B] != 'n') || (dm2[C] != 'n'))
    {
        printf("dm2 should be 'nnn'  ");
        psg_abort(1);
    }

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


    if( pwcolvl > 60 )
    {
        printf("DCOPWR too large!");
        psg_abort(1);
    }

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

    if(( pwca > 2.5e-5 || pw > 2.5e-5 ))
    {
        printf("Pulsewidths [pw, pwca] must be shorter than 25 us. Abort."); 
        psg_abort(1);
    }


    if ( pwco > 2.0e-3 )
    {
        printf("PWCO must be less than 2 ms. Abort.");
        psg_abort(1);
    }
 
    if ( ncyc*217.33*p1 > 0.03)
    {
        printf("mixing time must be < 30ms! Abort.");
        psg_abort(1);
    }

    if (ncyc > 4)
    {
       printf("ncyc should be no greater than 4. Abort.");
       psg_abort(1);
    }


/* INITIALIZE VARIABLES */

  if(fhfdwt1[0] == 'y')
    tau1 = (d2 + 1/(2*sw1) );
  else
    tau1 = d2;

  if(fhfdwt2[0] == 'y')
    tau2 = (d3 + 1/(2*sw2));
  else
    tau2 = d3;

 initval(ncyc,v7);                 /* v7 is the dipsi loop counter */

	settable(t21,1,psi1);
	settable(t11,2,phi1);
	settable(t12,1,phi2);
	settable(t13,1,phi3);
	settable(t14,1,phi4);
	settable(t15,8,phi5);
	settable(t16,8,phi6);
	settable(t10,8,rec);
                                  /* Phase table:

                                     phi1 = t11 = 0 1


                                     phi2 = t12 = 0

                                     phi3 = t13 = 0 0 0 0 0 0 0 0

                                     phi3'= t14 = 1 1 1 1 1 1 1 1 


                                     phi5 = t15 = 0 0 1 1 2 2 3 3

                                     phi6 = t16 = 0 0 0 0 2 2 2 2

   THESE TO BE SOFTWARE-MODIFIED BASED ON t1, t2 VALUES:
                                     rec  = t10 = 0 2 2 0 0 2 2 0
				     psi1 = t21 = 0

                                     psi2 = t22 = 0
*/

 if(phase1==2) tsadd(t21,1,4);
 if(phase2==2) tsadd(t12,1,4);
 
 if(d2_index%2)
 {
	tsadd(t21,2,4);
	tsadd(t10,2,4);
 }
 if(d3_index%2)
 {
	tsadd(t12,2,4);
	tsadd(t10,2,4);
 }


/* BEGIN ACTUAL PULSE SEQUENCE */


status(A);
   if (satmode[A] == 'y')
   {
	if(satmove)
		obsoffset(satfrq);
	obspower(satpwr);
    	rgpulse(d1,zero,rof1,rof1);
	if(satmove)
		obsoffset(tof);
   }
   else
   {
    	delay(d1);
   }
   rcvroff();
   decphase(t13);
   obspower(tpwr);   /* Set transmitter power for hard 1H pulses */
   decpower(pwcalvl);
status(B);
   rgpulse(pw,t21,1.0e-5,0.0);                /* First 1H 90 degree pulse     */
   txphase(t11);
   if(tau1 < (2*pwca + pw))	/* first t1-value */
   {
	delay(tauhc - 2*pwca - 1.0e-6);  /* assuming pwca > pw */
     	decrgpulse(pwca,t13,0.0,0.0); /* 13C composite 180 deg pulse  */
	simpulse(2*pw, 2*pwca,t11, t14, 1.0e-6, 0.0);
     	decrgpulse(pwca,t13,1.0e-6,0.0); /* 13C composite 180 deg pulse  */
	txphase(one);
	decphase(t12);
	delay(tauhc - 2*pwca - 1.0e-6);  /* assuming pwca > pw */
   }
   else
   {
	delay(tauhc + tau1/2 - 2*pwca -1.0e-6); /* t1-evol. plus pol. trans. */
     	decrgpulse(pwca,t13,0.0,0.0); /* 13C composite 180 deg pulse  */
     	decrgpulse(2*pwca,t14,1.0e-6,0.0); /* 13C composite 180 deg pulse  */
     	decrgpulse(pwca,t13,0.0,0.0); /* 13C composite 180 deg pulse  */
	delay(tau1/2 - 2*pwca - pw);       /* continued t1-evol. */
        rgpulse(2*pw,t11,0.0,0.0);      /* proton echo pulse */
	txphase(one);
	decphase(t12);
	delay(tauhc - pw);
   }

   simpulse(pw,pwca,one,t12,1.0e-6,0.2e-6);
	decphase(zero);
      	decpower(pwcolvl);
        if(tau2/2 > POWER_DELAY)
           delay(tau2/2 - POWER_DELAY);     /* t2 evolution */
        else
           delay(tau2/2);
        decshaped_pulse(coshape,pwco,zero,0.0,0.0);
      	decpower(pwcalvl);
        delay(delta1 - pwco - POWER_DELAY - WFG_START_DELAY - WFG_STOP_DELAY - pw);
        rgpulse(2*pw,zero,0.0,0.0);
        if (tau2/2 > (pw + pwca))
          delay(tau2/2 - pw -pwca);         /* t2 evolution */
        else
          delay(tau2/2);
      	decrgpulse(2*pwca,t15,0.0,0.0);
	decphase(t16);
        decpower(dipsipwr);
        delay(delta1 - pwca - POWER_DELAY);
       if (ncyc>0.0)
       {
         decrgpulse(trim,t16,0.0,0.0); 
         starthardloop(v7);
          dipsi3a(); dipsi3b(); dipsi3b(); dipsi3a();
         endhardloop();
       }
        txphase(zero); decphase(zero);
      	decpower(pwcalvl);
        delay(delta2 - POWER_DELAY - pwca);
        simpulse(2*pw,2*pwca,zero,zero,0.0,0.0);
        txphase(t13);
        delay(delta2);
     /* start reversed INEPT */
        simpulse(pw,pwca,t13,zero,0.0,0.0);
   decphase(zero);
   txphase(zero);
   delay(tauhc - 2*pwca - 1.0e-6);    /* delay = 1/4J     */
   decrgpulse(pwca,zero,0.0,0.0);
   simpulse(2*pw,2*pwca,zero,one,1.0e-6,0.0);
   decrgpulse(pwca,zero,1.0e-6,rof2);
   delay(tauhc - 2*pwca - 1.0e-6 - rof2);     /* delay = 1/4J       */
   decrgpulse(pwca,zero,0.0,0.0);  /* Filter out IySz terms        */
   decrgpulse(pwca,t16,1.0e-6,0.0);
   decpower(dpwr);           /* Set power for decoupling     */

/* BEGIN ACQUISITION */
   setreceiver(t10);
status(C);
}
Example #11
0
pulsesequence()
{
/* DECLARE VARIABLES */

 char       autocal[MAXSTR],  /* auto-calibration flag */
            fsat[MAXSTR],
	    fscuba[MAXSTR],
            f1180[MAXSTR],    /* Flag to start t1 @ halfdwell             */
            f2180[MAXSTR],    /* Flag to start t2 @ halfdwell             */
            c180_flg[MAXSTR],
            codecseq[MAXSTR],
            mess_flg[MAXSTR],
            ch_shp1[MAXSTR], /* shape for the 1st purge CHIRP */
            ch_shp2[MAXSTR], /* shape for the 2nd purge CHIRP */
            chshpi[MAXSTR]; /* shape for the INEPT CHIRPs */

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

 double      tau1,         /*  t1 delay */
             tau2,         /*  t2 delay */
             ni2,
             mix,         /* mixing time in seconds */
             pwC,          /* PW90 for c nucleus @ pwClvl         */
             pwcodec,      /* PW for C' nucleus @ dpwrco seduce dec  */
             tsatpwr,      /* low level 1H trans.power for presat  */
             pwClvl,        /* power level for 13C pulses on dec1  */
             dpwrco,       /* power level for C' seduce decoupling  */
             sw1,          /* sweep width in f1                    */
             sw2,          /* sweep width in f2                    */
             tofps,        /* tof for presat                       */ 
             dressed,      /* decoupler resolution for seduce decoupling */
             tpwrmess,    /* power level for Messerlie purge */
             dly_pg1,     /* duration of first part of purge */
             dly_wt,
             taua1,       /* Delay for the first purge CHIRP */
             taua2,       /* Delay for the  second purge CHIRP */
                 
             pwchirp1,	/* duration of the 1st purge CHIRP */
             pwchirp2,	/* duration of the 2nd purge CHIRP */
             d_me1,     /* time difference between 
			start of the sweep and the 
			excitation of the methyl region
			automatically calculated by the program
		 	necessary parameter diff (see below) */
             d_me2,     /* time difference between 
			start of the sweep and the 
			excitation of the methyl region
			automatically calculated by the program
		 	necessary parameter diff (see below) */
             dchrp1,	/* power for the 1st purge CHIRP pulse, only lower
			limit is important (see above!) */
             dchrp2,	/* power for the 2nd purge CHIRP pulse, only lower
			limit is important (see above!) */
             dmfchp1,	/* dmf (1/90) for the 1st purge CHIRP pulse
			dmfchp1 = 1/time_step of chirp-pulse
			[time_step = pwchirp1/no. of points in
			the .DEC-shape] */
             dmfchp2,	/* dmf (1/90) for the 1st purge CHIRP pulse
			dmfchp2 = 1/time_step of chirp-pulse
			[time_step = pwchirp2/no. of points in
			the .DEC-shape] */
             dres_chp,	/* dres for the chirp pulse 
			(must be set to 90, otherwise
			timing errors! ) */
             diff1,	/* shift differences between 
			methyl region and start of sweep */
             diff2,	/* shift differences between 
			methyl region and start of sweep */
             rate1,	/* sweep rate of the 1st purge CHIRP pulse
			frequency sweep/pwchirp1   */
             rate2,	/* sweep rate of the 2nd purge CHIRP pulse
			frequency sweep/pwchirp2   */
             dchrpi,
             dmfchpi,
             pwchirpi,    /* INEPT CHIRP duration */
             ratei,
             diffi,
             tauf,
             d_mei,  
             compC,        /* C-13 RF calibration parameters */

             gt0,
             gt1,
             gt2,
             gt3,
             gt4,
             gt5,
             gt8,
             gt9,
             gt10,
             gt11,
             gstab,
             gzlvl0, 
             gzlvl1, 
             gzlvl2, 
             gzlvl3, 
             gzlvl4, 
             gzlvl5,
             gzlvl8, 
             gzlvl9,
             gzlvl10,
             gzlvl11;

/*  variables commented out are already defined by the system      */


/* LOAD VARIABLES */


  getstr("autocal",autocal);
  getstr("fsat",fsat);
  getstr("f1180",f1180);
  getstr("f2180",f2180);
  getstr("fscuba",fscuba);
  getstr("c180_flg",c180_flg);
  getstr("mess_flg",mess_flg);


  tofps  = getval("tofps");
  mix = getval("mix");
  pwC = getval("pwC");
  tpwr = getval("tpwr");
  tsatpwr = getval("tsatpwr");
  pwClvl = getval("pwClvl");
  dpwr = getval("dpwr");
  dpwr2 = getval("dpwr2");
  phase = (int) ( getval("phase") + 0.5);
  phase2 = (int) ( getval("phase2") + 0.5);
  sw1 = getval("sw1");
  sw2 = getval("sw2");
  ni2 = getval("ni2");
  tpwrmess = getval("tpwrmess");
  dly_pg1 = getval("dly_pg1");
  dly_wt = getval("dly_wt");
  taua1 = getval("taua1");
  taua2 = getval("taua2");
  
  rate1 = getval("rate1");
  rate2 = getval("rate2");
  diff1 = getval("diff1");
  diff2 = getval("diff2");
  diffi = getval("diffi");
  ratei = getval("ratei");

  tauf = getval("tauf");

  gt0 = getval("gt0");
  gt1 = getval("gt1");
  gt2 = getval("gt2");
  gt3 = getval("gt3");
  gt4 = getval("gt4");
  gt5 = getval("gt5");
  gt8 = getval("gt8");
  gt9 = getval("gt9");
  gt10 = getval("gt10");
  gt11 = getval("gt11");
  gstab = getval("gstab");
  gzlvl0 = getval("gzlvl0");
  gzlvl1 = getval("gzlvl1");
  gzlvl2 = getval("gzlvl2");
  gzlvl3 = getval("gzlvl3");
  gzlvl4 = getval("gzlvl4");
  gzlvl5 = getval("gzlvl5");
  gzlvl8 = getval("gzlvl8");
  gzlvl9 = getval("gzlvl9");
  gzlvl10 = getval("gzlvl10");
  gzlvl11 = getval("gzlvl11");

  if(autocal[0]=='n')
  {     
    getstr("codecseq",codecseq);
    dressed = getval("dressed");
    pwcodec = getval("pwcodec");
    dpwrco = getval("dpwrco");
    getstr("ch_shp1",ch_shp1);
    getstr("ch_shp2",ch_shp2);
    pwchirp1 = getval("pwchirp1");
    pwchirp2 = getval("pwchirp2");
    dchrp1 = getval("dchrp1");
    dchrp2 = getval("dchrp2");
    dmfchp1 = getval("dmfchp1");
    dmfchp2 = getval("dmfchp2");
    dres_chp = getval("dres_chp");
    getstr("chshpi",chshpi);
    dchrpi = getval("dchrpi");
    dmfchpi = getval("dmfchpi");
    pwchirpi = getval("pwchirpi");
  }
  else
  {    
    strcpy(codecseq,"Psed_108p");
    strcpy(ch_shp1,"Pwurst180_1");
    strcpy(ch_shp2,"Pwurst180_2");
    strcpy(chshpi,"Pwurst180i");
    if (FIRST_FID)
    {
      compC = getval("compC"); 
      codec = pbox(codecseq, CODEC, CODECps, dfrq, compC*pwC, pwClvl);
      chirp1 = pbox(ch_shp1, CHIRP1, CHIRPps, dfrq, compC*pwC, pwClvl);
      chirp2 = pbox(ch_shp2, CHIRP2, CHIRPps, dfrq, compC*pwC, pwClvl);
      chirpi = pbox(chshpi, CHIRPi, CHIRPps, dfrq, compC*pwC, pwClvl);
    }
    dpwrco = codec.pwr;      pwcodec = 1.0/codec.dmf;  dressed = codec.dres;
    dchrp1 = chirp1.pwr;     dmfchp1 = chirp1.dmf;
    pwchirp1 = chirp1.pw;    dres_chp = chirp1.dres;       
    dchrp2 = chirp1.pwr;     dmfchp2 = chirp2.dmf;
    pwchirp2 = chirp2.pw;     
    dchrpi = chirpi.pwr;     dmfchpi = chirpi.dmf;
    pwchirpi = chirpi.pw;     
  }   
  
/* LOAD PHASE TABLE */

  settable(t1,8,phi1);
  settable(t2,16,phi2);
  settable(t4,16,rec);
  settable(t5,4,phi5);
  settable(t6,2,phi6);
  settable(t7,4,phi7);

/* CHECK VALIDITY OF PARAMETER RANGES */


    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! Should be 'nnn' ");
        psg_abort(1);
    }

    if( tsatpwr > 6 )
    {
        printf("TSATPWR too large !!!  ");
        psg_abort(1);
    }

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

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

    if( dpwr2 > 46 )
    {
        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( pwC > 200.0e-6 )
    {
        printf("dont fry the probe, pwC too high ! ");
        psg_abort(1);
    } 

    if( pwcodec < 300.0e-6 )
    {
        printf("dont fry the probe, pwcodec too high ! ");
        psg_abort(1);
    } 
    if ( tpwrmess > 56 )
    {
        printf("dont fry the probe, tpwrmess too high ! ");
        psg_abort(1);
    }
    if ( dly_pg1 > 0.010)
    {
        printf("dont fry the probe, dly_pg1 too long ! ");
        psg_abort(1);
    }

    if( gt0 > 15e-3 || gt1 > 15e-3 || gt2 > 15e-3 
           || gt3 > 15e-3 || gt4 > 15e-3  
           || gt5 > 15e-3 
           || gt8 > 15e-3 
           || gt9 > 15e-3 || gt10 > 15e-3 || gt11 > 15e-3  ) 
    {
        printf("gti values < 15e-3\n");
        psg_abort(1);
    } 

   if( gzlvl3*gzlvl4 > 0.0 ) 
    {
        printf("gt3 and gt4 must be of opposite sign \n");
        printf("for optimal water suppression\n");
        psg_abort(1);
     }

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

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

    if( pwchirp1 > 10.e-03 )
    {
        printf("don't fry the probe, pwchirp1 too large!  ");
        psg_abort(1);
    }

    if( pwchirp2 > 10.e-03 )
    {
        printf("don't fry the probe, pwchirp2 too large!  ");
        psg_abort(1);
    }

	d_me1 = diff1/rate1 ;
	d_me2 = diff2/rate2 ;

    if( d_me1 > 10.e-03 )
    {
        printf("don't fry the probe, d_me1 too large \n");
	printf("	(must be less than 10 msec)!  ");
        psg_abort(1);
    }
    if( d_me2 > 10.e-03 )
    {
        printf("don't fry the probe, d_me2 too large \n");
	printf("	(must be less than 10 msec)!  ");
        psg_abort(1);
    }

    if( d_me1 > pwchirp1 )
    {
        printf("impossible; d_me1 > pwchirp1 !  ");
        psg_abort(1);
    }

    if( d_me2 > pwchirp2 )
    {
        printf("impossible; d_me2 > pwchirp2 !  ");
        psg_abort(1);
    }


    if( dchrpi > 60 )
    {
       printf("dont fry the probe, dchrpi too large\n");
       psg_abort(1);
    }

    if(pwchirpi > 10.0e-3)
    {
        printf("don't fry the probe, pwchirpi too large!  ");
        psg_abort(1);
    }

    d_mei = diffi/ratei;

/*  Phase incrementation for hypercomplex 2D data */

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

/*  Set up f1180  tau1 = t1               */
   
    tau1 = d2;
    if(f1180[A] == 'y') {
        tau1 += ( 1.0 / (2.0*sw1) - 4.0/PI*pw - 2.0e-6 );
    }

    else
        tau1 = tau1 - 4.0/PI*pw - 2.0e-6;

    if(tau1 < 0.2e-6) tau1 = 2.0e-7;

/*  Set up f2180  tau2 = t2               */

    tau2 = d3;
    if(f2180[A] == 'y') {
        tau2 += ( 1.0 / (2.0*sw2) - (4.0/PI)*pwC 
             - 2.0*pw - PRG_START_DELAY - PRG_STOP_DELAY 
             - 2.0*POWER_DELAY - 4.0e-6); 
    }

    else tau2 = tau2 - ((4.0/PI)*pwC + 2.0*pw 
               + PRG_START_DELAY + PRG_STOP_DELAY 
               + 2.0*POWER_DELAY + 4.0e-6); 

        if(tau2 < 0.2e-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(t4,2,4);    
    }

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

   
   

/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   delay(5.0e-6);
   obspower(tsatpwr);      /* Set transmitter power for 1H presaturation */
   decpower(pwClvl);        /* Set Dec1 power for hard 13C pulses         */
   delay(5.0e-6);

/* Presaturation Period */

   if (mess_flg[A] == 'y') {

      obsoffset(tofps);
      obspower(tpwrmess);
      txphase(zero);
      rgpulse(dly_pg1,zero,2.0e-6,2.0e-6);
      txphase(one);
      rgpulse(dly_pg1/1.62,one,2.0e-6,2.0e-6);

      obspower(tsatpwr);
   }

   if (fsat[0] == 'y')
   {
        obsoffset(tofps);
	delay(2.0e-5);
    	rgpulse(d1,zero,2.0e-6,2.0e-6); /* presat */
   	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*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);
   decphase(zero);

/* Begin Pulses */

status(B);

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

   rgpulse(pw,t6,4.0e-6,0.0);            /* 90 deg 1H pulse */

   txphase(zero); decphase(zero);
 
   delay(2.0e-6);
   zgradpulse(gzlvl8,gt8);
   delay(gstab);

   delay(taua1 - gt8 - gstab -2.0e-6 - POWER_DELAY - 4.0e-6 
         - PRG_START_DELAY - d_me1); 

         
   /* 1st purge CHIRP inversion  on */

   decpower(dchrp1);  /* Set power for 1st purge CHIRP inversion */
   delay(4.0e-6);

   decprgon(ch_shp1,1.0/dmfchp1,dres_chp);
   decon();

   delay(d_me1);
   
   rgpulse(2*pw,zero,0.0,0.0);       /* 1H  inversion pulse */

   delay(pwchirp1 - d_me1 - 2*pw);
   decoff();
   decprgoff();

   /* chirp inversion  off */

   delay(2.0e-6);
   zgradpulse(gzlvl8,gt8);
   delay(gstab);

   delay(taua1 + 2*pw - (pwchirp1 - d_me1) 
          - PRG_STOP_DELAY  - gt8 - gstab -2.0e-6); 
 
   rgpulse(pw,zero,0.0,0.0);

   txphase(t7);

   delay(2.0e-6);
   zgradpulse(gzlvl9,gt9);
   delay(2.0*gstab); 
  
   rgpulse(pw,t7,0.0,0.0); 		/* PHASE t7 = 2(x),2(-x)*/

   delay(2.0e-6);
   zgradpulse(gzlvl11,gt11);
   delay(gstab);

   decphase(zero); txphase(zero);

   delay(taua2 - gt11 - gstab -2.0e-6 - POWER_DELAY 
        - 4.0e-6 - PRG_START_DELAY - d_me2);

   /* Second chirp inversion  on */

   decpower(dchrp2);  /* Set power for chirp inversion */
   delay(4.0e-6);
   decprgon(ch_shp2,1.0/dmfchp2,dres_chp);
   decon();

   delay(d_me2);

   rgpulse(2*pw,zero,0.0,0.0);        /* 1H inversion pulse */
   
   delay(pwchirp2 - d_me2 - 2*pw);
   decoff();
   decprgoff();

   /* Second purge CHIRP off */

   delay(2.0e-6);
   zgradpulse(gzlvl11,gt11);
   delay(gstab);

   txphase(zero);

   delay(taua2 + 2*pw - (pwchirp2 - d_me2) 
         - PRG_STOP_DELAY - gt11 - gstab -2.0e-6 );

   rgpulse(pw,zero,0.0,0.0);  

   delay(2.0e-6);
   zgradpulse(gzlvl10,gt10);
   delay(2.0*gstab); 

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

   delay(tau1);

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

   delay(mix - 10.0e-3);

   delay(2.0e-6);
   zgradpulse(gzlvl0,gt0);

   decpower(pwClvl);  /* Set power for hard pulses */

   delay(4.0e-6);

   decrgpulse(pwC,zero,0.0,0.0); 

   delay(2.0e-6);
   zgradpulse(gzlvl1,gt1);
   delay(2.0e-6);
   decphase(zero);

   delay(10.0e-3 - gt1 - gt0 - 8.0e-6);
   
   rgpulse(pw,zero,0.0,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl2,gt2);
   delay(gstab);

  decphase(zero);
  delay(tauf - gt2 - gstab -2.0e-6 - POWER_DELAY - 4.0e-6 
       - PRG_START_DELAY - d_mei);

   /* INEPT CHIRP inversion  on */

   decpower(dchrpi);  /* Set power for chirp inversion */
   delay(4.0e-6);
   decprgon(chshpi,1.0/dmfchpi,dres_chp);
   decon();

   delay(d_mei);

   rgpulse(2*pw,zero,0.0,0.0);  /* 1H inversion pulse */

   delay(pwchirpi - d_mei - 2*pw);
   decoff();
   decprgoff();

   /* chirp inversion  off */

   delay(2.0e-6);
   zgradpulse(gzlvl2,gt2);
   delay(gstab);

   txphase(one); 

   delay(tauf + 2*pw - (pwchirpi - d_mei) 
       - PRG_STOP_DELAY - gt2 - gstab -2.0e-6 );

  rgpulse(pw,one,0.0,0.0);

  txphase(zero); decphase(t2);

   decpower(pwClvl);  /* Set power for C13 hard pulse */
  

   delay(2.0e-6);
   zgradpulse(gzlvl3,gt3);
   delay(200.0e-6);

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

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

   delay(2.0e-6);

   /* CO decoupling on */
   decpower(dpwrco);
   decprgon(codecseq,pwcodec,dressed);
   decon();
   /* CO decoupling on */

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

   delay(tau2);

   /* CO decoupling off */
   decoff();
   decprgoff();
   decpower(pwClvl);
   /* CO decoupling off */

   delay(2.0e-6);

  }

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

  decrgpulse(pwC,zero,0.0,0.0);  

   delay(2.0e-6);
   zgradpulse(gzlvl4,gt4);
   delay(200.0e-6);

   rgpulse(pw,t5,2.0e-6,0.0);

   txphase(zero);

   delay(2.0e-6);
   zgradpulse(gzlvl5,gt5);
   delay(gstab);

  decphase(zero);
  delay(tauf - gt5 - gstab -2.0e-6 - POWER_DELAY 
       - 4.0e-6 - PRG_START_DELAY - d_mei);

   /* 2nd INEPT CHIRP inversion  on */

   decpower(dchrpi);  /* Set power for chirp inversion */
   delay(4.0e-6);
   decprgon(chshpi,1.0/dmfchpi,dres_chp);
   decon();

   delay(d_mei);

   rgpulse(2*pw,zero,0.0,0.0);  /* 1H inversion pulse */

   delay(pwchirpi - d_mei - 2*pw);
   decoff();
   decprgoff();

   /* chirp inversion  off */

   delay(2.0e-6);
   zgradpulse(gzlvl5,gt5);
   delay(gstab);

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

   txphase(t5); 

   delay(tauf + 2*pw - (pwchirpi - d_mei) - PRG_STOP_DELAY 
          - gt5 - gstab -2.0e-6 - 2*POWER_DELAY);

   rgpulse(pw,t5,0.0,0.0);
    

/* BEGIN ACQUISITION */

status(C);
   setreceiver(t4);

}
Example #12
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);

}
Example #13
0
pulsesequence()
{

/* DECLARE VARIABLES */

char	pw11[MAXSTR],	    /* off resonance 1-1 type proton excitation pulse */
	URA[MAXSTR],				  /* Setup for U-imino - U-H6 */
	CYT[MAXSTR],				  /* Setup for C-imino - C-H6 */
	CP[MAXSTR],					  /* CP H->N transfer */
	INEPT[MAXSTR],				       /* INEPT H->N transfer */
	C13refoc[MAXSTR],                         /* C13 pulse in middle of t1*/
	f1180[MAXSTR];                        /* Flag to start t1 @ halfdwell */

int	t1_counter;

double      tau1,                                                /*  t1 delay */
	    lambda = 0.94/(4.0*getval("JCH")),        /* 1/4J C-H INEPT delay */
	    lambdaN = 0.94/(4.0*getval("JNH")),       /* 1/4J N-H INEPT delay */
            tCC = 1.0/(4.0*getval("JCC")),            /* 1/4J C-C INEPT delay */

        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 */

        pwNlvl = getval("pwNlvl"),                    /* power for N15 pulses */
        pwN = getval("pwN"),          /* N15 90 degree pulse length at pwNlvl */
        rfN,                      /* maximum fine power when using pwN pulses */
        compN = getval("compN"),  /* adjustment for N15 amplifier compression */

        tpwr = getval("tpwr"),    	               /* power for H1 pulses */
        pw = getval("pw"),               /* H1 90 degree pulse length at tpwr */
        rfH,                       /* maximum fine power when using pw pulses */
	compH = getval("compH"),   /* adjustment for H1 amplifier compression */


        tof_75,                  /* tof shifted to 7.5 ppm for H4-N4 transfer */
        tof_12,                   /* tof shifted to 12 ppm for H3-N3 transfer */

	dof_169,		 /* dof shifted to 169 ppm for N3-C4 transfer */
	dof_140,     /* dof shifted to 140 ppm for C4-C5-C6 transfer and DEC1 */

	dof2_97,       /* dof2 shifted to 97 ppm for H4-N4 and N4-C4 transfer */
        dof2_160,     /* dof2 shifted to 160 ppm for H3-N3 and N3-C4 transfer */

/* p_d is used to calculate the isotropic mixing */
        p_d,                 /* 50 degree pulse for DIPSI-3 at rfdC-rfdN-rfdH */
        rfdC,             /* fine C13 power for 1.9 kHz rf for 500MHz magnet  */
        rfdN,             /* fine N15 power for 1.9 kHz rf for 500MHz magnet  */
        rfdH,              /* fine H1 power for 1.9 kHz rf for 500MHz magnet  */
        ncyc_hn = getval("ncyc_hn"),  /* number of pulsed cycles in HN half-DIPSI-3 */
        ncyc_nc = getval("ncyc_nc"), /* number of pulsed cycles in NC DIPSI-3 */

	sw1 = getval("sw1"),
        grecov = getval("grecov"),

        pwHs = getval("pwHs"),         /* H1 90 degree pulse length at tpwrs */
        tpwrs,                   /* power for the pwHs ("rna_H2Osinc") pulse */

        pwHs2 = getval("pwHs2"),       /* H1 90 degree pulse length at tpwrs2 */
        tpwrs2,                           /* power for the pwHs2 square pulse */


  gzlvl0 = getval("gzlvl0"),
  gzlvl3 = getval("gzlvl3"),
  gt3 = getval("gt3"),
  gzlvl4 = getval("gzlvl4"),
  gt4 = getval("gt4"),
  gzlvl5 = getval("gzlvl5"),
  gt5 = getval("gt5"),
  gzlvlr = getval("gzlvlr");

  getstr("pw11",pw11);
  getstr("URA",URA);
  getstr("CYT",CYT);
  getstr("CP",CP);
  getstr("INEPT",INEPT);
  getstr("C13refoc",C13refoc);
  getstr("f1180",f1180);


/* LOAD PHASE TABLE */
 
	settable(t1,2,phi1);
	settable(t3,8,phi3);
	settable(t4,4,phi4);
	settable(t5,16,phi5);
  if ( CP[A] == 'y' )
	settable(t10,8,rec1);
  if ( INEPT[A] == 'y' )
	settable(t10,16,rec2);


/* INITIALIZE VARIABLES */

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

/* maximum fine power for pwN pulses */
        rfN = 4095.0;

/* maximum fine power for pw pulses */
        rfH = 4095.0;

/* different offset values tof=H2O, dof=110ppm, dof2=200ppm */

	tof_75 = tof + 2.5*sfrq;        /* tof shifted to nH2 */
	tof_12 = tof + 7.0*sfrq;	/* tof shifted to nH */
	dof_169 = dof + 59*dfrq;	/* dof shifted to C4 */
	dof_140 = dof + 30*dfrq;	/* dof shifted to C6 */
	dof2_160 = dof2 - 40*dfrq2;	/* dof2 shifted to Nh */
	dof2_97 = dof2 - 103*dfrq2;     /* dof2 shifted to Nh2 */

/* 1.9 kHz DIPSI-3 at 500MHz*/
        p_d = (5.0)/(9.0*4.0*1900.0*(sfrq/500.0)); /* 1.9 kHz DIPSI-3 at 500MHz*/

/* fine C13 power for dipsi-3 isotropic mixing on C4 region */
        rfdC = (compC*4095.0*pwC*5.0)/(p_d*9.0);
        rfdC = (int) (rfdC + 0.5);

/* fine N15 power for dipsi-3 isotropic mixing on Nh region */
        rfdN = (compN*4095.0*pwN*5.0)/(p_d*9.0);
        rfdN = (int) (rfdN + 0.5);

/* fine H1 power for half dipsi-3 isotropic mixing on nH2 region */
        rfdH = (compH*4095.0*pw*5.0)/(p_d*9.0);
        rfdH = (int) (rfdH + 0.5);

/* selective H20 one-lobe sinc pulse */
        tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69));   /* needs 1.69 times more */
        tpwrs = (int) (tpwrs);                   /* power than a square pulse */

/* selective H20 square pulse */
        tpwrs2 = tpwr - 20.0*log10(pwHs2/(compH*pw));
        tpwrs2 = (int) (tpwrs2);

/* number of cycles and mixing time */
        ncyc_nc = (int) (ncyc_nc + 0.5);
	ncyc_hn = (int) (ncyc_hn + 0.5);

  if (ncyc_nc > 0 )
   {
        printf("NC-mixing time is %f ms.\n",(ncyc_nc*51.8*4*p_d));
   }

  if (CP[A] == 'y')
   {
    if (ncyc_hn > 0 )
        printf("HN-mixing time is %f ms.\n",(ncyc_hn*51.8*2*p_d));
   }

/* PHASES AND INCREMENTED TIMES */

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

    if (phase1 == 2)
         tsadd(t1,1,4);

/* 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(t10,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;


/* CHECK VALIDITY OF PARAMETER RANGE */


    if( sfrq > 610 )
        { printf("Power Levels at 750/800 MHz may be too high for probe");
          psg_abort(1); }

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

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

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

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

    if( ((dm[C] == 'y') && (dm2[C] == 'y') && (at > 0.18)) )
    {
        text_error("check at time! Don't fry probe !! ");
        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);
    }

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

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

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

    if (gzlvlr > 500 || gzlvlr < -500)
    {
	text_error(" RDt1-gzlvlr must be -500 to 500 (0.5G/cm) \n");
	psg_abort(1);
    }

    if( (CP[A] == 'y') && (INEPT[A] == 'y') )
    {
        text_error("Choose either CP or INEPT for H->N transfer !! ");
        psg_abort(1);
    }

    if( ncyc_hn > 2 )
    {
        text_error("check H->N half-dipsi-3 time !! ");
        psg_abort(1);
    }

    if( ncyc_nc > 7 )
    {
        text_error("check N->C dipsi-3 time !! ");
        psg_abort(1);
    }

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

    if( (URA[A] == 'n') && (CYT[A] == 'n') )
    {
        text_error("Do you really want to run this experiment ?? ");
        psg_abort(1);
    }

    if( (URA[A] == 'y') && (CP[A] == 'y') )
    {
        printf("Remember that CP covers just 3.8 ppm !!! ");
    }


/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);

        rcvroff();

        obspower(tpwr);
	obspwrf(rfH);
	obsstepsize(0.5);
        decpower(pwClvl);
        decpwrf(rfC);
	decstepsize(0.5);
        dec2power(pwNlvl);
	dec2pwrf(rfN);
	dec2stepsize(0.5);

  if (URA[A] == 'y')
   {
        obsoffset(tof_12);	/* Set the proton frequency to U-nH */
        dec2offset(dof2_160);   /* Set the nitrogen frequency to U-Nh */
   }
  else if (CYT[A] == 'y')
   {
        obsoffset(tof_75);      /* Set the proton frequency to C-nH2 */
	dec2offset(dof2_97);    /* Set the nitrogen frequency to C-Nh2 */
   }
  else
   {
   }

        decoffset(dof_169);	/* Preset the carbon frequency for the NC-tocsy */

        txphase(zero);
        decphase(zero);
        dec2phase(zero);

        delay(d1);

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

  if (CP[A] == 'y')
	initval(ncyc_hn,v12);

	initval(ncyc_nc,v11);

        txphase(t1);
        decphase(zero);
        dec2phase(zero);
        delay(5.0e-4);
        rcvroff();

  if(pw11[A] == 'y')
   {
        rgpulse(pw/2, t1, 50.0e-6, 0.0);
	if (URA[A] == 'y')
		delay(1/(2*(tof_12-tof)));
	else if (CYT[A] == 'y')
        	delay(1/(2*(tof_75-tof)));
	else
		delay(1/(2*(tof_75-tof)));
        rgpulse(pw/2, t1, 0.0, 0.0);
   }

  else
   {
	rgpulse(pw, t1, 50.0e-6, 0.0);
   }
	txphase(zero);

  if (C13refoc[A]=='y')
   {

        if (tau1 > (0.001-(2.0*GRADIENT_DELAY + pwN + 0.64*pw )))
        {
        zgradpulse(gzlvlr, 0.8*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
        delay(0.2*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw) );
        sim3pulse(0.0, 2.0*pwC, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
        zgradpulse(-1.0*gzlvlr, 0.8*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
        delay(0.2*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
        }
        else
        {
         if (tau1 > (0.001-(pwN + 0.64*pw )))
         {
          delay(tau1 - pwN - 0.64*pw );
          sim3pulse(0.0, 2.0*pwC, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
          delay(tau1 - pwN - 0.64*pw);
         }
         else
         {
          if (tau1 > (0.64*pw ))
           delay(2.0*tau1 - 2.0*0.64*pw );
         }
        }
   }
  else
   {
        if (tau1 > (0.001-(2.0*GRADIENT_DELAY + pwN + 0.64*pw )))
        {
        zgradpulse(gzlvlr, 0.8*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
        delay(0.2*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw) );
        dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
        zgradpulse(-1.0*gzlvlr, 0.8*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
        delay(0.2*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
        }
        else
        {
         if (tau1 > (0.001-(pwN + 0.64*pw )))
         {
          delay(tau1 - pwN - 0.64*pw );
          dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
          delay(tau1 - pwN - 0.64*pw);
         }
         else
         {
          if (tau1 > (0.64*pw ))
           delay(2.0*tau1 - 2.0*0.64*pw );
         }
        }
   }

  if (INEPT[A] == 'y')
   {
	delay(lambdaN);

	sim3pulse(2*pw, 0.0, 2*pwN, zero, zero, zero, 0.0, 0.0);
	dec2phase(t5);

	delay(lambdaN - SAPS_DELAY);

	sim3pulse(pw, 0.0, pwN, zero, zero, t5, 0.0, 0.0);
	dec2phase(zero);

	zgradpulse(gzlvl5,gt5);
	delay(lambdaN - SAPS_DELAY - gt5);

	sim3pulse(2*pw, 0.0, 2*pwN, one, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl5,gt5);
        delay(lambdaN - 2*SAPS_DELAY - gt5 - 2*POWER_DELAY);

        decpwrf(rfdC);          /* Set fine power for carbon */
        dec2pwrf(rfdN);         /* Set fine power for nitrogen */
   }

  else if (CP[A] == 'y')
   {
        obspwrf(rfdH);          /* Set fine power for proton */
        decpwrf(rfdC);          /* Preset fine power for carbon */
        dec2pwrf(rfdN);         /* Set fine power for nitrogen */
        delay(2.0e-6);
        starthardloop(v12);
    sim3pulse(6.4*p_d,0.0,6.4*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(8.2*p_d,0.0,8.2*p_d,two,two,two,0.0,0.0);
    sim3pulse(5.8*p_d,0.0,5.8*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(5.7*p_d,0.0,5.7*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.6*p_d,0.0,0.6*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(4.9*p_d,0.0,4.9*p_d,two,two,two,0.0,0.0);
    sim3pulse(7.5*p_d,0.0,7.5*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(5.3*p_d,0.0,5.3*p_d,two,two,two,0.0,0.0);
    sim3pulse(7.4*p_d,0.0,7.4*p_d,zero,zero,zero,0.0,0.0);

    sim3pulse(6.4*p_d,0.0,6.4*p_d,two,two,two,0.0,0.0);
    sim3pulse(8.2*p_d,0.0,8.2*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(5.8*p_d,0.0,5.8*p_d,two,two,two,0.0,0.0);
    sim3pulse(5.7*p_d,0.0,5.7*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.6*p_d,0.0,0.6*p_d,two,two,two,0.0,0.0);
    sim3pulse(4.9*p_d,0.0,4.9*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(7.5*p_d,0.0,7.5*p_d,two,two,two,0.0,0.0);
    sim3pulse(5.3*p_d,0.0,5.3*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(7.4*p_d,0.0,7.4*p_d,two,two,two,0.0,0.0);
        endhardloop();
   }
  
  else
   {
   }

	dec2phase(zero);
        decphase(zero);

	starthardloop(v11);
    sim3pulse(0.0,6.4*p_d,6.4*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,8.2*p_d,8.2*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,5.8*p_d,5.8*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,5.7*p_d,5.7*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,0.6*p_d,0.6*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,4.9*p_d,4.9*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,7.5*p_d,7.5*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,5.3*p_d,5.3*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,7.4*p_d,7.4*p_d,zero,zero,zero,0.0,0.0);

    sim3pulse(0.0,6.4*p_d,6.4*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,8.2*p_d,8.2*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,5.8*p_d,5.8*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,5.7*p_d,5.7*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,0.6*p_d,0.6*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,4.9*p_d,4.9*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,7.5*p_d,7.5*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,5.3*p_d,5.3*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,7.4*p_d,7.4*p_d,two,two,two,0.0,0.0);

    sim3pulse(0.0,6.4*p_d,6.4*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,8.2*p_d,8.2*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,5.8*p_d,5.8*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,5.7*p_d,5.7*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,0.6*p_d,0.6*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,4.9*p_d,4.9*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,7.5*p_d,7.5*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,5.3*p_d,5.3*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,7.4*p_d,7.4*p_d,two,two,two,0.0,0.0);

    sim3pulse(0.0,6.4*p_d,6.4*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,8.2*p_d,8.2*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,5.8*p_d,5.8*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,5.7*p_d,5.7*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,0.6*p_d,0.6*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,4.9*p_d,4.9*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,7.5*p_d,7.5*p_d,zero,zero,zero,0.0,0.0);
    sim3pulse(0.0,5.3*p_d,5.3*p_d,two,two,two,0.0,0.0);
    sim3pulse(0.0,7.4*p_d,7.4*p_d,zero,zero,zero,0.0,0.0);
	endhardloop();

	obspwrf(rfH);
	decpwrf(rfC);
	dec2pwrf(rfN);

	obsoffset(tof);
	decoffset(dof_140);

	txphase(zero);
	decphase(one);

	decrgpulse(pwC,one,0.0,0.0);   /* flip transferred 13C-magn. to z */
	decphase(t3);

	decrgpulse(pwC,t3,0.0,0.0);  /* flip transferred 13C-magnetization to x */
	decphase(zero);
	zgradpulse(gzlvl5,gt5);

	delay(tCC - SAPS_DELAY - gt5);
        decrgpulse(2*pwC,zero,0.0,0.0);
        zgradpulse(gzlvl5,gt5);
        delay(tCC - gt5);

	decrgpulse(pwC,zero,0.0,0.0);  /* flip transferred 13C-magnetization to x */
	decphase(zero);
	zgradpulse(gzlvl5,gt5);

	delay(tCC - SAPS_DELAY - gt5);
	decrgpulse(2*pwC,zero,0.0,0.0);  
	zgradpulse(gzlvl5,gt5);
	delay(tCC - gt5);

	decrgpulse(pwC,zero,0.0,0.0);  /* flip transferred 13C-magnetization to x */
	decphase(zero);
	delay(tCC - SAPS_DELAY);
	decrgpulse(2*pwC,zero,0.0,0.0);
	delay(tCC - lambda - pw);
	rgpulse(2*pw,zero,0.0,0.0);  /* Invert water signal */
	delay(lambda - pw);
	decrgpulse(pwC,zero,0.0,0.0);

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

        txphase(zero);
        obspower(tpwrs);
        shaped_pulse("rna_H2Osinc", pwHs, zero, 5.0e-4, 0.0);
        obspower(tpwr);

	rgpulse(pw, zero, 2*rof1, 0.0);
	txphase(two);
	obspower(tpwrs2);
	
	zgradpulse(gzlvl4,gt4);
        delay(grecov - 2*SAPS_DELAY - 2*POWER_DELAY - GRADIENT_DELAY);

        rgpulse((lambda-grecov-gt4-pwC), two, 0.0, 0.0);
        simpulse(pwC,pwC,two,three,0.0,0.0);
        simpulse(2*pwC,2*pwC,two,zero,0.0,0.0);
        simpulse(pwC,pwC,two,three,0.0,0.0);
        rgpulse((pwHs2-2*pwC-(lambda-grecov-gt4-pwC)), two, 0.0, 0.0);

        txphase(zero);
        obspower(tpwr);
        rgpulse(2*pw, zero, 0.0, 0.0);
        txphase(two);
        obspower(tpwrs2);

        rgpulse(pwHs2, two, 0.0, 0.0);
        decphase(t4);

        zgradpulse(gzlvl4,gt4);
        delay(grecov-2*pwC-2*SAPS_DELAY - POWER_DELAY - GRADIENT_DELAY);

        decrgpulse(pwC,t4,0.0,0.0);
        decrgpulse(pwC,zero,0.0,0.0);
        dec2power(dpwr2);               /* 2*POWER_DELAY */
        decpower(dpwr);

status(C);
	rcvron();

 setreceiver(t10);
}
void pulsesequence()
{

char  satflg[MAXSTR], stCshape[MAXSTR];    /* sech/tanh pulses from shapelib */       
 
int   icosel,  t1_counter;

double 
   tau1, tau2, tau3, swTilt,
   cos_hm1, cos_cm1, cos_cm2,
   sw1       = getval("sw1"),
   sw_hm1    = getval("sw_hm1"),
   sw_cm1    = getval("sw_cm1"),
   sw_cm2    = getval("sw_cm2"),
   angle_hm1 = getval("angle_hm1"),
   angle_cm1 = getval("angle_cm1"),
   angle_cm2,

   pwHs = getval("pwHs"),
   pwClvl = getval("pwClvl"), 	  	        /* coarse power for C13 pulse */
   pwC = getval("pwC"),     	      /* C13 90 degree pulse length at pwClvl */
   compC = getval("compC"),       /* adjustment for C13 amplifier compression */
   rf0,            	          /* maximum fine power when using pwC pulses */
   rfst = 0.0,	            /* fine power for the stCshape pulse, initialised */
   pwNlvl = getval("pwNlvl"),	                      /* power for N15 pulses */
   pwN = getval("pwN"),               /* N15 90 degree pulse length at pwNlvl */

   lambda = getval("lambda"),	                 /* J delay optimized for CH3 */
   tauCH = 1/(4.0*getval("jch")),                         /* 1/4J J  delay */

   gstab = getval("gstab"),
   gt0 = getval("gt0"),          gzlvl0 = getval("gzlvl0"),				   
   gt1 = getval("gt1"),          gzlvl1 = getval("gzlvl1"),
                                 gzlvl2 = getval("gzlvl2"),
   gt3 = getval("gt3"),          gzlvl3 = getval("gzlvl3"),
   gt4 = getval("gt4"),          gzlvl4 = getval("gzlvl4"),
   gt5 = getval("gt5"),          gzlvl5 = getval("gzlvl5"),
   gt6 = getval("gt6"),          gzlvl6 = getval("gzlvl6");

   getstr("satflg",satflg);
   pwN=pwN*1.0; cos_cm2=0.0; angle_cm2=0.0;

/*   LOAD PHASE TABLE    */

   settable(t1,1,phi1);   settable(t3,2,phi3);  settable(t9,8,phi9);
   settable(t10,1,phi10); settable(t11,4,rec);

/*   INITIALIZE VARIABLES   */

   /* 30 ppm sech pulse */
   rf0 = 4095.0; 
   rfst = (compC*4095.0*pwC*4000.0*sqrt((4.5*sfrq/600.0+3.85)/0.41));   
   rfst = (int) (rfst + 0.5);
   strcpy(stCshape, "stC30");

/* CHECK VALIDITY OF PARAMETER RANGES */

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

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

  if( (dpwr > 52) && (dm[C]=='y'))
  { text_error("don't fry the probe, DPWR too large!  ");   	    psg_abort(1); }

/* Phases and delays related to PR-NMR */
   /* sw1 is used as symbolic index */
   if ( sw1 < 1000 ) { printf ("Please set sw1 to some value larger than 1000.\n"); psg_abort(1); }
   if (angle_hm1 < 0 || angle_cm1 < 0 || angle_hm1 > 90 || angle_cm1 > 90 )
   { printf("angles must be set between 0 and 90 degree.\n"); psg_abort(1); }

   cos_hm1 = cos (PI*angle_hm1/180);  cos_cm1 = cos (PI*angle_cm1/180);

   if ( (cos_hm1*cos_hm1 + cos_cm1*cos_cm1) > 1.0) { printf ("Impossible angle combinations.\n"); psg_abort(1); }
   else { cos_cm2 = sqrt(1 - (cos_hm1*cos_hm1 + cos_cm1*cos_cm1) );  angle_cm2 = acos(cos_cm2)*180/PI;  }

   if (ix == 1) d2_init = d2;
   t1_counter = (int)((d2-d2_init)*sw1 + 0.5);

   swTilt = sw_hm1*cos_hm1 + sw_cm1*cos_cm1 + sw_cm2*cos_cm2;

   if  (phase1 == 1) {; }                                             /* C+/- */
   else if  (phase1 == 2)  { tsadd (t1, 1, 4); }                      /* S+/- */

   icosel=1; 

   if ( (phase2 == 1) || (phase2 == 3) )  { tsadd(t10,2,4); icosel = 1; }
        else   {   icosel = -1;    }

   if (t1_counter % 2)  { tsadd(t1,2,4); tsadd(t11,2,4); }    /* PZ TPPI */

   tau1 = 1.0*t1_counter*cos_hm1/swTilt;
   tau2 = 1.0*t1_counter*cos_cm1/swTilt;
   tau3 = 1.0*t1_counter*cos_cm2/swTilt;

   tau1 = tau1/2.0;  tau2 = tau2/2.0;  tau3 = tau3/2.0;

   if (ix ==1 )
   {
      printf ("Current Spectral Width:\t\t%5.2f\n", swTilt);
      printf ("Angle_hm1: %5.2f \n", angle_hm1);
      printf ("Angle_cm1: %5.2f \n", angle_cm1);
      printf ("Angle_cm2: %5.2f \n", angle_cm2);
      printf ("\n\n\n\n\n");
   }

/* BEGIN PULSE SEQUENCE */

status(A);
   delay(d1);
   rcvroff();

   txphase(zero);   obspower(tpwr);
   decphase(zero);  decpower(pwClvl);   decpwrf(rf0);
   dec2phase(zero); dec2power(pwNlvl);
   decoffset(dof);

   obsoffset(satfrq);

   if (satflg[A] == 'y')
   {
      obspower(satpwr);
      rgpulse(satdly, zero, 0.0, 0.0);
      obspower(tpwr);      
   }

   if (satflg[A] == 'y')
   {
      shiftedpulse("sinc", pwHs, 90.0, 0.0, zero, 2.0e-6, 2.0e-6);
   }
   decrgpulse(pwC, zero, 2.0e-6, 2.0e-6);  /*destroy C13 magnetization*/
   zgradpulse(gzlvl0, gt0);
   delay(gstab);

   if (satflg[A] == 'y')
   {
      shiftedpulse("sinc", pwHs, 90.0, 0.0, one, 2.0e-6, 2.0e-6);
   }
   decrgpulse(pwC, one, 2.0e-6, 2.0e-6);
   zgradpulse(0.7*gzlvl0, gt0);
   txphase(t1);

   obsoffset(tof);
   delay(gstab);

status(B);

   rgpulse(pw, t1, 2.0e-6,2.0e-6);                 /* 1H pulse excitation */

      if (tau1 > pwC)
      {
         delay(tau1 - pwC);
         decrgpulse(2.0*pwC, zero, 0.0, 0.0);
         delay(tau1 - pwC);
      }
      else
      {
         delay(2.0*tau1);
      }

      zgradpulse(gzlvl3, gt3);
      delay(tauCH - gt3 - 4.0e-6);

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

      delay(tauCH - gt3 - gstab -4.0e-6);
      zgradpulse(gzlvl3, gt3);
      txphase(one);  
      delay(gstab);

   rgpulse(pw, one, 2.0e-6, 2.0e-6);

      zgradpulse(gzlvl4, gt4);
      obsoffset(satfrq);
      decphase(t3);
      delay(gstab);

   decrgpulse(pwC, t3, 4.0e-6, 2.0e-6);
   /*==================  Carbon evolution ===============*/
      txphase(zero); decphase(zero);

      if ((phase2 ==1) || (phase2 ==2))   { delay(tau2 + tau3); }
      else  {  delay(tau3);  }

   rgpulse(2.0*pw, zero, 2.0e-6, 2.0e-6);

      if ((phase2 == 1) || (phase2 ==2))  { delay(tau2 + tau3); }
      else  {  delay(tau3);  }

      zgradpulse(-1.0*gzlvl1, gt1/2);
      decphase(t9);
      delay(gstab - 2.0*GRADIENT_DELAY);

   decrgpulse(2.0*pwC, t9, 2.0e-6, 2.0e-6);

      if ((phase2 == 3) || (phase2 ==4))  { delay(tau2); }
   rgpulse(2.0*pw, zero, 2.0e-6, 2.0e-6);
      if ((phase2 == 3) || (phase2 ==4))  { delay(tau2); }

      zgradpulse(gzlvl1, gt1/2);
      decphase(t10);
      delay(gstab -2.0*GRADIENT_DELAY );

   /*================== End of  Carbon evolution ===============*/
   simpulse(pw, pwC, zero, t10, 2.0e-6, 2.0e-6);
      decphase(zero);
      zgradpulse(gzlvl5, gt5);
      delay(lambda - 1.5*pwC - gt5 - 4.0e-6);

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

      delay(lambda  - 1.5*pwC - gt5 - gstab -4.0e-6);
      zgradpulse(gzlvl5, gt5);
      txphase(one); decphase(one);
      delay(gstab);

   simpulse(pw, pwC, one, one, 2.0e-6, 2.0e-6);

      txphase(zero);
      decphase(zero);
      zgradpulse(gzlvl6, gt6);
      delay(tauCH - 1.5*pwC - gt6 -4.0e-6);

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

      delay(tauCH - pwC - 0.5*pw - gt6 -gstab -4.0e-6);
      zgradpulse(gzlvl6, gt6);
      delay(gstab);

   rgpulse(pw, zero, 2.0e-6, 2.0e-6);

      delay((gt1/4.0) + gstab -2.0e-6 - 0.5*pw + 2.0*GRADIENT_DELAY + POWER_DELAY);

   rgpulse(2.0*pw, zero, 2.0e-6, 2.0e-6);
      decpower(dpwr);					       /* POWER_DELAY */
      zgradpulse(icosel*gzlvl2, gt1/4.0);             /* 2.0*GRADIENT_DELAY */
      delay(gstab);

status(C);
   setreceiver(t11);
}		 
Example #15
0
pulsesequence()
{
/* DECLARE VARIABLES */

 char       fsat[MAXSTR],
            fscuba[MAXSTR],
            f1180[MAXSTR],    /* Flag to start t1 @ halfdwell             */
            codecseq[MAXSTR],
            ddseq[MAXSTR], 
            shca180[MAXSTR],
            shca90[MAXSTR];

 int         phase,  ni, 
             t1_counter,   /* used for states tppi in t1           */ 
             tau2;

 double      tau1,         /*  t1 delay */
             taua,         /*  ~ 1/4JCH =  1.7 ms */
             taub,         /* ~ 1/2JCH for AX spin systems */
             taud,         /* ~ 1/4JCD 12.5 ms for AX spin system */
             TC,           /* carbon constant time period 1/2JCC */
             pwc,          /* 90 c pulse at dhpwr            */
             tsatpwr,      /* low level 1H trans.power for presat  */
             dhpwr,        /* power level for high power 13C pulses on dec1 */
             sw1,          /* sweep width in f1                    */ 
             time_T2,      /*  total relaxation time for T2 measurement */
             pwcodec,      /* pw90 for C' decoupling */
             dressed,      /* = 2 for seduce-1 decoupling */
             dpwrsed,
             pwd,          /* pulse width for D decoupling at dpwr3_D  */
             dresD,
             dpwr3_D,
             lk_wait,      /* delay for lk receiver recovery  */

             pwd1,         /* pulse width for D +/- pulses at dpwr3  */

             d_ca180,
             pwca180,

             pwca90,       /* ca selective pulse at 57.5 ppm */
             d_ca90,       /* power level for pwca90   */

             dpwr3_sl,     /* D power level for spin locking */
             pwd_sl,       /* pw for D at dpwr3_sl    */

             gt1,
             gt2,
             gt3,
             gt4,
             gt5,
             gt6,
             gt7,
             gt8,
             gstab=getval("gstab"),

             gzlvl1,
             gzlvl2,
             gzlvl3,
             gzlvl4,
             gzlvl5,
             gzlvl6,
             gzlvl7,
             gzlvl8;

/*  variables commented out are already defined by the system      */


/* LOAD VARIABLES */

  getstr("fsat",fsat);
  getstr("f1180",f1180);
  getstr("fscuba",fscuba);
  getstr("codecseq",codecseq);
  getstr("ddseq",ddseq);
  getstr("shca180",shca180);
  getstr("shca90",shca90);

  taua   = getval("taua"); 
  taub   = getval("taub"); 
  taud   = getval("taud"); 
  TC = getval("TC");
  pwc = getval("pwc");
  tpwr = getval("tpwr");
  tsatpwr = getval("tsatpwr");
  dhpwr = getval("dhpwr");
  dpwr = getval("dpwr");
  phase = (int) ( getval("phase") + 0.5);
  sw1 = getval("sw1");
  ni = getval("ni");
  pwcodec = getval("pwcodec");
  dressed = getval("dressed");
  dpwrsed = getval("dpwrsed");
  pwd = getval("pwd");
  dresD = getval("dresD");
  dpwr3_D = getval("dpwr3_D");
  lk_wait = getval("lk_wait");

  pwd1 = getval("pwd1");

  d_ca180 = getval("d_ca180");
  pwca180 = getval("pwca180");

  pwca90 = getval("pwca90");
  d_ca90 = getval("d_ca90");

  dpwr3_sl = getval("dpwr3_sl"); 
  pwd_sl = getval("pwd_sl");

  gt1 = getval("gt1");
  gt2 = getval("gt2");
  gt3 = getval("gt3");
  gt4 = getval("gt4");
  gt5 = getval("gt5");
  gt6 = getval("gt6");
  gt7 = getval("gt7");
  gt8 = getval("gt8");

  gzlvl1 = getval("gzlvl1");
  gzlvl2 = getval("gzlvl2");
  gzlvl3 = getval("gzlvl3");
  gzlvl4 = getval("gzlvl4");
  gzlvl5 = getval("gzlvl5");
  gzlvl6 = getval("gzlvl6");
  gzlvl7 = getval("gzlvl7");
  gzlvl8 = getval("gzlvl8");

/* LOAD PHASE TABLE */

  settable(t1,16,phi1);
  settable(t2,2,phi2);
  settable(t3,16,phi3);
  settable(t4,4,phi4);
  settable(t6,4,phi6);
  settable(t7,8,phi7);
  settable(t5,16,rec_d);

/* CHECK VALIDITY OF PARAMETER RANGES */

    if( TC - 0.50*(ni-1)*1/(sw1) - WFG_STOP_DELAY 
             - gt6 - 102e-6 - POWER_DELAY 
             - PRG_START_DELAY - POWER_DELAY
             - 4.0e-6 - pwd1 - POWER_DELAY
             - PRG_START_DELAY - PRG_STOP_DELAY
             - 2.0e-6 - POWER_DELAY - 2.0e-6
             < 0.2e-6 ) 
    {
        printf(" ni 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!  ");
        psg_abort(1);
    }

    if( tsatpwr > 6 )
    {
        printf("TSATPWR too large !!!  ");
        psg_abort(1);
    }

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

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

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

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

    if(gt1 > 15e-3 || gt2 > 15e-3 || gt3 > 15e-3 || 
        gt4 > 15e-3 || gt5 > 15e-3 || gt6 > 15e-3 || gt7 > 15e-3
        || gt8 > 15e-3)
    {
        printf("gradients on for too long. Must be < 15e-3 \n");
        psg_abort(1);
    }

   if(dpwr3_D > 54)
   {
       printf("D decoupling power is too high\n");
       psg_abort(1);
   }

   if(lk_wait > .015 )
   {
       printf("lk_wait delay may be too long\n");
       psg_abort(1);
   }
/* change back to 48 */
   if(dpwr3_sl > 53) {
       printf("dpwr3_sl is too large; must be less than 53\n");
       psg_abort(1);
   }
/* change back to 250 */
   if(pwd_sl < 170.0e-6) {
       printf("pwd_sl is too large; Must be larger than 170 us\n");
       psg_abort(1);
   }


/* Calculation of IzCzDz relaxation delay */

   tau2 = (int) (d3+0.1);
   time_T2 = z_array[tau2];

   if(time_T2 > 0.030) {
       printf("time_T2 is too long; Must be less than 30 ms\n");
       psg_abort(1);
   }

/*  Phase incrementation for hypercomplex 2D data */

    if (phase == 2) {
      tsadd(t7,1,4);  
    }

/*  Set up f1180  tau1 = t1               */
   
    tau1 = d2;
    if(f1180[A] == 'y') {
        tau1 += ( 1.0 / (2.0*sw1) );
        if(tau1 < 0.4e-6) tau1 = 0.4e-6;
    }
        tau1 = tau1/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(t7,2,4);     
      tsadd(t5,2,4);    
    }


/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   decoffset(dof);
   obspower(tsatpwr);     /* Set transmitter power for 1H presaturation */
   decpower(dhpwr);       /* Set Dec1 power for hard 13C pulses         */
   dec2power(dpwr2);      /* Set Dec2 power for 15N decoupling       */

/* Presaturation Period */

status(B);


   if (fsat[0] == 'y')
   {
        rgpulse(d1,zero,2.0e-6,2.0e-6); /* presat */
        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*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 */
   txphase(zero);
   dec2phase(zero);
   decphase(zero);
   delay(1.0e-5);

/* Begin Pulses */

status(C);

/* Prepare for signs of gradients 0 1 0 1 0 1   */

   mod2(ct,v1);

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

/* first ensure that magnetization does infact start on H and not C */

   decrgpulse(pwc,zero,2.0e-6,2.0e-6);

   delay(2.0e-6);
   zgradpulse(gzlvl1,gt1);
   delay(gstab);


/* this is the real start */

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

   delay(2.0e-6);
   zgradpulse(gzlvl2,gt2);
   delay(2.0e-6);

   delay(taua - gt2 - 4.0e-6);                 /* taua <= 1/4JCH */                          

   simpulse(2*pw,2*pwc,zero,zero,0.0,0.0);

   txphase(one); decphase(t1);

   delay(2.0e-6);
   zgradpulse(gzlvl2,gt2);
   delay(2.0e-6);

   delay(taua - gt2 - 4.0e-6); 

   rgpulse(pw,one,0.0,0.0);
   txphase(zero);

   delay(2.0e-6);
   zgradpulse(gzlvl3,gt3);
   delay(gstab);

   /* 2D decoupling on */
   dec3phase(one);
   dec3power(dpwr3);
   dec3rgpulse(pwd1,one,4.0e-6,0.0);
   dec3phase(zero);
   dec3unblank();
   dec3power(dpwr3_D);                    /* keep power down */
   dec3prgon(ddseq,pwd,dresD);
   dec3on();
   /* 2D decoupling on */

   decrgpulse(pwc,t1,2.0e-6,0.0); 

   decphase(zero);

   delay(taub - 2.0*pw - 2.0e-6);

   rgpulse(pw,zero,0.0,0.0);
   rgpulse(pw,t2,2.0e-6,0.0);

   delay(TC - taub 
           - gt4 - 102e-6
           - PRG_STOP_DELAY - POWER_DELAY - pwd1
           - 4.0e-6 - POWER_DELAY - 4.0e-6 - WFG_START_DELAY);

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

   ifzero(v1);

   delay(2.0e-6);
   zgradpulse(gzlvl4,gt4);
   delay(gstab);

   elsenz(v1);

   delay(2.0e-6);
   zgradpulse(-1.0*gzlvl4,gt4);
   delay(gstab);

  endif(v1);

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

   decpower(d_ca180);
   decshaped_pulse(shca180,pwca180,zero,4.0e-6,0.0);
   dcplrphase(zero); 

   ifzero(v1);

   delay(2.0e-6);
   zgradpulse(gzlvl4,gt4);
   delay(gstab);

   elsenz(v1);

   delay(2.0e-6);
   zgradpulse(-1.0*gzlvl4,gt4);
   delay(gstab);

  endif(v1);

   /* 2D decoupling on */  
   dec3phase(one);
   dec3power(dpwr3);
   dec3rgpulse(pwd1,one,4.0e-6,0.0);
   dec3phase(zero);
   dec3unblank();
   dec3power(dpwr3_D);   /* keep power down */ 
   dec3prgon(ddseq,pwd,dresD);
   dec3on();
   /* 2D decoupling on */

    delay(TC - taud - WFG_STOP_DELAY - gt4 - 102e-6
            - POWER_DELAY - 4.0e-6 - pwd1 - POWER_DELAY 
            - PRG_START_DELAY); 

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

   delay(taud - PRG_STOP_DELAY -POWER_DELAY - pwd1 - 4.0e-6 
         - POWER_DELAY
         - WFG_START_DELAY - pwca90 - 4.0e-6
         - WFG_STOP_DELAY - POWER_DELAY - 4.0e-6);

   decpower(d_ca90);
   decshaped_pulse(shca90,pwca90,t3,4.0e-6,0.0);
   decpower(dhpwr);

   decrgpulse(pwc,one,4.0e-6,0.0);

   /* T2 period */

   dec3power(dpwr3);   

      dec3rgpulse(pwd1,t4,2.0e-6,0.0);

      dec3phase(one);
      dec3power(dpwr3_sl);
      dec3rgpulse(time_T2,one,2.0e-6,2.0e-7);
      dec3phase(zero);

      dec3power(dpwr3);
      dec3rgpulse(pwd1,zero,2.0e-6,0.0);

       
      ifzero(v1);

      delay(2.0e-6);
      zgradpulse(gzlvl5,gt5);
      delay(gstab);

      elsenz(v1);

      delay(2.0e-6);
      zgradpulse(-1.0*gzlvl5,gt5);
      delay(gstab);

      endif(v1);

   decphase(zero);

   decrgpulse(pwc,t7,4.0e-6,0.0);

   /* C' decoupling on */
   decpower(dpwrsed);
   decprgon(codecseq,pwcodec,dressed);
   decon();
   /* C' decoupling on */

  if(taud + 3.0*POWER_DELAY + 2.0*PRG_START_DELAY + pwd1 + 4.0e-6 >= tau1) {
        
        delay(tau1);
        rgpulse(2.0*pw,zero,0.0,0.0);
        delay(taud + 3.0*POWER_DELAY + 2.0*PRG_START_DELAY + pwd1 + 4.0e-6
              - tau1);

        /* 2D decoupling on */  
        dec3phase(t6);
        dec3power(dpwr3);
        dec3rgpulse(pwd1,t6,4.0e-6,0.0);
        dec3phase(zero);
        dec3unblank();
        dec3power(dpwr3_D);   /* keep power down */ 
        dec3prgon(ddseq,pwd,dresD);
        dec3on();
        /* 2D decoupling on */

        delay(TC - taud + tau1 - POWER_DELAY 
              - PRG_START_DELAY - 2.0*pw
              - POWER_DELAY - pwd1 - 4.0e-6 - POWER_DELAY - PRG_START_DELAY
              - 3.0*POWER_DELAY - 2.0*PRG_START_DELAY - pwd1 - 4.0e-6 
              - PRG_STOP_DELAY - POWER_DELAY - pwd1 - 4.0e-6 
              - PRG_STOP_DELAY
              - POWER_DELAY - gt6 - 102e-6
              - WFG_START_DELAY);

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

        /* C' decoupling off */
        decoff();
        decprgoff();
        decpower(d_ca180);  /* set power for reburp  */
        /* C' decoupling off */

     }

     else {

        delay(taud);

        /* 2D decoupling on */  
        dec3phase(t6);
        dec3power(dpwr3);
        dec3rgpulse(pwd1,t6,4.0e-6,0.0);
        dec3phase(zero);
        dec3unblank();
        dec3power(dpwr3_D);   /* keep power down */ 
        dec3prgon(ddseq,pwd,dresD);
        dec3on();
        /* 2D decoupling on */

        delay(tau1 - taud - POWER_DELAY - PRG_START_DELAY
              - POWER_DELAY - pwd1 - 4.0e-6 
              - POWER_DELAY - PRG_START_DELAY);

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

        delay(TC 
              - 2.0*pw - PRG_STOP_DELAY - POWER_DELAY - pwd1 - 4.0e-6 
              - POWER_DELAY
              - PRG_STOP_DELAY - gt6 - 102e-6
              - WFG_START_DELAY);

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

        /* C' decoupling off */
        decoff();
        decprgoff();
        decpower(d_ca180);  /* set power for reburp  */
        /* C' decoupling off */

     }

   initval(1.0,v4);
   decstepsize(353.0);
   dcplrphase(v4); 

   ifzero(v1);

   delay(2.0e-6);
   zgradpulse(gzlvl6,gt6);
   delay(gstab);

   elsenz(v1);

   delay(2.0e-6);
   zgradpulse(-1.0*gzlvl6,gt6);
   delay(gstab);

   endif(v1);

   decshaped_pulse(shca180,pwca180,zero,0.0,0.0);
   dcplrphase(zero); 

   ifzero(v1);

   delay(2.0e-6);
   zgradpulse(gzlvl6,gt6);
   delay(gstab);

   elsenz(v1);

   delay(2.0e-6);
   zgradpulse(-1.0*gzlvl6,gt6);
   delay(gstab);

   endif(v1);

   /* C' decoupling on */
   decpower(dpwrsed);
   decprgon(codecseq,pwcodec,dressed);
   decon();
   /* C' decoupling on */

   /* 2D decoupling on */  
   dec3phase(one);
   dec3power(dpwr3);
   dec3rgpulse(pwd1,one,4.0e-6,0.0);
   dec3phase(zero);
   dec3unblank();
   dec3power(dpwr3_D);   /* keep power down */ 
   dec3prgon(ddseq,pwd,dresD);
   dec3on();
   /* 2D decoupling on */

   delay(TC - tau1 - WFG_STOP_DELAY - gt6
           - 102e-6 - POWER_DELAY - PRG_START_DELAY - POWER_DELAY - pwd1
           - 4.0e-6 - POWER_DELAY - PRG_START_DELAY - PRG_STOP_DELAY
           - POWER_DELAY - 4.0e-6);

   /* C' decoupling off */
   decoff();
   decprgoff();
   decpower(dhpwr);
   /* C' decoupling off */

   decrgpulse(pwc,one,4.0e-6,0.0);

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

  ifzero(v1);

   delay(2.0e-6);
   zgradpulse(gzlvl7,gt7);
   delay(gstab);

  elsenz(v1);

   delay(2.0e-6);
   zgradpulse(-1.0*gzlvl7,gt7);
   delay(gstab);

  endif(v1);
  
   delay(lk_wait);   /* delay for lk receiver recovery */

   rgpulse(pw,zero,0.0,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl8,gt8);

  decphase(zero);

  delay(taua - gt8 - 4.0e-6);

  simpulse(2*pw,2*pwc,zero,zero,0.0,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl8,gt8);
   delay(2.0e-6);

   delay(taua - 2*POWER_DELAY - gt8 - 4.0e-6);

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

   rgpulse(pw,zero,0.0,rof2);

  lk_sample();

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

/* BEGIN ACQUISITION */

status(D);
   setreceiver(t5);

}
Example #16
0
pulsesequence()
{
   double          tau, rg1 = 2.0e-6,
                   jXH = getval("jXH"),
                   mult = getval("mult"),
                   gt0 = getval("gt0"),
                   gzlvl0 = getval("gzlvl0"),
                   gt1 = getval("gt1"),
                   gzlvl1 = getval("gzlvl1"),
                   gt2 = getval("gt2"),
                   gzlvl2 = getval("gzlvl2"),
                   gt3 = getval("gt3"),
                   gzlvl3 = getval("gzlvl3"),
                   Gratio = getval("Gratio"),
                   gstab = getval("gstab"),
                   compH = getval("compH"),
                   compX = getval("compX"),
                   Hpwr = getval("Hpwr"),
		   jevol = 0.25 / 140.0;    /* default for C-13 */

   char            pshape[MAXSTR], zz[MAXSTR], ad180[MAXSTR], sspul[MAXSTR];
   shape           hdx;                     /* HADAMARD stuff */
   void            setphases();

   getstr("pshape", pshape);              /* pulse shape as in wavelib */
   getstr("sspul", sspul);
   getstr("zz", zz);
   getstr("ad180", ad180);
   if (jXH > 0.0) jevol = 0.25 / jXH;
   
   tau = gt3 + gstab;
   if (mult > 0.5)
    tau = 2*jevol;

   setphases();

   /* MAKE PBOX SHAPES */

   if (FIRST_FID)
   {
     ad180sh = pbox_ad180("ad180", pwx, pwxlvl);    /* make adiabatic 180 */
     if (strcmp(pwpat,"Hdec") == 0)
     {
       /* make H decoupling shape */
       Hdec = pboxHT_dec(pwpat, pshape, jXH, 20.0, pw, compH, tpwr);
       Hpwr = Hdec.pwr;
     }
   }

   hdx = pboxHT_F1i(pshape, pwx*compX, pwxlvl);         /* HADAMARD stuff */
   if (getval("htcal1") > 0.5)           /* enable manual power calibration */
     hdx.pwr += getval("htpwr1");

 /* THE PULSE PROGRAMM STARTS HERE */
   status(A);

    delay(5.0e-5);
    zgradpulse(gzlvl0,gt0);
    if (sspul[0] == 'y')
    {
      rgpulse(pw,zero,rof1,rof1);
      zgradpulse(gzlvl0,gt0);
    }

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

   decoffset(dof);
   decpower(pwxlvl);
   obspower(tpwr);
   obsoffset(tof);
   delay(2.0e-5);
 
   status(B);

   rgpulse(pw, v2, rg1, rg1);
   delay(jevol - ad180sh.pw/2.0 - 3.0*rg1); /* +rg on both sides */
   decshaped_pulse(ad180sh.name, ad180sh.pw, zero, rg1, rg1);
   rgpulse(2.0*pw, zero, rg1, rg1);
   delay(jevol + ad180sh.pw/2.0 - rg1);
   rgpulse(pw, one, rg1, rg1);

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

   decpower(hdx.pwr);
   if (strcmp(pwpat,"") == 0)
     decshaped_pulse(hdx.name, hdx.pw, zero, rg1, rg1);
   else
   {
     obspower(Hpwr);
     simshaped_pulse(pwpat, hdx.name, hdx.pw, hdx.pw, zero, zero, rg1, rg1);
   }
   zgradpulse(gzlvl2*1.4, gt2);
   decpower(pwxlvl); obspower(tpwr);

   if((zz[A] == 'y') && (mult == 0)) 
   {
     ifzero(v1);
       decshaped_pulse(ad180sh.name, ad180sh.pw, zero, rg1, rg1);
     elsenz(v1);
       delay(0.5e-3);
     endif(v1);
   }
   else
   {
     delay(0.5e-3);
     decrgpulse(pwx,v1,rg1,rg1);
     if(ad180[A]=='y')
       decshaped_pulse(ad180sh.name, ad180sh.pw, zero, rg1, rg1);
     if(zz[A] == 'y')
       delay(tau);
     else
     {
       zgradpulse(gzlvl1,gt1);
       delay(tau - gt1 - 2*GRADIENT_DELAY);
     }
     if(ad180[A]=='y')
     {
       rgpulse(mult*pw, zero, rg1, rg1);
       decshaped_pulse(ad180sh.name, ad180sh.pw, zero, rg1, rg1);
     }
     else
       simpulse(mult*pw,2*pwx,zero,one,rg1,rg1);
     delay(tau); 
     decrgpulse(pwx,zero,rg1,rg1);
   }
   zgradpulse(gzlvl2/1.7, gt2);
   delay(gstab);

   rgpulse(pw, zero, rg1, rg1);
   delay(jevol - ad180sh.pw/2.0 - 3.0*rg1);  /* +rg on both sides */
   decshaped_pulse(ad180sh.name, ad180sh.pw, zero, rg1, rg1);
   rgpulse(2.0*pw, zero, rg1, rg1);

   if(zz[A] == 'y') 
   {
     delay(jevol + ad180sh.pw/2.0 - rg1);
     rgpulse(pw, one, rg1, rg1);
     zgradpulse(-gzlvl3, gt3);
     decpower(dpwr);
     delay(gstab);
     rgpulse(pw, three, rg1, rof2);
   }
   else
   {
     zgradpulse(2.0*gzlvl1/Gratio, gt1/2.0);
     decpower(dpwr);
     delay(jevol + ad180sh.pw/2.0 - rg1 - gt1/2.0 - 2*GRADIENT_DELAY - POWER_DELAY + rof2);
   }
   status(C);
}
Example #17
0
pulsesequence()
{



    /* DECLARE AND LOAD VARIABLES */

    char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
                CT[MAXSTR],
                refocN15[MAXSTR],
                refocCO[MAXSTR], COshape[MAXSTR],
                C180shape[MAXSTR];

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

    double      tau1,         				         /*  t1 delay */
                tauch =  getval("tauch"), 	   /* 1/4J   evolution delay */
                tauch1 =  getval("tauch1"),   /* 1/4J or 1/8JC13H   evolution delay */
                timeCC =  getval("timeCC"),  /* 13C constant-time if needed*/
                corrD, corrB, /* small  correction delays */

                dof_dec =  getval("dof_dec"), /*decoupler offset for decoupling during acq - folding */

                pwClvl = getval("pwClvl"),	              /* power for hard C13 pulses */
                pwC180lvl = getval("pwC180lvl"),           /*power levels for 180 shaped pulse */
                pwC180lvlF = getval("pwC180lvlF"),
                pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */
                pwC180 = getval("pwC180"),   /* shaped 180 pulse on C13channl */

                sw1 = getval("sw1"),

                pwNlvl = getval("pwNlvl"),
                pwN = getval("pwN"),

                pwCOlvl = getval("pwCOlvl"),
                pwCO = getval("pwCO"),

                gstab = getval("gstab"),
                gstab1 = getval("gstab1"), /* recovery for club sandwitch, short*/
                gt0 = getval("gt0"),
                gt1 = getval("gt1"),
                gt2 = getval("gt2"),
                gt3 = getval("gt3"),                               /* other gradients */
                gt4 = getval("gt4"),
                gt5 = getval("gt5"),
                gt9 = getval("gt9"),

                gzlvl0 = getval("gzlvl0"),
                gzlvl2 = getval("gzlvl2"),
                gzlvl3 = getval("gzlvl3"),
                gzlvl4 = getval("gzlvl4"),
                gzlvl5 = getval("gzlvl5"),
                gzlvl9 = getval("gzlvl9");



    getstr("f1180",f1180);
    getstr("C180shape",C180shape);
    getstr("COshape",COshape);
    getstr("refocCO",refocCO);
    getstr("refocN15",refocN15);
    getstr("CT",CT);


    /*   LOAD PHASE TABLE    */


    settable(t2,2,phi2);
    settable(t3,1,phi3);
    settable(t4,1,phi4);
    settable(t10,1,phix);
    settable(t11,4,rec);


    /*   INITIALIZE VARIABLES   */




    /* CHECK VALIDITY OF PARAMETER RANGES */
    /* like in olde good times */

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

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

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

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

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


    /* PHASES AND INCREMENTED TIMES */

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

    if (phase1 == 1)  {
        tsadd(t10,2,4);
        icosel = +1;
    }
    else       {
        icosel = -1;
    }
    /* 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(t2,2,4);
        tsadd(t11,2,4);
    }



    /*  Set up f1180  */

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

    if(CT[A]=='y')   {
        refocN15[A]='y';
        refocCO[A]='y';

        if ( (timeCC-ni/sw1*0.5)*0.5 -pw -pwCO*0.5 -pwN-rof1  <0.2e-6 )
        {
            text_error("too many increments in t1 for a constant time");
            psg_abort(1);
        }
    }

    /*temporary*/
    /* correction delays */

    corrB=0.0;
    corrD=2.0/M_PI*pwC-pw-rof1;

    if (corrD < 0.0) {
        corrB=-corrD;
        corrD=0.0;
    }


    /* BEGIN PULSE SEQUENCE */

    status(A);
    obsoffset(tof);
    obspower(tpwr);
    decpower(pwClvl);
    decpwrf(4095.0);
    decoffset(dof);
    obspwrf(4095.0);
    delay(d1);

    txphase(zero);
    decphase(zero);

    decrgpulse(pwC, zero, rof1, rof1);
    zgradpulse(gzlvl0, gt0);
    delay(2.0*gstab);
    delay(5.0e-3);


    /************ H->C13 */
    txphase(zero);
    decphase(zero);

    rgpulse(pw,zero,rof1,rof1);

    decpower(pwC180lvl);
    decpwrf(pwC180lvlF);

    delay(gstab);
    zgradpulse(gzlvl5, gt5);
    delay(tauch - gt5 -gstab);


    simshaped_pulse("hard",C180shape,2.0*pw,pwC180,zero,zero, 0.0, 0.0);


    decpower(pwClvl);
    decpwrf(4095.0);
    txphase(one);
    delay(tauch - gt5-gstab);
    zgradpulse(gzlvl5, gt5);
    delay(gstab);

    rgpulse(pw, one, rof1,rof1);

    /*** purge   */
    dec2power(pwNlvl);
    dec2pwrf(4095.0);
    txphase(zero);
    decphase(t2);
    delay(gstab);
    zgradpulse(gzlvl2, gt2);

    delay(3.0*gstab);


    /*  evolution on t1 */

    /* real time here */
    if(CT[A]=='n')
    {
        decrgpulse(pwC, t2, 0.0, 0.0);
        decphase(zero);
        decpower(pwC180lvl);
        decpwrf(pwC180lvlF);

        delay(tau1);
        obsunblank();
        rgpulse(pw,one,rof1,0.0);
        rgpulse(2.0*pw,zero,0.0,0.0);
        rgpulse(pw,one,0.0,rof1);
        obsblank();

        if(refocN15[A]=='y') dec2rgpulse(2.0*pwN,zero,0.0,0.0); /*n15 refocusing */

        if(refocCO[A]=='y')
        {
            decpower(pwCOlvl);
            decshaped_pulse(COshape,pwCO,zero, 3.0e-6, 3.0e-6);
            decpower(pwC180lvl);
        }


        delay(tau1);


        /*************** CODING with CLUB sandwitches and BIPS */


        zgradpulse(gzlvl3*icosel, gt3);
        delay(gstab1);
        decshaped_pulse(C180shape,pwC180,zero, 0.0, 0.0);
        zgradpulse(-gzlvl3*icosel, gt3);

        delay(gstab1 +rof1*2.0+pw*4.0 +pwC*4.0/M_PI +2.0*POWER_DELAY+2.0*PWRF_DELAY);

        if(refocN15[A]=='y') delay(2.0*pwN); /*n15 refocusing */
        if(refocCO[A]=='y') /* ghost CO pulse */
        {
            decpower(pwCOlvl);
            decshaped_pulse(COshape,pwCO,zero, 3.0e-6, 3.0e-6);
            decpower(pwC180lvl);
        }


        zgradpulse(-gzlvl3*icosel, gt3);
        delay(gstab1);
        decshaped_pulse(C180shape,pwC180,zero, 0.0, 0.0);
        zgradpulse( gzlvl3*icosel, gt3);
        decpower(pwClvl);
        decpwrf(4095.0);
        delay(gstab1);
    }      /* end of if bracket  for real-time  */
    /*^^^^^^^ end of real time */


    /* CONSTANT TIME VESION: */
    if(CT[A]=='y')
    {
        decrgpulse(pwC, t2, 0.0, 0.0);

        /* timeCC-t1 evolution */
        decpower(pwC180lvl);
        decpwrf(pwC180lvlF);
        delay((timeCC-tau1)*0.5 -2.0*pw -pwCO*0.5 -pwN-rof1);

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

        if(refocN15[A]=='y') dec2rgpulse(2.0*pwN,zero,0.0,0.0); /*n15 refocusing */
        if(refocCO[A]=='y' )
        {
            decpower(pwCOlvl);
            decshaped_pulse(COshape,pwCO,zero, 3.0e-6, 3.0e-6);
            decpower(pwC180lvl);
        }
        delay((timeCC-tau1)*0.5 -2.0*pw -pwCO*0.5 -pwN-rof1);
        /* end of timeCC-t1 evolution */
        /* 180 on carbons in T1 */

        decshaped_pulse(C180shape,pwC180,zero, 0.0, 0.0);

        /* timeCC+t1 evolution  + encoding */

        delay((timeCC+tau1)*0.5 -2.0*pw -pwCO*0.5 -pwN -rof1);

        obsunblank();
        rgpulse(pw,one,rof1,0.0);
        rgpulse(2.0*pw,zero,0.0,0.0);
        rgpulse(pw,one,0.0,rof1);
        obsblank();
        if(refocN15[A]=='y') dec2rgpulse(2.0*pwN,zero,0.0,0.0); /*n15 refocusing */
        if(refocCO[A]=='y' )
        {
            decpower(pwCOlvl);
            decshaped_pulse(COshape,pwCO,zero, 3.0e-6, 3.0e-6);
            decpower(pwC180lvl);
        }

        delay((timeCC+tau1)*0.5 -2.0*pw -pwCO*0.5 -pwN -rof1);

        zgradpulse(-gzlvl3*icosel, gt3*2.0); /* coding */
        delay(gstab +pwC*4.0/M_PI);
        decshaped_pulse(C180shape,pwC180,zero, 2e-6, 2e-6); /* ghost BIP pulse */
        zgradpulse(gzlvl3*icosel, gt3*2.0); /* coding */
        delay(gstab);

    } /*^^^^^^^ end of CONSTANT  time  bracket*/

    /*reverse INPET */



    simpulse(pw, pwC, zero, t10, 0.0, 0.0);
    delay(gstab);
    zgradpulse(gzlvl4,gt4);
    decpower(pwC180lvl);
    decpwrf(pwC180lvlF);
    delay(tauch - gt4 - gstab -corrD-pwC180 -POWER_DELAY-PWRF_DELAY);


    decshaped_pulse(C180shape,pwC180,zero, 0.0, 0.0);
    delay(corrD);
    rgpulse(2.0*pw,zero,rof1,rof1);

    zgradpulse(gzlvl4,gt4);
    delay(tauch - gt4 - gstab -corrB-pwC180 -POWER_DELAY-PWRF_DELAY);

    delay(gstab);

    decphase(one);
    txphase(one);
    decshaped_pulse(C180shape,pwC180,zero, 0.0, 0.0);
    decpower(pwClvl);
    decpwrf(4095.0);
    delay(corrB);


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

    decpower(pwC180lvl);
    decpwrf(pwC180lvlF);
    delay(gstab-POWER_DELAY-PWRF_DELAY -WFG_START_DELAY);
    zgradpulse(gzlvl5,gt5);
    delay(tauch1 - gt5 - gstab);

    simshaped_pulse("hard",C180shape,2.0*pw,pwC180,zero,zero, 0.0, 0.0);

    delay(tauch1- gt5 - gstab -  WFG_STOP_DELAY);
    zgradpulse(gzlvl5,gt5);
    delay(gstab-rof1);
    rgpulse(pw, zero,rof1,rof1);

    /* echo and decoding */

    delay(gstab+gt9-rof1+10.0e-6 + 2.0*POWER_DELAY+PWRF_DELAY +2.0*GRADIENT_DELAY);
    decoffset(dof_dec);
    rgpulse(2.0*pw, zero,rof1,rof1);
    delay(10.0e-6);
    zgradpulse(gzlvl9,gt9);
    decpower(dpwr);
    decpwrf(4095.0);
    decoffset(dof_dec);
    dec2power(dpwr2); /* POWER_DELAY EACH */
    delay(gstab);
    status(C);
    setreceiver(t11);
}
Example #18
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);
}
Example #19
0
pulsesequence()
{
   double   gzlvlE = getval("gzlvlE"),
            gtE = getval("gtE"),
            EDratio = getval("EDratio"),
            gstab = getval("gstab"),
            hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            slpwT = getval("slpwT"),
            slpwrT = getval("slpwrT"),
            trim = getval("trim"),
            mixT = getval("mixT"),
            mult = getval("mult"),
            tau,
	    gtau;
   int      icosel,
	    phase1 = (int)(getval("phase")+0.5);
   char     slpatT[MAXSTR];

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

   getstr("slpatT",slpatT);

   if (strcmp(slpatT,"mlev17c") &&
        strcmp(slpatT,"dipsi2") &&
        strcmp(slpatT,"dipsi3") &&
        strcmp(slpatT,"mlev17") &&
        strcmp(slpatT,"mlev16"))
        abort_message("SpinLock pattern %s not supported!.\n", slpatT);

   tau  = 1/(4*(getval("j1xh")));
   gtau =  2*gstab + 2*GRADIENT_DELAY;
   icosel = 1;

  settable(t1,2,ph1);
  settable(t2,4,ph2);
  settable(t3,4,ph3);

  assign(zero,v6);
  getelem(t1,ct,v1);
  getelem(t3,ct,oph);

   assign(two,v3);
   sub(v3,one,v2);
   add(v3,one,v4);
   add(v3,two,v5);
/*
   mod2(id2,v14);
   dbl(v14,v14);
*/
  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v14);

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

  add(v1,v14,v1);
  add(v6,v14,v6);
  add(oph,v14,oph);

status(A);
  obspower(tpwr);

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

   if (satmode[0] == 'y')
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
        satpulse(satdly,zero,rof1,rof1);
     }
   else
        delay(d1);

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

   decpower(pwxlvl);

status(B);

      if (getflag("nullflg"))
      {
        rgpulse(0.5*pw,zero,rof1,rof1);
        delay(2*tau);
        simpulse(2.0*pw,2.0*pwx,zero,zero,rof1,rof1);
        delay(2*tau);
        rgpulse(1.5*pw,two,rof1,rof1);
        zgradpulse(hsglvl,hsgt);
        delay(1e-3);
      }

     rgpulse(pw,zero,rof1,rof1);
     delay(2*tau - 2*rof1 - (2*pw/PI));

     decrgpulse(pwx,v1,rof1,1.0e-6);
     delay(gtE/2.0+gtau - (2*pwx/PI) - pwx - 1.0e-6 - rof1);
     decrgpulse(2*pwx,v6,rof1,1.0e-6);
     delay(gstab - pwx - 1.0e-6);
     zgradpulse(gzlvlE,gtE/2.0);
     delay(gstab - rof1 - pw);

     delay(d2/2);
     rgpulse(2.0*pw,zero,rof1,rof1);
     delay(d2/2);

     delay(gstab - rof1 - pw);
     zgradpulse(gzlvlE,gtE/2.0);
     delay(gstab - pwx - rof1);
     decrgpulse(2*pwx,zero,rof1,1.0e-6);
     delay(gtE/2.0+gtau - (2*pwx/PI) - pwx - 1.0e-6 - rof1);

     decrgpulse(pwx,t2,rof1,rof1);
     delay(2*tau - rof1 - POWER_DELAY);

     obspower(slpwrT);

     if (mixT > 0.0)
     {
        rgpulse(trim,v5,0.0,0.0);
        if (dps_flag)
          rgpulse(mixT,v3,0.0,0.0);
        else
          SpinLock(slpatT,mixT,slpwT,v2,v3,v4,v5,v9);
     }

      obspower(tpwr);
      if (mult > 0.5)
       delay(2*tau - rof1);
      else
       delay(gtE/2 + gstab + 2*GRADIENT_DELAY - rof1);
      simpulse(2*pw,mult*pwx,one,zero,rof1,rof2);
      decpower(dpwr);
      zgradpulse(icosel*2*gzlvlE/EDratio,gtE/2.0);
      if (mult > 0.5)
      	delay(2*tau - gtE/2 - 2*GRADIENT_DELAY);
      else
	delay(gstab);

  status(C);
} 
Example #20
0
pulsesequence()
{
  /* DECLARE AND LOAD VARIABLES */

  char f1180[MAXSTR],		/* Flag to start t1 @ halfdwell */
       f2180[MAXSTR],		/* Flag to start t2 @ halfdwell */
       H2Opurge[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 */
         BPdpwrspinlock,        /*  user-defined upper limit for spinlock(Hz) */
         BPpwrlimits,           /*  =0 for no limit, =1 for limit             */
         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 */
	 /* 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 9.0 kHz rf at 600MHz         */
         ncyc = getval("ncyc"),	/* no. of cycles of DIPSI-3 */
         spinlock = getval("spinlock"),		/* DIPSI-3 Field Strength in Hz */
	 /* the following pulse length for the SLP pulse is automatically calculated   */
	 /* by the macro "hcch_tocsy".  The SLP pulse shape,"offC10" is called         */
	 /* directly from your shapelib.                                               */
         pwC10 = getval("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 */
         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");

  getstr("f1180", f1180);
  getstr("f2180", f2180);
  getstr("H2Opurge", H2Opurge);
  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);

  P_getreal(GLOBAL,"BPpwrlimits",&BPpwrlimits,1);
  P_getreal(GLOBAL,"BPdpwrspinlock",&BPdpwrspinlock,1);

  /*   LOAD PHASE TABLE    */
  settable(t3, 2, phi3);
  settable(t5, 4, phi5);
  settable(t9, 8, phi9);
  settable(t11, 8, 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);
  }

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

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

  /* 180 degree one-lobe sinc pulse on CO, null at Ca 139ppm away */
  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 (spinlock < 1000.0)
  {
    printf("Spinlock seems too low. Please check spinlock value ! ");
    psg_abort(1);
  }

  /* dipsi-3 spinlock on CbCa */
  p_d = (5.0) / (9.0 * 4.0 * spinlock);		/* DIPSI-3 */
  rfd = (compC * 4095.0 * pwC * 5.0) / (p_d * 9.0);
  rfd = (int) (rfd + 0.5);
  ncyc = (int) (ncyc + 0.5);
/*************************For Ultra-High Field Probes***************************/
if (sfrq>590.0)
{
 if (ncyc>2)
  {
    if (pwC>15)
     {
      if (rfd > 2000)
       {
        printf("spinlock too large. Lower value for probe protection");
        psg_abort(1);
       }
     }
    else
     {
      if (pwC>14)
       {
        if (rfd > 1800)
         {
          printf("spinlock too large. Lower value for probe protection");
          psg_abort(1);
         }
       }
      else
       {
        if (pwC>13)
         {
          if (rfd > 1600)
           {
            printf("spinlock too large. Lower value for probe protection");
            psg_abort(1);
           }
         }
        else
         {
          if (pwC>12)
           {
            if (rfd > 1400)
             {
               printf("spinlock too large. Lower value for probe protection");
               psg_abort(1);
             }
           }
          else
           {
            if (pwC>11)
             {
              if (rfd > 1200)
               {
                printf("spinlock too large. Lower value for probe protection");
                psg_abort(1);
               }
             }
            else
             {
                if (rfd > 1000)
                 {
                  printf("spinlock too large. Lower value for probe protection");
                  psg_abort(1);
                 }
             }
           }
         }    
       }
     }
  }
 else 
  {
   if (ncyc == 2)
    {
     if (pwC>15)
      {
       if (rfd > 2200)
        {
         printf("spinlock too large. Lower value for probe protection");
         psg_abort(1);
        }
      }
     else
      {
       if (pwC>14)
        {
         if (rfd > 2000)
          {
           printf("spinlock too large. Lower value for probe protection");
           psg_abort(1);
          }
        }
       else
        {
         if (pwC>13)
          {
           if (rfd > 1800)
            {
             printf("spinlock too large. Lower value for probe protection");
             psg_abort(1);
            }
          }
         else
          {
           if (pwC>12)
            {
             if (rfd > 1600)
              {
                printf("spinlock too large. Lower value for probe protection");
                psg_abort(1);
              }
            }
           else
            {
             if (pwC>11)
              {
               if (rfd > 1400)
                {
                 printf("spinlock too large. Lower value for probe protection");
                 psg_abort(1);
                }
              }
             else
              {
                 if (rfd > 1200)
                  {
                   printf("spinlock too large. Lower value for probe protection");
                   psg_abort(1);
                  }
              }
            }
          }    
        }
      }
     }
   else
    {
     if (ncyc == 1)
      {
       if (pwC>15)
        {
         if (rfd > 2400)
          {
           printf("spinlock too large. Lower value for probe protection");
           psg_abort(1);
          }
        }
       else
        {
         if (pwC>14)
          {
           if (rfd > 2200)
            {
             printf("spinlock too large. Lower value for probe protection");
             psg_abort(1);
            }
          }
         else
          {
           if (pwC>13)
            {
             if (rfd > 2000)
              {
               printf("spinlock too large. Lower value for probe protection");
               psg_abort(1);
              }
            }
           else
            {
             if (pwC>12)
              {
               if (rfd > 1800)
                {
                  printf("spinlock too large. Lower value for probe protection");
                  psg_abort(1);
                }
              }
             else
              {
               if (pwC>11)
                {
                 if (rfd > 1600)
                  {
                   printf("spinlock too large. Lower value for probe protection");
                   psg_abort(1);
                  }
                }
               else
                {
                   if (rfd > 1400)
                    {
                     printf("spinlock too large. Lower value for probe protection");
                     psg_abort(1);
                    }
                }
              }
            }       
          }
        }
      }
    }

  }


}
/*********************End: For Ultra-High Field Probes***************************/

  /* 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;



  /* 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')		/* 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 */
  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("offC10", 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("offC10", pwC10, zero, 0.0, 0.0);
  zgradpulse(gzlvl4, gt4);	/* 2.0*GRADIENT_DELAY */
  delay(taub - gt4 - 2.0 * GRADIENT_DELAY);
  decpwrf(rfd);
  decrgpulse(1.0e-3, zero, 0.0, 0.0);
  if (ncyc>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);
    rgpulse(900 * pw, zero, 0.0, 0.0);
    rgpulse(500 * pw, one, 0.0, 0.0);
    obspwrf(4095.0);
  }
  zgradpulse(gzlvl7, gt7);
  decpwrf(rf0);
  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')		/* 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 */
  }
  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);
  if (STUD[A] == 'y')
    decpower(studlvl);
  else
    decpower(dpwr);
  dec2power(dpwr2);
  delay(taua - gt5 - 2.0 * POWER_DELAY);
  rgpulse(pw, zero, 0.0, rof2);
  rcvron();
  if (dm3[B] == 'y')
    lk_sample();
  setreceiver(t11);
  if ((STUD[A] == 'y') && (dm[C] == 'y'))
  {
    decprgon(stCdec, 1.0 / stdmf, 1.0);
    decon();
    if (dm2[C] == 'y')
    {
      setstatus(DEC2ch, TRUE, dmm2[C], FALSE, dmf2);
    }
  }
  else
    status(C);
}
Example #21
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();

}		 
Example #22
0
pulsesequence()

{

/* DECLARE VARIABLES */	

char	scuba[MAXSTR],	
	mess_flg[MAXSTR],
	imino[MAXSTR],
	amino[MAXSTR],
	jumpret[MAXSTR],
	C13refoc[MAXSTR];

int	phase,
	t1_counter;

double	hscuba,		/* length of 1/2 SCUBA delay 	*/
	taunh,		/* 1/4J(NH)			*/
	tofps,		/* water frequency		*/
	tpwrmess,	/* power level for Messerlie purge */
	dly_pg,		/* Messerlie purge delay	*/
	pwClvl,		/* power level for 13C hard pulse */
	pwNlvl,		/* power level for 15N hard pulse */
	pwC,		/* pulse width for 13C hard pulse */
	pwN,		/* pulse width for 15N hard pulse */
	JNH,		/* coupling for NH		*/
	diff,		/* freq diff H2O & exit center	*/
	dof2a,		/* offset for imino/amino	*/
	tau1,		/* t1/2				*/
	grecov,		/* gradient recovery time 	*/
	gzlvl0,		/* level of grad. for purge	*/
	gzlvl1,		/* level of grad. for 1/2J	*/
	gt1,		/* grad. duration for 1/2J	*/
	gzlvlr;		/* level of RDt1-gradient (0.5G) */

/* LOAD VARIABLES */

	JNH	= getval("JNH");
	diff	= getval("diff");
	pwC	= getval("pwC");
	pwN	= getval("pwN");
	tofps	= getval("tofps");
	tpwrmess= getval("tpwrmess");
	dly_pg	= getval("dly_pg");
	pwClvl	= getval("pwClvl");
	pwNlvl	= getval("pwNlvl");
	hscuba	= getval("hscuba");
	phase	= (int)(getval("phase") + 0.5);
	sw1	= getval("sw1");
	at	= getval("at");
	grecov	= getval("grecov");
	gt1	= getval("gt1");
	gzlvl0	= getval("gzlvl0");
	gzlvl1	= getval("gzlvl1");
	gzlvlr  = getval("gzlvlr");

	getstr("scuba",scuba);
	getstr("mess_flg",mess_flg);
	getstr("imino",imino);
	getstr("amino",amino);
        getstr("jumpret",jumpret);
	getstr("C13refoc",C13refoc);

/* CHECK VALIDITY OF PARAMETER RANGE */

  if (dm[A] == 'y' || dm[B] == 'y')
   {
	printf(" dm must be 'nny' or 'nnn' ");
	psg_abort(1);
   }

  if ((dm[C] == 'y' || dm2[C] == 'y') && at > 0.21)
   {
	printf(" check at time! Don't fry probe \n");
	psg_abort(1);
   }

  if (dm2[A] == 'y' || dm2[B] == 'y')
   {
	printf(" dm2 must be 'nny' or 'nnn' ");
	psg_abort(1);
   }

  if ( ((imino[A]=='y') && (amino[A]=='y')) )
   {
        printf(" Choose  ONE  of  imino='y'  OR  amino='y' ");
        psg_abort(1);
   }

  if ((satmode[A] == 'y') && (jumpret[A] == 'y'))
   {
	printf(" Choose EITHER presat (satmode='y') OR Jump-Return (jumpret='y') \n");
	psg_abort(1);
   }

  if (satpwr > 12)
   {
	printf(" satpwr must be less than 13 \n");
	psg_abort(1);
   }

  if (tpwrmess > 55)
   {
	printf(" tpwrmess must be less than 55 \n");
	psg_abort(1);
   }

  if (dly_pg > 0.010)
   {
	printf(" dly_pg must be less than 10msec \n");
	psg_abort(1);
   }

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

  if (dpwr2 > 50)
   {
	printf(" dpwr2 must be less than 46 \n");
	psg_abort(1);
   }

  if (gt1 > 5.0e-3)
   {
	printf(" gti must be less than 5msec \n");
	psg_abort(1);
   }

  if (gzlvl0 > 32768 || gzlvl1 > 32768 || gzlvl0 < -32768 || gzlvl1 < -32768)
   {
	printf(" gzlvli must be -32768 to 32768 (30G/cm) \n");
	psg_abort(1);
   }

  if (gzlvlr > 500 || gzlvlr < -500) 
   {
        printf(" RDt1-gzlvlr must be -500 to 500 (0.5G/cm) \n");
        psg_abort(1);
   }

/* LOAD PHASE PARAMETERS */

	settable(t1, 8, phi1);
	settable(t2, 2, phi2);
	settable(t3, 8, phi3);
	settable(t4, 1, phi4);
	settable(t5, 8, rec);

/* INITIALIZE VARIABLES */

	taunh = ((JNH != 0.0) ? 1/(4*(JNH)) : 2.78e-3);

	dof2a = dof2;
/* IMINO-region setting of dof2 */
	if (imino[A] == 'y')
		dof2a = dof2 - 45*dfrq2;

/* AMINO-region setting of dof2 */
	else if (amino[A] == 'y')
		dof2a = dof2 - 115*dfrq2;

/* Phase incrementation for hyper complex data in t1 */

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

/* Calculate modification to phase based on current t1 values: States - TPPI acquisition    */

  if( ix == 1)
	d2_init = d2;

	t1_counter = (int) ((d2 - d2_init)*sw1 + 0.5);

  if (t1_counter %2)
   {
	tsadd(t2, 2, 4);
	tsadd(t5, 2, 4);
   }

/* Set up so that you get (90, -180) phase correction in F1 */

	tau1 = d2;
	tau1 = tau1 -(4.0/PI)*pwN;
        tau1 = tau1 / 2.0;


/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);

	obspower(satpwr);	/* Set power for presaturation	*/
	decpower(pwClvl);	/* Set DEC1 power to pwClvl	*/
	dec2power(pwNlvl);	/* Set DEC2 power to pwNlvl	*/

	obsoffset(tof);
	decoffset(dof);
	dec2offset(dof2a);


  if (mess_flg[A] == 'y')	/* Option for Messerlie purge */
   {
	obsoffset(tofps);
	obspower(tpwrmess);
	txphase(zero);
	xmtron();
	delay(dly_pg);
	xmtroff();
	txphase(one);
	xmtron();
	delay(dly_pg/1.62);
	xmtroff();
	obsoffset(tof);
	obspower(satpwr);
   }

  if (satmode[A] == 'y')		/* Presaturation Period */
   {
	txphase(zero);
	xmtron();		/* presaturation using transmitter	*/
	delay(d1);
	xmtroff();
	obspower(tpwr);		/* set power for hard pulse	*/

  if (scuba[A] == 'y')		/* SCUBA pulse	*/
   {
	hsdelay(hscuba);
	rgpulse(pw, zero, rof1, 0.0);
	rgpulse(2*pw, one, rof1, 0.0);
	rgpulse(pw, zero, rof1, 0.0);
	delay(hscuba);
   }
   }

  else 
   {
	obspower(tpwr);
	delay(d1);
   }

        dec2rgpulse(pwN,zero, 0.0, 0.0); /* destroy N15 magnetization */
        zgradpulse(gzlvl0, 0.5e-3);
        delay(1.0e-4);
        dec2rgpulse(pwN, one, 0.0, 0.0);
        zgradpulse(0.7*gzlvl0, 0.5e-3);
        decphase(t2);
        delay(grecov);

status(B);

  if (jumpret[A] == 'y')
   {
	rgpulse(pw, zero, rof1, rof1);	/* jump-return pulse */
	delay(0.25 / diff - 2.0*rof1);
	rgpulse(pw, two, rof1, rof1);
   }

  else
        rgpulse(pw, zero, rof1, rof1);

        zgradpulse(gzlvl1,gt1);
        delay(taunh - gt1 - 2.0*GRADIENT_DELAY );	/* delay = 1.0/2J(NH) */
        delay(taunh);
	dec2rgpulse(pwN, t2, 0.0, 0.0);
	dec2phase(t4);

 if (jumpret[A] == 'y')
  {
         tau1 = tau1-(pw+rof1+0.25/diff) ;
         if (tau1 < 0.0)  tau1 = 0.0;
      
        if (tau1 > 0.001)
         {
              zgradpulse(gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));  /* delay = t1/2 */
              delay(0.1*tau1);
              zgradpulse(-gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));
              delay(0.1*tau1);
         }
        else
             delay(tau1);				/* delay = t1/2 */
	rgpulse(pw, t1, rof1, rof1);

	if (C13refoc[A] == 'y')
	{
	delay((0.25 / diff) - pwC -rof1 );
	decrgpulse(2*pwC, zero, 0.0, 0.0);
	delay((0.25 / diff) - pwC -rof1) ;
   	}

  	else
   	{
	delay(0.25 / diff);
	delay(0.25 / diff);
   	}
	rgpulse(pw, t3, rof1, rof1);
        txphase(zero);
     if (tau1 > 0.001)
      {
        zgradpulse(gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));  /* delay = t1/2 */
        delay(0.1*tau1);
        zgradpulse(-gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));
        delay(0.1*tau1);
      }
     else
        delay(tau1);                               /* delay = t1/2 */
  }
else
  {
     if (C13refoc[A] == 'y')
         tau1 = tau1-(pwC+rof1) ;
     else
         tau1 = tau1-(pw+rof1) ;

     if (tau1 < 0.0)  tau1 = 0.0;
     if (tau1 > 0.001)
      {
        zgradpulse(gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));  /* delay = t1/2 */
        delay(0.1*tau1);
        zgradpulse(-gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));
        delay(0.1*tau1);
      }
     else
	delay(tau1);				/* delay = t1/2 */

     if (C13refoc[A] == 'y')
       simpulse(2*pw, 2*pwC, t1, zero, rof1, rof1);
     else
       rgpulse(2*pw, t1, rof1, rof1);
      txphase(zero);
	 
     if (tau1 > (4.0*GRADIENT_DELAY + 0.64*pw + rof1))
      {
        if (tau1 > 0.001)
        {
         zgradpulse(gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));  /* delay = t1/2 */
         delay(0.1*tau1);
         zgradpulse(-gzlvlr,(0.4*tau1-2.0*GRADIENT_DELAY));
         delay(0.1*tau1);
        }
        else
         delay(tau1);
      }
     else
        delay(tau1);                               /* delay = t1/2 */
}
	dec2rgpulse(pwN, t4, 0.0, 0.0);

	zgradpulse(gzlvl1,gt1);
	decpower(dpwr);			/* low power for decoupling */
	dec2power(dpwr2);
	delay(taunh - gt1 - 2.0*GRADIENT_DELAY-2.0*POWER_DELAY);		/* delay = 1/2J(NH) */
        delay(taunh);
status(C);

	setreceiver(t5);
}
Example #23
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);
}		 
void pulsesequence()
{
/* DECLARE VARIABLES */

char satflg[MAXSTR];

int          t1_counter;

double    
   tau1, tau2, tau3,
   pw  = getval("pw"), 
   tpwr= getval("tpwr"),
   mix = getval("mix"),
   sw1 = getval("sw1"),
   jch = getval("jch"), 
   pwC = getval("pwC"),
   pwClvl = getval("pwClvl"),
   pwNlvl = getval("pwNlvl"),
   tauCH, 
   sw_hm1 = getval("sw_hm1"),
   sw_cm1 = getval("sw_cm1"),
   sw_cm2 = getval("sw_cm2"),
   pwHs = getval("pwHs"),
   swTilt, 
   angle_hm1 = getval("angle_hm1"),
   angle_cm1 = getval("angle_cm1"),
   angle_cm2 = getval("angle_cm2"),
   cos_hm1, cos_cm1, cos_cm2,
   satdly= getval("satdly"),
   gstab = getval("gstab"),
   gt0 = getval("gt0"),    gzlvl0 = getval("gzlvl0"),
   gt1 = getval("gt1"),    gzlvl1 = getval("gzlvl1"),
   gt2 = getval("gt2"),    gzlvl2 = getval("gzlvl2"),
   gt3 = getval("gt3"),    gzlvl3 = getval("gzlvl3"),
   gt4 = getval("gt4"),    gzlvl4 = getval("gzlvl4"),
   gt5 = getval("gt5"),    gzlvl5 = getval("gzlvl5"),
   gt6 = getval("gt6"),    gzlvl6 = getval("gzlvl6"),
   gt7 = getval("gt7"),    gzlvl7 = getval("gzlvl7"),
   gt8 = getval("gt8"),    gzlvl8 = getval("gzlvl8"),
   gt9 = getval("gt9"),    gzlvl9 = getval("gzlvl9"),
   gt10 = getval("gt10"),  gzlvl10 = getval("gzlvl10");

   cos_cm2=0.0; 
   getstr("satflg", satflg);

/* LOAD PHASE TABLE */

   tauCH = 1.0/4.0/jch;

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

/* CHECK VALIDITY OF PARAMETER RANGES */

   if (dpwr  > 49)  {printf("DPWR too large!" ); psg_abort(1); }
   if (dpwr2 > 49)  {printf("DPWR2 too large!"); psg_abort(1); }

/* Phases and delays related to PR-NMR */
   /* sw1 is used as symbolic index */
   if ( sw1 < 1000 ) { printf ("Please set sw1 to some value larger than 1000.\n"); psg_abort(1); }

   if (angle_hm1 < 0 || angle_cm1 < 0 || angle_hm1 > 90 || angle_cm1 > 90 )
   { printf("angles must be set between 0 and 90 degree.\n"); psg_abort(1); }

   cos_hm1 = cos (PI*angle_hm1/180);  cos_cm1 = cos (PI*angle_cm1/180);
   if ( (cos_hm1*cos_hm1 + cos_cm1*cos_cm1) > 1.0) { printf ("Impossible angle combinations.\n"); psg_abort(1); }
   else { cos_cm2 = sqrt(1 - (cos_hm1*cos_hm1 + cos_cm1*cos_cm1) );  angle_cm2 = acos(cos_cm2)*180/PI;  }

   if (ix == 1) d2_init = d2;
   t1_counter = (int)((d2-d2_init)*sw1 + 0.5);

   swTilt = sw_hm1*cos_hm1 + sw_cm1*cos_cm1 + sw_cm2*cos_cm2; 

   /* Note the reconstruction software assumes the indirectly determined dimension, here cm2 */
   /* always have the phase change first */



   if (phase1 == 1) {; }                                                             /* CC */
   else if (phase1 == 2) { tsadd (t1, 1, 4); }                                       /* SC */
   else if (phase1 == 3) { tsadd (t2, 1, 4); }                                       /* CS */
   else if (phase1 == 4) { tsadd (t1, 1, 4);  tsadd(t2, 1, 4); }                     /* SS */

   if (phase2 ==1) {;} else { tsadd (t3, 1, 4); }


   if (t1_counter %2) { tsadd(t3, 2, 4); tsadd(t5, 2, 4); }

   tau1 = 1.0*t1_counter*cos_hm1/swTilt;
   tau2 = 1.0*t1_counter*cos_cm1/swTilt;
   tau3 = 1.0*t1_counter*cos_cm2/swTilt;

   tau1 = tau1/2.0;  tau2 = tau2/2.0;  tau3 = tau3/2.0;

   if (ix ==1 )
   {
      printf ("Current Spectral Width:\t\t%5.2f\n", swTilt);
      printf ("Angle_hm1: %5.2f \n", angle_hm1);
      printf ("Angle_cm1: %5.2f \n", angle_cm1);
      printf ("Angle_cm2: %5.2f \n", angle_cm2);
      printf ("\n\n\n\n\n");
   }

/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   delay(d1);
   rcvroff(); 

   obsoffset(satfrq);   obspower(tpwr);       obspwrf(4095.0);   txphase(zero);
   decoffset(dof);      decpower(pwClvl);     decpwrf(4095.0);   decphase(zero);
   dec2offset(dof2);    dec2power(pwNlvl);    dec2pwrf(4095.0);  dec2phase(zero);

   /* Crush water and steady state carbon magnetization */

   if (satflg[A] == 'y')
   {
      obspower(satpwr);
      rgpulse(satdly, zero, 20.0e-6, 2.0e-6);
      obspower(tpwr);      
   }

   decrgpulse(pwC, zero, 2.0e-6, 2.0e-6);  /*destroy C13 magnetization*/
   zgradpulse(gzlvl0, gt0);
   delay(gstab);


   if (satflg[A] == 'y')
   {
      shiftedpulse("sinc", pwHs, 90.0, 0.0, zero, 2.0e-6, 2.0e-6);
   }
   decrgpulse(pwC, one, 2.0e-6, 2.0e-6);
   zgradpulse(0.7*gzlvl0, gt0);
   txphase(t1);         
   delay(gstab);

   obsoffset(tof);     obspower(tpwr);
 
status(B);

   rgpulse(pw, t1, 2.0e-6, 2.0e-6);                       /* 1H pulse excitation */

      if (tau1 > pwC)
      {
         delay(tau1 - pwC);
         decrgpulse(2.0*pwC, zero, 0.0, 0.0);
         delay(tau1 - pwC);
      }
      else
      {
         delay(2.0*tau1);
      }
                                                                /* point a */
      zgradpulse(gzlvl1, gt1);                       /* 2.0*GRADIENT_DELAY */
      txphase(zero); decphase(zero);
      delay(tauCH - gt1 - 4.0e-6);

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

      delay(tauCH -gt1 -gstab -4.0e-6);
      zgradpulse(gzlvl1, gt1);                        /* 2.0*GRADIENT_DELAY */
      txphase(one);
      delay(gstab);
                                                                /* point b */
   rgpulse(pw, one, 2.0e-6, 2.0e-6);

   /* ======================HzCz=================== */
      zgradpulse(gzlvl2, gt2);
      txphase(zero);    decphase(t2);
      delay(gstab);
   /* ======================HzCz=================== */

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

      if ((tau2 - 2.0*pwC/PI -pw) > 0 )
      {
         delay(tau2 - 2.0*pwC/PI - pw);
         rgpulse (2.0*pw, zero, 0.0, 0.0);
         decphase(zero);
         delay(tau2 - 2.0*pwC/PI - pw);
      }
      else
      {
         delay(2.0*tau2);
         decphase(one);    delay(2.0e-6);
         simpulse(2.0*pw, 2.0*pwC, zero, one, 0.0, 0.0);
         decphase(zero);   delay(2.0e-6);
      }

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

   /* ======================HzCz=================== */
      zgradpulse(gzlvl3, gt3);
      txphase(zero);
      delay(gstab);
   /* ======================HzCz=================== */

   rgpulse(pw, zero, 2.0e-6, 2.0e-6);

      zgradpulse(gzlvl4, gt4);
      delay(tauCH - gt4 - 4.0e-6);
      
   simpulse(2.0*pw, 2.0*pwC, zero, zero, 2.0e-6, 2.0e-6);
      
      delay(tauCH - gt4 - gstab -4.0e-6);
      zgradpulse(gzlvl4, gt4);
      txphase(one);
      delay(gstab);

   rgpulse(pw, one, 2.0e-6, 2.0e-6);

   /* H only, beginning of NOE transfer period */
  
      obsoffset(satfrq);

      decphase(zero);
      delay(mix - gt5 - gt6 - pwC -1.0e-3 -2.0*pwHs ); 

      txphase(zero);
      shiftedpulse("sinc", pwHs, 90.0, 0.0, zero, 2.0e-6, 2.0e-6);

      zgradpulse(gzlvl5, gt5);
      delay(gstab);

      txphase(one);
      decrgpulse(pwC,zero,2.0e-6, 2.0e-6); 
      shiftedpulse("sinc", pwHs, 90.0, 0.0, one, 2.0e-6, 2.0e-6);
 
      zgradpulse(gzlvl6, gt6);
      txphase(zero);
      delay(gstab);

   /* End of NOE transfer period */
  
   /* Second HSQC step begins here */

   rgpulse(pw,zero,2.0e-6,2.0e-6);
      
      zgradpulse(gzlvl7, gt7);      
      delay(tauCH - gt7 - 4.0e-6 );

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

      delay(tauCH - gt7 - gstab -4.0e-6 );
      zgradpulse(gzlvl7, gt7);      
      txphase(one);
      delay(gstab);

   rgpulse(pw, one, 2.0e-6, 2.0e-6);

   /* ------------HzCz----------------- */
      zgradpulse(gzlvl8, gt8);
      txphase(zero);  decphase(t3);
      delay(gstab);
   /* ------------HzCz----------------- */

   decrgpulse(pwC, t3, 2.0e-6,0.0);   
      if ( tau3 -2.0*pwC/PI - pw > 0.0 ) 
      {
         delay(tau3 - 2.0*pwC/PI - pw);
         rgpulse(2.0*pw, zero, 0.0, 0.0);
         decphase(zero);
         delay(tau3 - 2.0*pwC/PI - pw);
      }
      else
      {
         delay(2.0*tau3);
         decphase(one);    delay(2.0e-6);
         simpulse(2*pw, 2*pwC, zero, one, 0.0, 0.0);  
         decphase(zero);   delay(2.0e-6);
      }
   decrgpulse(pwC, zero, 0.0, 2.0e-6);

   /* ----  HzCz ------------*/
       zgradpulse(gzlvl9, gt9);
       txphase(t4);
       delay(gstab);
   /* ----  HzCz ------------*/

   rgpulse(pw, t4, 2.0e-6, 2.0e-6);
     
      zgradpulse(gzlvl10, gt10);
      delay(tauCH - gt10 - 4.0e-6 );

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

      delay(tauCH - gt10 - gstab -4.0e-6 );
      zgradpulse(gzlvl10, gt10);
      delay(gstab);

   rgpulse(pw, t4, 2.0e-6, rof2);                        /* flip-back pulse  */

   setreceiver(t5);
   decpower(dpwr);

status(D);
}
Example #25
0
pulsesequence()
{
  int       t1_counter;
  char	    CCLS[MAXSTR],	      /* C13 refocussing pulse in middle of t1 */
            wtg3919[MAXSTR],
	    f1180[MAXSTR];   		       /* Flag to start t1 @ halfdwell */

  double    timeCT=getval("timeCT"),
 	    tauxh, tau1,
            gzlvl3=getval("gzlvl3"),
            gzlvl4=getval("gzlvl4"),
            gt3=getval("gt3"),
            gt4=getval("gt4"),
            gstab=getval("gstab"),			/* gradient recovery delay */
            JNH = getval("JNH"),
            pwN = getval("pwN"),
            pwNlvl = getval("pwNlvl"),  
            pwHs, tpwrs=0.0, compH=1.0,          /* H1 90 degree pulse length at tpwrs */               
            sw1 = getval("sw1"),
                               /* temporary Pbox parameters */
            pwClvl = getval("pwClvl"), 	         /* coarse power for C13 pulse */
            pwC = getval("pwC");       /* C13 90 degree pulse length at pwClvl */

    getstr("CCLS",CCLS);
    getstr("wtg3919",wtg3919);
    getstr("f1180",f1180);
    
/* check validity of parameter range */

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

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

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

/* INITIALIZE VARIABLES */
    
    if(wtg3919[0] != 'y')      /* selective H20 one-lobe sinc pulse needs 1.69  */
    {                                   /* times more power than a square pulse */
      pwHs = getval("pwHs");            
      compH = getval("compH");
    }
    else 
      pwHs = pw*2.385+7.0*rof1+d3*2.5; 

    tauxh = ((JNH != 0.0) ? 1/(4*(JNH)) : 2.25e-3);

    setautocal();                        /* activate auto-calibration flags */ 
        
    if (autocal[0] == 'n') 
    {
      if(wtg3919[0] != 'y')      /* selective H20 one-lobe sinc pulse needs 1.69  */
      {                                   /* times more power than a square pulse */
        if (pwHs > 1e-6) tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69));  
        else tpwrs = 0.0;
        tpwrs = (int) (tpwrs); 
      }	  
    }
    else        /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
    {
      if(FIRST_FID)                                            /* call Pbox */
      {
        if(wtg3919[0] != 'y')
          H2Osinc = pbox_Rsh("H2Osinc", "sinc90", pwHs, 0.0, compH*pw, tpwr);
      }
      if (wtg3919[0] != 'y') 
        { pwHs = H2Osinc.pw; tpwrs = H2Osinc.pwr-1.0; } /* 1dB correction applied */ 
    }

/* LOAD VARIABLES */

    if(ix == 1) d2_init = d2;
    t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5);
    
/*  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;


/* LOAD PHASE TABLES */

      assign(one,v7); 
      assign(three,v8);
      settable(t1, 4, phi1);
      settable(t2, 2, phi2);
      settable(t3, 8, phi3);
      settable(t4, 16, phi4);
      settable(t5, 8, rec);  

      if ( phase1 == 2 ) tsadd(t2, 1, 4); 
                                   
    if(t1_counter %2)          /* calculate modification to phases based on */
    { tsadd(t2,2,4); tsadd(t5,2,4); }   /* current t1 values */

    if(wtg3919[0] != 'y') 
    { add(one,v7,v7); add(one,v8,v8); }
         
                           /* sequence starts!! */
   status(A);
     
     obspower(tpwr);
     dec2power(pwNlvl);
     decpower(pwClvl); decpwrf(4095.0);
     delay(d1);
     
   status(B);

     rgpulse(pw, zero, rof1, rof1);
     
     zgradpulse(0.3*gzlvl3,gt3);
     txphase(zero);
     dec2phase(zero);
     delay(tauxh-gt3);               /* delay=1/4J(XH)   */

     sim3pulse(2*pw,0.0,2*pwN,t4,zero,zero,rof1,rof1);

     zgradpulse(0.3*gzlvl3,gt3);
     dec2phase(t2);
     delay(tauxh-gt3 );               /* delay=1/4J(XH)   */
  
     rgpulse(pw, t1, rof1, rof1);

     decphase(zero);
     txphase(t4);      
     zgradpulse(gzlvl3,gt3);
     delay(gstab); 

       dec2rgpulse(pwN, t2, rof1, rof1);
/* CT EVOLUTION BEGINS */
       dec2phase(t3);

       delay(timeCT -SAPS_DELAY -tau1);
       if (CCLS[A]=='y')
         {
          sim3pulse(0.0, 2.0*pwC, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
 
          delay(timeCT -2.0*pw); 

          rgpulse(2.0*pw, t4, 0.0, 0.0);  
         }
        else
         {
          dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
 
          delay(timeCT -2.0*pwC); 

          simpulse(2.0*pw, 2.0*pwC, t4, zero, 0.0, 0.0);
         }
       delay(tau1);
/* CT EVOLUTION ENDS */
       dec2rgpulse(pwN, t3, rof1, rof1);
       
       zgradpulse(gzlvl3,gt3);
       delay(gstab);

       rgpulse(pw, two, rof1, rof1);
       decrgpulse(pwC, zero, rof1, rof1);  

     zgradpulse(gzlvl4,gt4);
     txphase(v7); dec2phase(zero);
     delay(tauxh -gt4 -pwHs -rof1 -2.0*pwC -2.0*rof1);
     
     if(wtg3919[0] == 'y')
     {     	
       rgpulse(pw*0.231,v7,rof1,rof1);     
       delay(d3);
       rgpulse(pw*0.692,v7,rof1,rof1);
       delay(d3);
       rgpulse(pw*1.462,v7,rof1,rof1);

       delay(d3/2-pwN);
       dec2rgpulse(2*pwN, zero, rof1, rof1);
       txphase(v8);
       delay(d3/2-pwN);

       rgpulse(pw*1.462,v8,rof1,rof1);
       delay(d3);
       rgpulse(pw*0.692,v8,rof1,rof1);
       delay(d3);
       rgpulse(pw*0.231,v8,rof1,rof1); 
     }
     else
     {
       obspower(tpwrs);  
       shaped_pulse("H2Osinc", pwHs, v7, rof1, 0.0);
       obspower(tpwr);
       sim3pulse(2.0*pw, 0.0, 2.0*pwN, v8, zero, zero, 0.0, 0.0);
       obspower(tpwrs);
       shaped_pulse("H2Osinc", pwHs, v7, rof1, 0.0);
       obspower(tpwr);
     } 
        
     zgradpulse(gzlvl4,gt4);   
     delay(tauxh -gt4 -pwHs -rof1 -POWER_DELAY); 
     dec2power(dpwr2);

   status(C);
     setreceiver(t5);   
}
Example #26
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);
}		 
Example #27
0
pulsesequence()
{
/* DECLARE VARIABLES */

 char       autocal[MAXSTR],  /* auto-calibration flag */
            fsat[MAXSTR],
	    fscuba[MAXSTR],
            f1180[MAXSTR],    /* Flag to start t1 @ halfdwell             */
            mess_flg[MAXSTR], /* water purging */
            ar180a[MAXSTR],   /* waveform shape for aromatic 180 pulse 
                                   with C transmitter at dof  */
            cb180b[MAXSTR],   /* waveform shape for aliphatic 180 pulse 
                                   with C transmitter at dofar   */
            ar180b[MAXSTR];   /* waveform shape for aromatic 180 pulse
                                   with C transmitter at dofar   */
 int         phase, ni, 
             t1_counter;   /* used for states tppi in t1           */ 

 double      tau1,         /*  t1 delay */
             taua,         /*  ~ 1/4JCbHb =  1.7 ms */
             taub,         /*  ~ 1/4JCgCd =  2.7 ms */
             tauc,         /*  ~ 1/4JCgCd =  2.1 ms */
             taud,         /*  ~ 1/4JCdHd =  1.5 ms */
             taue,         /*  = 1/4JCbHb =  1.8 ms */
             tauf,         /*  2(tauc-tauf) ~ 1/2JCdHd =  3.1 ms */
             TCb,          /* carbon constant time period 
                              for recording the Cb chemical shifts    */
             dly_pg1,      /* delay for water purging */
             pwar180a,     /* 180 aro pulse at d_ar180a and dof  */
             pwcb180b,     /* 180 cb pulse at d_cb180b and dofar   */ 
             pwC,          /* 90 c pulse at pwClvl            */
             pwsel90,       /* 90 c pulse at d_sel90 */
             pwar180b,     /* 180 c pulse at d_ar180b */
             compC,        /* C-13 RF calibration parameters */
             compH,
             d_ar180a,
             d_cb180b,
             d_sel90,
             d_ar180b,     
             dofar, 
             tsatpwr,      /* low level 1H trans.power for presat  */
             tpwrmess,     /* power level for water purging */
             tpwrml,       /* power level for 1H decoupling */
             pwmlev,       /* 90 pulse at tpwrml */
             pwClvl,        /* power level for high power 13C pulses on dec1 */ 
             sw1,          /* sweep width in f1                    */
             at,
             gp11,         /* gap between 90-90 for selective 180 of Cb */
             fab,          /* chemical shift difference of Ca-Cb (Hz) */
             gt0,
             gt1,
             gt2,
             gt3,
             gt4,
             gt5,
             gt6,
             gt7,
             gstab,
             gzlvl0,
             gzlvl1,
             gzlvl2,
             gzlvl3,
             gzlvl4,
             gzlvl5,
             gzlvl6,
             gzlvl7;


/*  variables commented out are already defined by the system      */


/* LOAD VARIABLES */


  getstr("autocal",autocal);
  getstr("fsat",fsat);
  getstr("f1180",f1180);
  getstr("fscuba",fscuba);
  getstr("mess_flg",mess_flg);

  taua   = getval("taua"); 
  taub   = getval("taub"); 
  tauc   = getval("tauc"); 
  taud   = getval("taud"); 
  taue   = getval("taue"); 
  tauf   = getval("tauf"); 
  TCb = getval("TCb");
  pwC = getval("pwC");
  dofar = getval("dofar");
  dly_pg1 = getval("dly_pg1");
  tpwr = getval("tpwr");
  tsatpwr = getval("tsatpwr");
  tpwrmess = getval("tpwrmess");
  tpwrml = getval("tpwrml");
  pwClvl = getval("pwClvl");
  dpwr = getval("dpwr");
  phase = (int) ( getval("phase") + 0.5);
  sw1 = getval("sw1");
  ni = getval("ni");
  at = getval("at");
  fab = getval("fab");

  if(autocal[0]=='n')
  {     
    getstr("ar180a",ar180a);
    getstr("ar180b",ar180b);
    getstr("cb180b",cb180b);
    pwar180a = getval("pwar180a");
    pwar180b = getval("pwar180b");
    pwcb180b = getval("pwcb180b");
    pwsel90 = getval("pwsel90");
    d_ar180a = getval("d_ar180a");
    d_cb180b = getval("d_cb180b");
    d_ar180b  = getval("d_ar180b");
    d_sel90  = getval("d_sel90");
    pwmlev = getval("pwmlev");
  }
  else
  {    
    strcpy(ar180a,"Pg3_off_cb180a");
    strcpy(ar180b,"Pg3_off_cb180b");    
    strcpy(cb180b,"Pg3_on");
    if (FIRST_FID)
    {
      compC = getval("compC");
      compH = getval("compH");
      sel90 = pbox("cal", SEL90, "", dfrq, compC*pwC, pwClvl);
      ar_180a = pbox(ar180a, AR180a, CB180ps, dfrq, compC*pwC, pwClvl);
      ar_180b = pbox(ar180b, AR180b, CB180ps, dfrq, compC*pwC, pwClvl);
      cb_180b = pbox(cb180b, CB180b, CB180ps, dfrq, compC*pwC, pwClvl);
      w16 = pbox_dec("cal", "WALTZ16", tpwrml, sfrq, compH*pw, tpwr);
    }
    pwsel90 = sel90.pw;      d_sel90 = sel90.pwr;
    pwar180a = ar_180a.pw;   d_ar180a = ar_180a.pwr;
    pwar180b = ar_180b.pw;   d_ar180b = ar_180b.pwr;       
    pwcb180b = cb_180b.pw;   d_cb180b = cb_180b.pwr;  
    pwmlev = 1.0/w16.dmf;
  }   

  gt0 = getval("gt0");
  gt1 = getval("gt1");
  gt2 = getval("gt2");
  gt3 = getval("gt3");
  gt4 = getval("gt4");
  gt5 = getval("gt5");
  gt6 = getval("gt6");
  gstab = getval("gstab");
  gt7 = getval("gt7");

  gzlvl0 = getval("gzlvl0");
  gzlvl1 = getval("gzlvl1");
  gzlvl2 = getval("gzlvl2");
  gzlvl3 = getval("gzlvl3");
  gzlvl4 = getval("gzlvl4");
  gzlvl5 = getval("gzlvl5");
  gzlvl6 = getval("gzlvl6");
  gzlvl7 = getval("gzlvl7");

/* LOAD PHASE TABLE */

  settable(t1,1,phi1);
  settable(t2,1,phi2);
  settable(t3,4,phi3);
  settable(t4,8,phi4);
  settable(t5,1,phi5);
  settable(t6,8,rec);

/* CHECK VALIDITY OF PARAMETER RANGES */

    if( 0.5*ni*1/(sw1) > TCb - 2*POWER_DELAY 
        - WFG_START_DELAY - pwar180a  - WFG_STOP_DELAY)
    {
        printf(" ni is too big\n");
        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' || dm2[C] == 'y' )
    {
        printf("incorrect dec2 decoupler flags!  ");
        psg_abort(1);
    }

    if( tsatpwr > 6 )
    {
        printf("TSATPWR too large !!!  ");
        psg_abort(1);
    }

    if( tpwrml > 53 )
    {
        printf("tpwrml too large !!!  ");
        psg_abort(1);
    }

    if( tpwrmess > 56 )
    {
        printf("tpwrmess too large !!!  ");
        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);
    }

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

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

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

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

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

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

    if(d_ar180a > 60)
    {
        printf("dont fry the probe, d_ar180a too high !");
        psg_abort(1);
    }

    if(d_cb180b > 60)
    {
        printf("dont fry the probe, d_cb180b too high !");
        psg_abort(1);
    }

    if (d_ar180b > 60)
    {
        printf("dont fry the probe, d_ar180b too high ! ");
        psg_abort(1);
    }

    if (d_sel90 > 50)
    {
        printf("dont fry the probe, d_sel90 too high ! ");
        psg_abort(1);
    }

    if( gt0 > 15e-3 || gt1 > 15e-3 || gt2 > 15e-3 || gt3 > 15e-3 
       || gt4 > 15e-3 || gt5 > 15e-3 || gt6 > 15e-3 || gt7 > 15e-3)
    {
        printf("gradients on for too long. Must be < 15e-3 \n");
        psg_abort(1);
    }

    if( fabs(gzlvl0) > 30000 || fabs(gzlvl1) > 30000 || fabs(gzlvl2) > 30000
      ||fabs(gzlvl3) > 30000 || fabs(gzlvl4) > 30000 || fabs(gzlvl5) > 30000
      ||fabs(gzlvl6) > 30000 || fabs(gzlvl7) > 30000)
    {
        printf("too strong gradient");
        psg_abort(1);
    }


    if( 2*TCb - taue > 0.1 )
    {
        printf("dont fry the probe, too long TCb");
        psg_abort(1);
    }

    if( at > 0.1 && (dm[C]=='y' || dm2[C]=='y'))
    {
        printf("dont fry the probe, too long at with decoupling");
        psg_abort(1);
    }

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

    if( dly_pg1 > 10.0e-3)
    {
        printf("dont fry the probe, too long dly_pg1");
        psg_abort(1);
    }

    


/*  Phase incrementation for hypercomplex 2D data */

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

/* 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(t2,2,4);     
      tsadd(t6,2,4);    
    }

/*  Set up f1180  tau1 = t1               */
   
    tau1 = d2;
    if(f1180[A] == 'y') {
        tau1 += ( 1.0 / (2.0*sw1) );
    }
    tau1 = tau1/2.0;

/*  90-90 pulse for selective 180 of Cb but not Ca */

    gp11 = 1/(2*fab) - 4/PI*pwsel90;
    if (gp11 < 0.0) {
        printf("gap of 90-90 negative, check fab and pwsel90");
        psg_abort(1);
    }


/* BEGIN ACTUAL PULSE SEQUENCE */

/* Receiver off time */

status(A);
   decoffset(dof);
   obspower(tsatpwr);      /* Set transmitter power for 1H presaturation */
   decpower(pwClvl);        /* Set Dec1 power for hard 13C pulses         */
   dec2power(dpwr2);      /* Set Dec2 power for 15N decoupling       */

/* Presaturation Period */

   if(mess_flg[A] == 'y') {

     obspower(tpwrmess);
     rgpulse(dly_pg1,zero,20.0e-6,20.0e-6);
     rgpulse(dly_pg1/1.62,one,20.0e-6,20.0e-6);
     obspower(tsatpwr);

  }

   if (fsat[0] == 'y')
   {
	delay(2.0e-5);
        rgpulse(d1,zero,20.0e-6,20.0e-6);
   	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*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 */
   txphase(zero);
   dec2phase(zero);
   decphase(zero);
   delay(1.0e-5);

/* Begin Pulses */

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

/* first ensure that magnetization does infact start on H and not C */

   decrgpulse(pwC,zero,2.0e-6,2.0e-6);

   delay(2.0e-6);
   zgradpulse(gzlvl0,gt0);
   delay(gstab);


/* this is the real start */

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

   delay(2.0e-6);
   zgradpulse(gzlvl1,gt1);
   delay(2.0e-6);

   delay(taua - gt1 - 4.0e-6);   /* taua <= 1/4JCH */                          

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

   txphase(t1);

   delay(2.0e-6);
   zgradpulse(gzlvl1,gt1);
   delay(2.0e-6);

   delay(taua - gt1 - 4.0e-6); 

   rgpulse(pw,t1,0.0,0.0);

   txphase(zero);

   delay(2.0e-6);
   zgradpulse(gzlvl2,gt2);
   delay(gstab);

   decphase(t2);
   decpower(d_sel90);
   decrgpulse(pwsel90,t2,2.0e-6,0.0);

   decphase(zero);
   decpower(d_ar180a);
   decshaped_pulse(ar180a,pwar180a,zero,2.0e-6,0.0);  /* bs effect */

   delay(taue 
     - POWER_DELAY - 2.0e-6 - WFG_START_DELAY - pwar180a - WFG_STOP_DELAY
     - POWER_DELAY - PRG_START_DELAY);

   /* H decoupling on */
   obspower(tpwrml);
   obsprgon("waltz16",pwmlev,90.0);
   xmtron();    /* TURN ME OFF  DONT FORGET  */
   /* Hldecoupling on */
   
   delay(TCb + tau1 - taue - POWER_DELAY - 2.0e-6);

   decphase(t3);

   decpower(d_sel90);
   decrgpulse(pwsel90,t3,2.0e-6,0.0);
   delay(gp11);
   decrgpulse(pwsel90,t3,0.0,0.0);

   decphase(zero);
   decpower(d_ar180a);
   decshaped_pulse(ar180a,pwar180a,zero,2.0e-6,0.0); 

   delay(TCb - tau1
     - POWER_DELAY - WFG_START_DELAY - 2.0e-6 - pwar180a - WFG_STOP_DELAY
     - POWER_DELAY - 2.0e-6);
   
   decphase(zero);
   decpower(d_sel90);
   decrgpulse(pwsel90,zero,2.0e-6,0.0);

   /* H decoupling off */
   xmtroff();
   obsprgoff();
   obspower(tpwr);
   /* H decoupling off */

   decoffset(dofar);

   delay(2.0e-6);
   zgradpulse(gzlvl3,gt3);
   delay(gstab);

   decphase(t4);
   decpower(d_sel90); 
   decrgpulse(pwsel90,t4,2.0e-6,0.0);

   decphase(zero);
   decpower(d_cb180b);
   decshaped_pulse(cb180b,pwcb180b,zero,2.0e-6,0.0);   /* B.S. */

   delay(2.0e-6);
   zgradpulse(gzlvl4,gt4);
   delay(2.0e-6);
   
   delay(taub 
     - POWER_DELAY - WFG_START_DELAY - 2.0e-6 - pwcb180b - WFG_STOP_DELAY
     - gt4 - 4.0e-6
     - POWER_DELAY - WFG_START_DELAY - 2.0e-6);

   decphase(zero);
   decpower(d_ar180b);
   decshaped_pulse(ar180b,pwar180b,zero,2.0e-6,0.0);
 
   decpower(d_cb180b);
   decshaped_pulse(cb180b,pwcb180b,zero,2.0e-6,0.0);
   
   delay(2.0e-6);
   zgradpulse(gzlvl4,gt4);
   delay(2.0e-6);

   delay(taub
     - WFG_STOP_DELAY
     - POWER_DELAY - WFG_START_DELAY - 2.0e-6 - pwcb180b - WFG_STOP_DELAY
     - gt4 - 4.0e-6
     - POWER_DELAY - 2.0e-6);

   decpower(d_sel90);
   decrgpulse(pwsel90,zero,2.0e-6,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl5,gt5);
   delay(100.0e-6);
 
   delay(tauc - POWER_DELAY - gt5 - 102.0e-6 - 2.0e-6);

   decphase(t5);
   decpower(pwClvl);
   decrgpulse(2*pwC,t5,2.0e-6,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl5,gt5);
   delay(100.0e-6);

   txphase(zero);
   delay(tauf - gt5 - 102.0e-6);

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

   delay(tauc - tauf - 2*pw
     - POWER_DELAY - 2.0e-6);

   decphase(zero);
   decpower(d_sel90); 
   decrgpulse(pwsel90,zero,2.0e-6,0.0);

   txphase(zero);
   delay(2.0e-6);
   zgradpulse(gzlvl6,gt6);
   delay(gstab);
   
   rgpulse(pw,zero,0.0,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl7,gt7);
   delay(2.0e-6);

   delay(taud 
     - gt7 - 4.0e-6
     - POWER_DELAY - 2.0e-6);

   decphase(zero);
   decpower(pwClvl);
   simpulse(2*pw,2*pwC,zero,zero,2.0e-6,0.0);

   delay(2.0e-6);
   zgradpulse(gzlvl7,gt7);
   delay(2.0e-6);

   delay(taud 
     - gt7 - 4.0e-6
     - 2*POWER_DELAY);

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

   rgpulse(pw,zero,0.0,0.0);  
    
/*   rcvron();  */          /* Turn on receiver to warm up before acq */ 

/* BEGIN ACQUISITION */

status(C);
setreceiver(t6);

}
Example #28
0
pulsesequence()
{
   char         Cdseq[MAXSTR], refoc[MAXSTR], sspul[MAXSTR];
   int          mult = (0.5 + getval("mult"));
   double	rg1 = 2.0e-6,
                j1xh = getval("j1xh"),
         	gt0 = getval("gt0"),
         	gzlvl0 = getval("gzlvl0"),
         	pp = getval("pp"),
	 	pplvl = getval("pplvl"),
	 	compH = getval("compH"),
		Cdpwr = getval("Cdpwr"),
	 	Cdres = getval("Cdres"), 
	 	tau1 = 0.002,
	 	tau2 = 0.002,
	 	Cdmf = getval("Cdmf");
   
   shape   hdx;

/* Get new variables from parameter table */

   getstr("Cdseq", Cdseq);
   getstr("refoc", refoc);
   getstr("sspul", sspul);
   
   if (j1xh < 1.0) j1xh = 150.0;

   hdx = pboxHT_F1i("gaus180", pp*compH, pplvl); /* HADAMARD stuff */

   if (getval("htcal1") > 0.5)          /* Optional fine power calibration */
     hdx.pwr = getval("htpwr1");

   if(j1xh > 0.0)
     tau1 = 0.25/j1xh;
   tau2 = tau1;
   if (mult > 2) tau2=tau1/2.5;
   else if ((mult == 0) || (mult == 2)) tau2=tau1/2.0;

   dbl(ct, v1);                     /*  v1 = 02 */
   add(two,v1,oph);
   mod4(oph,oph);                   /* oph = 02 */


/* Calculate delays */

   if (dm[0] == 'y')
   {
     abort_message("decoupler must be set as dm=nny\n");
   }
   if(refoc[A]=='n' && dm[C]=='y')
   {
     abort_message("with refoc=n decoupler must be set as dm=nnn\n");
   }
 
/* Relaxation delay */

   status(A);

   delay(0.05);
   zgradpulse(gzlvl0,gt0);
   if (sspul[0] == 'y')
   {
     obspower(tpwr); decpower(pplvl);
     simpulse(pw, pp, zero, zero, rg1, rg1);  /* destroy H and C magnetization */
     zgradpulse(gzlvl0,gt0);
   }

   delay(d1);
 
   status(B);

     obspower(Cdpwr);
     obsunblank(); xmtron(); 
     obsprgon(Cdseq, 1.0/Cdmf, Cdres);  

     pbox_decpulse(&hdx, zero, rg1, rg1);

     obsprgoff(); xmtroff(); obsblank();  
     obspower(tpwr); decpower(pplvl);
          
     delay(2.0e-4);		
     
     decrgpulse(pp, v1, rg1, rg1);
     
     delay(tau1 - POWER_DELAY);
     simpulse(2.0*pw, 2.0*pp, zero, zero, rg1, rg1);
     txphase(one); decphase(one); 
     delay(tau1);
     simpulse(pw, pp, one, one, rg1, rg1);
     if(refoc[A]=='y')
     {
       txphase(zero); decphase(zero); 
       delay(tau2);
       simpulse(2.0*pw, 2.0*pp, zero, zero, rg1, rg1);
       delay(tau2 - rof2 - POWER_DELAY);
       decrgpulse(pp, zero, rg1, rof2);
     }
     decpower(dpwr);    

   status(C);
}
Example #29
0
pulsesequence()

{
   double   hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            tau,
            evolcorr,
	    taug,
	    mult = getval("mult"),
	    null = getval("null");
   int	    phase1 = (int)(getval("phase")+0.5),
            prgcycle = (int)(getval("prgcycle")+0.5),
	    ZZgsign;

   tau  = 1/(4*(getval("j1xh")));
   if (mult > 0.5)
    taug = 2*tau;
   else
    taug = 0.0;
   evolcorr=2*pw+4.0e-6;
   ZZgsign=-1;
   if (mult == 2) ZZgsign=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,2,ph2);
   settable(t3,8,ph3);
   settable(t4,16,ph4);
   settable(t5,16,ph5);

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

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

   if (phase1 == 2)
     incr(v2);

   add(v2,v14,v2);
   add(oph,v14,oph);

   if (mult > 0.5) 
	add(oph,two,oph);

   status(A);
   obspower(tpwr);

   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);

   decpower(pwxlvl);

    status(B);

    if ((getflag("PFGflg")) && (getflag("nullflg")))
     {
        rgpulse(0.5*pw,zero,rof1,rof1);
        delay(2*tau);
        simpulse(2.0*pw,2.0*pwx,zero,zero,rof1,rof1);
        delay(2*tau);
        rgpulse(1.5*pw,two,rof1,rof1);
        zgradpulse(hsglvl,hsgt);
        delay(1e-3);
     } 
     else if (null != 0.0)
     {
        rgpulse(pw,zero,rof1,rof1);
        delay(2*tau);
        simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
        delay(2*tau);
        rgpulse(pw,two,rof1,rof1);
        if (satmode[1] == 'y')
	{
           if (getflag("slpsat"))
                shaped_satpulse("BIRDnull",null,zero);
           else
                satpulse(null,zero,rof1,rof1);
	}
	else
           delay(null);
      }

     rgpulse(pw,v6,rof1,rof1);
     delay(tau);
     simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
     delay(tau);
     rgpulse(pw,v1,rof1,rof1);
     if (getflag("PFGflg"))
     {
	zgradpulse(hsglvl,2*hsgt);
	delay(1e-3);
     }
     decrgpulse(pwx,v2,rof1,2.0e-6);

     if (mult > 0.5)
     {
	delay(d2/2);
	rgpulse(2*pw,zero,2.0e-6,2.0e-6);
	delay(d2/2);
     delay(taug);
     simpulse(mult*pw,2*pwx,zero,zero,rof1,rof1);
     delay(taug + evolcorr);
     }
     else
     {
     if (d2/2 > 0.0)
      delay(d2/2 - (2*pwx/PI) - pw - 4.0e-6);
     else
      delay(d2/2);
     rgpulse(2*pw,zero,2.0e-6,2.0e-6);
     if (d2/2 > 0.0)
      delay(d2/2 - (2*pwx/PI) - pw - 4.0e-6);
     else
      delay(d2/2);
     }

     decrgpulse(pwx,v4,2.0e-6,rof1);
     if (getflag("PFGflg"))
     {
	zgradpulse(ZZgsign*0.6*hsglvl,1.2*hsgt);
	delay(1e-3);
     }
     rgpulse(pw,v3,rof1,rof1);
     delay(tau - (2*pw/PI) - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof2);
     decpower(dpwr);
     delay(tau - POWER_DELAY);
   status(C);
}
Example #30
0
pulsesequence()

{
    char	normal[MAXSTR],
            focus[MAXSTR];
    double	spp, spplvl, pp, mult, j, d3;
    double  gt, gzlvl;

    /* GATHER AND INTIALIZE */
    getstr("focus", focus);
    getstr("normal", normal);
    spp = getval("spp");
    spplvl = getval("spplvl");
    pp   = getval("pp");
    mult = getval("mult");
    j    = getval("j");
    gt = getval("gt");
    gzlvl = getval("gzlvl");

    /* calculate phases */
    mod2(ct,v1);  /* v1 = 01010101 */
    dbl(v1,v1);  /* v1 = 0 2 */
    hlv(ct,v2);
    mod2(v2,v2);  /* v2 = 0 0 1 1 */
    add(v1,v2,oph);  /* oph = 0 2 1 3 */

    /* if mult is zero, then do normal s2pul sequence */
    if (mult == 0.0)
    {
        status(A);
        hsdelay(d1);
        pulse(p1, zero);
        status(B);
        delay(d2);
        status(C);
        pulse(pw,oph);
    }

    else  /* this is the INEPT part of the sequence  */
    {
        if (j != 0.0)
        {   /* calculation of delays */
            d3 = 1.0 / (2.0 * j);
            if (mult < 2.5)
            {
                d2 = 1.0 / (2.0 * j);
            }
            else if (mult < 3.5)
            {
                d2 = 3.0 / (4.0 * j);
            }
            else
            {
                d2 = 1.0 / (3.0 * j);
            }
        }
        else
            d3 = getval("d3");


        /* do equilibration delay */
        if ((dm[A] == 'y') || (dm[B] == 'y'))
        {
            (void) printf("Decoupler must be set as dm=nny or n\n");
            psg_abort(1);
        }
        if (declvlonoff)
            declvlon();		/* use pplvl for pulse */
        else
            decpower(pplvl);
        dec_pw_ovr(FALSE);

        status(A);
        delay(d1);

        /* excitation transfer */
        status(B);
        decrgpulse(pp, v1, rof1, rof1);
        decpower(spplvl);
        dec_pw_ovr(TRUE);
        delay(d3/2 - 2.0*(gt + spp + 1.0e-4));
        /*nominal 1/(4j) corrected for H1 & gradient pulses */
        zgradpulse(gzlvl,gt);
        delay(1.0e-4);
        simpulse(2*pw, 2*spp, zero, zero, rof1, rof1);
        delay(1.0e-4);
        zgradpulse(gzlvl,2.0*gt);
        delay(1.0e-4);
        simpulse(2.0*pw, 2.0*spp, zero, two, rof1, rof1);
        zgradpulse(gzlvl,gt);
        delay(1.0e-4);
        decpower(pplvl);
        dec_pw_ovr(FALSE);
        delay(d3/2 - 2.0*(gt + spp + 1.0e-4));
        simpulse(pw, pp, v2, one, 0.0, 0.0);

        /* make decision on refocussing */
        if ((focus[A] == 'y') || (dm[C] == 'y'))
        {
            decpower(spplvl);
            dec_pw_ovr(TRUE);
            delay(d2/2 - rof1 -spp);	/* refocussing delay varied for 2d */
            simpulse(2*pw, 2*spp, v2, zero, rof1, rof1);
            delay(d2/2 - rof1 - spp);
        }
        else if (normal[A] == 'y')
        {
            decrgpulse(pp, v1, 1.0e-6, 0.0);
        }

        if (declvlonoff)
            declvloff();
        else
            decpower(dpwr);
        status(C);
    }
}