Exemplo n.º 1
0
void pulsesequence()
{
   char   
          shname1[MAXSTR],
	  f1180[MAXSTR],
	  f2180[MAXSTR],
          n15_flg[MAXSTR];


   int    icosel,
          t1_counter,
          t2_counter,
          ni2 = getval("ni2"),
          phase;


   double d2_init=0.0,
          d3_init=0.0,
          pwS1,pwS2,pwS3,pwS4,pwS5,pwS6,
          kappa,
          lambda = getval("lambda"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl3 = getval("gzlvl3"), 
          gzlvl4 = getval("gzlvl4"), 
          gzlvl5 = getval("gzlvl5"), 
          gzlvl6 = getval("gzlvl6"), 
          gt1 = getval("gt1"),
          gt3 = getval("gt3"),
          gt4 = getval("gt4"),
          gt5 = getval("gt5"),
          gt6 = getval("gt6"),
          gstab = getval("gstab"),
          scale = getval("scale"),
          sw1 = getval("sw1"),
          tpwrsf = getval("tpwrsf"),
          shlvl1,
          shpw1 = getval("shpw1"),
          pwClvl = getval("pwClvl"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          dpwr2 = getval("dpwr2"),
          d2 = getval("d2"),
          t2a,t2b,halfT2,
          shbw = getval("shbw"),
          shofs = getval("shofs")-4.77,
          timeTN = getval("timeTN"),
          tau1 = getval("tau1"),
          tau2 = getval("tau2"),
          taunh = getval("taunh");



   getstr("shname1", shname1);
   getstr("n15_flg",n15_flg);



  phase = (int) (getval("phase") + 0.5);
   
   settable(t1,4,phi1);
   settable(t2,4,phi2);
   settable(t3,1,phi3);
   settable(t5,1,phi5);
   settable(t14,4,phi14);
   settable(t15,4,phi15);
   settable(t24,4,phi24);
   settable(t25,4,phi25);


/*   INITIALIZE VARIABLES   */
   kappa = 5.4e-3;
   //shpw1 = pw*8.0;
   shlvl1 = tpwr;
   f1180[0] ='n'; 
   f2180[0] ='n'; 

   pwS1 = c13pulsepw("co", "ca", "sinc", 90.0);
   pwS2 = c13pulsepw("co", "ca", "sinc", 180.0);
   pwS3 = c13pulsepw("ca", "co", "square", 180.0);
   pwS4 = h_shapedpw("eburp2",shbw,shofs,zero, 0.0, 0.0);
   pwS6 = h_shapedpw("reburp",shbw,shofs,zero, 0.0, 0.0);
   pwS5 = h_shapedpw("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);
   if(ix==1) printf("pwS2 %g   pwS3 %g GRADIENT_DELAY %g POWER_DELAY %g PWRF_DELAY %g\n",
   pwS2,pwS3,2*GRADIENT_DELAY,4*POWER_DELAY,4*PWRF_DELAY);



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

if   ( phase2 == 2 )
        {
        tsadd ( t3,2,4  );
        tsadd ( t5,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;


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

/************************************************************/
/* modification for phase-cycling in consecutive experiments*/
/*  for kinetic measurements                                */
/************************************************************/

   if( ix == 1) d2_init = d2;
   t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 );
   if(t1_counter % 2)
        { tsadd(t1,2,4); tsadd(t14,2,4); tsadd(t15,2,4);tsadd(t24,2,4); tsadd(t25,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(t14,2,4); tsadd(t15,2,4);tsadd(t24,2,4); tsadd(t25,2,4);  }


/* Set up CONSTANT/SEMI-CONSTANT time evolution in N15 */

   if (ni2 > 1)
   {
   halfT2 = 0.5*(ni2-1)/sw2;
   t2b = (double) t2_counter*((halfT2 - timeTN)/((double)(ni2-1)));
   if( ix==1 && halfT2 - timeTN > 0 ) printf("SCT mode on, max ni2=%g\n",timeTN*sw2*2+1);
    if(t2b < 0.0) t2b = 0.0;
   
    t2a = timeTN - tau2*0.5 + t2b;
    if(t2a < 0.2e-6)  t2a = 0.0;
    }
    else
    {
    t2b = 0.0;
    t2a = timeTN - tau2*0.5;
    }



   status(A);
      rcvroff();  

   decpower(pwClvl);
   decoffset(dof);
   dec2power(pwNlvl);
   dec2offset(dof2);
   obspwrf(tpwrsf);
   decpwrf(4095.0);
   obsoffset(tof);
   set_c13offset("co");


      dec2rgpulse(pwN*2.0,zero,0.0,0.0);
     zgradpulse(1.5*gzlvl4, gt4);
       delay(1.0e-4);

lk_sample();
       delay(d1-gt4);
lk_hold();
        h_shapedpulse("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);

        delay(lambda-pwS5*0.5-pwS6*0.5);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);

        delay(lambda-pwS5*0.5-pwS6*0.5);

   if(n15_flg[0]=='y') h_shapedpulse("pc9f_",shbw,shofs,three, 0.0, 0.0);
     else h_shapedpulse("pc9f_",shbw,shofs,one, 0.0, 0.0);


   obspower(shlvl1);
/**************************************************************************/
      dec2rgpulse(pwN,zero,0.0,0.0);

           zgradpulse(gzlvl4, gt4);
           delay(timeTN-pwS2*0.5-gt4);

      sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);

           zgradpulse(gzlvl4, gt4);
           delay(timeTN-pwS2*0.5-gt4);
     dec2rgpulse(pwN,one,0.0,0.0);
/**************************************************************************/
/*   xxxxxxxxxxxxxxxxxxxxxx       13CO EVOLUTION        xxxxxxxxxxxxxxxxxx    */
   
        obspower(tpwr);
	c13pulse("co", "ca", "sinc", 90.0, t1, 2.0e-6, 0.0);       
        delay(tau1*0.5);
        sim3_c13pulse("", "ca", "co", "square", "", 0.0, 180.0, 2.0*pwN,
                                                  zero, zero, zero, 2.0e-6, 0.0);
        delay(tau1*0.5);
	c13pulse("co", "ca", "sinc", 180.0, zero, 2.0e-6, 0.0);      
        sim3_c13pulse("", "ca", "co", "square", "", 0.0, 180.0, 0.0,
                                                  one, zero, zero, 2.0e-6, 0.0);
        if  (pwN*2.0 > pwS3) delay(pwN*2.0-pwS3);
	c13pulse("co", "ca", "sinc", 90.0, zero, 2.0e-6, 0.0);       

/**************************************************************************/
     dec2rgpulse(pwN,t2,0.0,0.0);

         delay(tau2*0.5);
         c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);
         // delay(timeTN-pwS3-pwS2-gt1-1.0e-4);
         delay(timeTN-pwS3-pwS2-gt1-1.0e-4-2.0*GRADIENT_DELAY-4*POWER_DELAY-4*PWRF_DELAY-(4/PI)*pwN);
       zgradpulse(-gzlvl1, gt1); 
       delay(1.0e-4);
        c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);
        delay (t2b);
        dec2rgpulse (2.0*pwN, zero, 0.0, 0.0);
        delay (t2a);

/**************************************************************************/
        delay(gt1/10.0+1.0e-4);
        h_shapedpulse("eburp2_",shbw,shofs,t3, 2.0e-6, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.5-pwS4*scale- gt5);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.5-pwS4*scale- gt5);

        h_shapedpulse("eburp2",shbw,shofs,zero, 0.0, 0.0);
        delay(gt1/10.0+1.0e-4);

     dec2rgpulse(pwN,one,0.0,0.0);
        zgradpulse(gzlvl6, gt6);

        txphase(zero);
        delay(lambda-pwS6*0.5-gt6);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);
        zgradpulse(gzlvl6, gt6);

        delay(lambda-pwS6*0.5-gt6);
     dec2rgpulse(pwN,t5,0.0,0.0);
/**************************************************************************/

        zgradpulse(-icosel*gzlvl2, gt1/10.0);
        dec2power(dpwr2);                                      /* POWER_DELAY */
lk_sample();
 if (n15_flg[0] =='y')
{
   if (phase2==1) setreceiver(t14);
   else setreceiver(t15);
}
else
{
   if (phase2==1) setreceiver(t24);
   else setreceiver(t25);
}

      rcvron();
statusdelay(C,1.0e-4 );

}		 
Exemplo n.º 2
0
void pulsesequence()
{
   char   
          shname1[MAXSTR],
	  f1180[MAXSTR],
	  f2180[MAXSTR],
          CT_flg[MAXSTR],
          n15_flg[MAXSTR];

   int    icosel,
          t1_counter,
          t2_counter,
          ni2 = getval("ni2"),
          phase;


   double d2_init=0.0,
          d3_init=0.0,
          pwS1,pwS2,pwS3,pwS4,pwS5,pwS6,pwS7,max,
          kappa,
          lambda = getval("lambda"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl3 = getval("gzlvl3"), 
          gzlvl4 = getval("gzlvl4"), 
          gzlvl5 = getval("gzlvl5"), 
          gzlvl6 = getval("gzlvl6"), 
          gt1 = getval("gt1"),
          gt3 = getval("gt3"),
          gt4 = getval("gt4"),
          gt5 = getval("gt5"),
          gt6 = getval("gt6"),
          gstab = getval("gstab"),
          tpwrsf = getval("tpwrsf"),
          shlvl1,
          shpw1 = getval("shpw1"),
          pwClvl = getval("pwClvl"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          dpwr2 = getval("dpwr2"),
          d2 = getval("d2"),
          shbw = getval("shbw"),
          shofs = getval("shofs")-4.77,
          scale = getval("scale"),
          sw1 = getval("sw1"),
          timeTN = getval("timeTN"),
          timeTN1,
          Delta,
          t2a,t2b,halfT2,ctdelay,
          tauNCO = getval("tauNCO"),
          CTdelay = getval("CTdelay"),
          tauC = getval("tauC"),
          tau1, tau2,
          taunh = getval("taunh");



   getstr("shname1", shname1);
   getstr("CT_flg",CT_flg);
   getstr("n15_flg",n15_flg);
   getstr("f1180",f1180);
   getstr("f2180",f2180);



  phase = (int) (getval("phase") + 0.5);
   
   settable(t1,2,phi1);
   settable(t3,1,phi3);
   settable(t4,4,phi4);
   settable(t5,1,phi5);
   settable(t14,4,phi14);
   settable(t24,4,phi24);


/*   INITIALIZE VARIABLES   */

  timeTN1= timeTN-tauC;
  Delta = timeTN-tauC-tauNCO;

  //shpw1 = pw*8.0;
  shlvl1=tpwr;

   pwS1 = c13pulsepw("ca", "co", "square", 90.0);
   pwS2 = c13pulsepw("ca", "co", "square", 180.0);
   pwS3 = c13pulsepw("co", "ca", "sinc", 180.0);
   pwS7 = c13pulsepw("co", "ca", "sinc", 90.0);
   pwS4 = h_shapedpw("eburp2",shbw,shofs,zero, 0.0, 0.0);  
   pwS6 = h_shapedpw("reburp",shbw,shofs,zero, 0.0, 0.0);
   pwS5 = h_shapedpw("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);



if (CT_flg[0] == 'y')
{
   if ( ni*1/(sw1)/2.0 > (CTdelay*0.5-gt3-1.0e-4))
       { printf(" ni is too big. Make ni equal to %d or less.\n",
         ((int)((CTdelay*0.5-gt3-1.0e-4)*2.0*sw1)));    psg_abort(1);}
}

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

if   ( phase2 == 2 )
        {
        tsadd ( t3,2,4  );
        tsadd ( t5,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; }
   
   
/*  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; }

/************************************************************/

   if( ix == 1) d2_init = d2;
   t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 );
   if(t1_counter % 2)
        { tsadd(t1,2,4); tsadd(t14,2,4); tsadd(t24,2,4); }
   
  if( ix == 1) d3_init = d3;
   t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );
   if(t2_counter % 2)
        { tsadd(t4,2,4); tsadd(t14,2,4); tsadd(t24,2,4);  }
   
/************************************************************/
/* Set up CONSTANT/SEMI-CONSTANT time evolution in N15 */
/************************************************************/

   ctdelay = timeTN1-gt1-1.0e-4;
   // ctdelay = timeTN1-gt1-1.0e-4-2.0*GRADIENT_DELAY-4*POWER_DELAY-4*PWRF_DELAY-(4/PI)*pwN;
   if (ni2 > 1)
   {
   halfT2 = 0.5*(ni2-1)/sw2;
   t2b = (double) t2_counter*((halfT2 - ctdelay)/((double)(ni2-1)));
   if( ix==1 && halfT2 - timeTN > 0 ) printf("SCT mode on, max ni2=%g\n",timeTN*sw2*2+1);
    if(t2b < 0.0) t2b = 0.0;
   
    t2a = ctdelay - tau2*0.5 + t2b;
    if(t2a < 0.2e-6)  t2a = 0.0;
    }
    else
    {
    t2b = 0.0;
    t2a = ctdelay - tau2*0.5;
    }
/************************************************************/

   status(A);
      rcvroff();  

   decpower(pwClvl);
   decoffset(dof);
   dec2power(pwNlvl);
   dec2offset(dof2);
   obspwrf(tpwrsf);
   decpwrf(4095.0);
   obsoffset(tof);
   set_c13offset("co");


      dec2rgpulse(pwN*2.0,zero,0.0,0.0);
     zgradpulse(gzlvl4, gt4);
       delay(1.0e-4);

       delay(d1-gt4);
lk_hold();

        h_shapedpulse("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);  

	delay(lambda-pwS5*0.5-pwS6*0.4); 

   	h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);

	delay(lambda-pwS5*0.5-pwS6*0.4);

     if(n15_flg[0]=='y') h_shapedpulse("pc9f_",shbw,shofs,three, 0.0, 0.0);
     else h_shapedpulse("pc9f_",shbw,shofs,one, 0.0, 0.0);

           zgradpulse(gzlvl4, gt4*4.0);
           delay(1.0e-4);

   obspower(shlvl1);
/**************************************************************************/
/*   xxxxxxxxxxxxxxxxxxxxxx   N-> CA transfer           xxxxxxxxxxxxxxxxxx    */
/**************************************************************************/
      dec2rgpulse(pwN,zero,0.0,0.0);

           delay(timeTN1);

      sim3_c13pulse("", "ca", "co", "square", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);

           delay(Delta);
	c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);      
           delay(timeTN1-Delta-pwS3+pwN*4.0/3.0);

	c13pulse("co", "ca", "sinc", 90.0, zero, 0.0, 0.0);      
           delay(tauC);
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
           delay(tauC);
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
	c13pulse("co", "ca", "sinc", 90.0, one, 0.0, 0.0);      
        

     dec2rgpulse(pwN,one,0.0,0.0);				     
/**************************************************************************/
/*   xxxxxxxxxxxxxxxxxxxxxx       13CA EVOLUTION        xxxxxxxxxxxxxxxxxx    */
/**************************************************************************/
        set_c13offset("ca");

        c13pulse("ca", "co", "square", 90.0, t1, 2.0e-6, 0.0);
   if(CT_flg[0]=='y')
   {
        delay(tau1*0.5);
         sim3_c13pulse(shname1, "co", "ca", "sinc", "", shpw1, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        zgradpulse(gzlvl3, gt3);
        delay(1.0e-4);
        delay(CTdelay*0.5-gt3-1.0e-4);
        c13pulse("cab", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
        delay(CTdelay*0.5-gt3-1.0e-4-tau1*0.5);
         sim3_c13pulse(shname1, "co", "ca", "sinc", "", shpw1, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        zgradpulse(gzlvl3, gt3);
        delay(1.0e-4);
   }
   else
   {
        delay(tau1*0.5);
        sim3_c13pulse(shname1, "co", "ca", "sinc", "", shpw1, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        zgradpulse(gzlvl3, gt3);
        delay(1.0e-4);
        delay(tau1*0.5);

        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
        sim3_c13pulse(shname1, "co", "ca", "sinc", "", shpw1, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        zgradpulse(gzlvl3, gt3);
        delay(1.0e-4);
   }
        c13pulse("ca", "co", "square", 90.0, zero, 0.0, 0.0);

        set_c13offset("co");

/**************************************************************************/
/*   xxxxxxxxxxxxxxxxxxxxxx   N-> CA back transfer     xxxxxxxxxxxxxxx    */
/**************************************************************************/
   obspower(shlvl1);

     dec2rgpulse(pwN,t4,0.0,0.0);

	c13pulse("co", "ca", "sinc", 90.0, one, 0.0, 0.0);      
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
           delay(tauC);
        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
           delay(tauC);
	c13pulse("co", "ca", "sinc", 90.0, zero, 0.0, 0.0);      

 	 // delay(timeTN1-Delta+tau2*0.5-pwS2-pwS3);
 	 delay(timeTN1-Delta+tau2*0.5-pwS2-pwS3-2.0*GRADIENT_DELAY+4*POWER_DELAY+4*PWRF_DELAY);
	c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);      
           delay(Delta);
	c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);      
           delay (t2b);
        dec2rgpulse (2.0*pwN, zero, 0.0, 0.0);
       zgradpulse(gzlvl1, gt1);
           delay(1.0e-4);
           delay (t2a);

/**************************************************************************/
/**  gradient-selected TROSY sequence                             *********/
/**************************************************************************/
        delay(gt1/10.0+1.0e-4);
        h_shapedpulse("eburp2_",shbw,shofs,t3, 2.0e-6, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.5-pwS4*scale- gt5);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.5-pwS4*scale- gt5);

        h_shapedpulse("eburp2",shbw,shofs,zero, 0.0, 0.0);
        delay(gt1/10.0+1.0e-4);

        dec2rgpulse(pwN,one,0.0,0.0);

        zgradpulse(gzlvl6, gt6);

        txphase(zero);
        delay(lambda-pwS6*0.5-gt6);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);
        zgradpulse(gzlvl6, gt6);

        delay(lambda-pwS6*0.5-gt6);

        dec2rgpulse(pwN,t5,0.0,0.0);
/**************************************************************************/

        zgradpulse(-icosel*gzlvl2, gt1/10.0);

	dec2power(dpwr2);
lk_sample();
 if (n15_flg[0] =='y')
{
   setreceiver(t14);
}
else
{
   setreceiver(t24);
}
      rcvron();  
statusdelay(C,1.0e-4 );

}		 
Exemplo n.º 3
0
pulsesequence()
{
   char   
          autocal[MAXSTR],
          shname1[MAXSTR],
	  shname2[MAXSTR],
          ipap_flg[MAXSTR],
          ab_flg[MAXSTR],
	  f1180[MAXSTR],
          SE[MAXSTR],        /*Use Sensitivity Enhancement */
          c13refoc[MAXSTR],
          refpat[MAXSTR],    /* pulse shape pattern refocus. pulse*/
          hetsofast_flg[MAXSTR],
          grad3_flg[MAXSTR];     /*gradient flag */

   int   
          t1_counter,
          phase;


   double d2_init=0.0,
          pwS,pwS1,pwS2, 
          tpwrsf = getval("tpwrsf"),
   	  adjust = getval("adjust"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl3 = getval("gzlvl3"), 
          gstab = getval("gstab"),
          gt1 = getval("gt1"),
          gt2 = getval("gt2"),
          gt3 = getval("gt3"),
          shlvl1 = getval("shlvl1"),
          shlvl2 = getval("shlvl2"),
          shdmf2 = getval("shdmf2"),
          shbw = getval("shbw"),
          shpw1 = getval("shpw1"),
          shpw2 = getval("shpw2"),
          shpw3 = 0.0,

          shofs = getval("shofs"),
          flipangle = getval("flipangle"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          dpwr2 = getval("dpwr2"),
          d2 = getval("d2"),
          tau1,
          taunh = 1.0/(2.0*getval("JNH"));

void compo_pulse();
void compo1_pulse();
void makeshape_pc9();
void makeshape_refoc();
void makeshape_ndec();

   getstr("autocal",autocal);
   getstr("f1180",f1180);
   getstr("c13refoc",c13refoc);
   getstr("hetsofast_flg",hetsofast_flg);
   getstr("refpat", refpat); /* pulse pattern refocussing pulse */
   getstr("ipap_flg",ipap_flg);
   getstr("grad3_flg",grad3_flg);
   getstr("ab_flg",ab_flg);
   getstr("SE",SE);
   getstr("shname1",shname1);
   getstr("shname2",shname2);

 pwS = c_shapedpw("sech",200.0,0.0,zero, 0.0, 0.0);
 pwS1 = hn_simshapedpw(refpat,shbw,shofs-4.8,"isnob3",50.0,0.0, zero, zero, 0.0, 0.0);
 pwS2 = h_shapedpw(refpat,shbw,3.5,zero, 0.0, 0.0);



 if (hetsofast_flg[0] == 'a')
   shpw3 = h_shapedpw("isnob5",4.0,-3.0,two, 2.0e-6, 2.0e-6);
 if (hetsofast_flg[0] == 'b')
   shpw3 = h_shapedpw("gaus180",0.015,0.0,two, 2.0e-6, 2.0e-6);

  phase = (int) (getval("phase") + 0.5);
   
   settable(t1,2,phi1);
   settable(t2,2,phi2);

if (autocal[0] == 'y')
{
(void) makeshape_pc9(flipangle, shbw, shofs);  /*create pc9 pulse*/
   sh90 = getRsh("hn_pc9");
   shpw1 = sh90.pw;
   shlvl1 = sh90.pwr;
     sprintf(shname1,"hn_pc9");


(void) makeshape_refoc(refpat, shbw, shofs);  /* create refocussing pulse */
   shref = getDsh("hn_refoc");
   shpw2 = shref.pw;
   shlvl2 = shref.pwr;
   shdmf2 = shref.dmf;
   sprintf(shname2,"hn_refoc");

  if (dmm2[2] == 'p')  /* waveform capability present on channel 3 */
 {
  (void) makeshape_ndec();  /* create n15 wurst decoupling */
   shdec = getDsh("hncompdec");
   dpwr2 = shdec.pwr;
   dmf2 = shdec.dmf;
   dres2 = shdec.dres;
   sprintf(dseq2,"hncompdec");
 }

}

   if  (tpwrsf <4095.0) shlvl2 = shlvl2+6.0;

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

    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;
  
    if (f1180[0] == 'y')  tau1 = tau1-pwN*4.0/3.0;

    


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



   status(A);

   decoffset(dof);
   dec2power(pwNlvl);
   dec2offset(dof2);
   obsoffset(tof);
   obspower(tpwr);


/**********************************************/
 if (hetsofast_flg[0] != 'n')
 {
     if (hetsofast_flg[0] == 'a')
     h_shapedpulse("isnob5",4.0,-3.0,two, 2.0e-6, 2.0e-6);
     if (hetsofast_flg[0] == 'b')
     h_shapedpulse("gaus180",0.015,0.0,two, 2.0e-6, 2.0e-6);
     zgradpulse(gzlvl2, gt2);
     delay(gstab);
     delay(d1-gt2-shpw3);
     lk_hold();
 }
 else
 {
     zgradpulse(gzlvl2, gt2);
     delay(gstab);
     delay(d1-gt2);
     lk_hold();
 }
   obspower(shlvl1);
   shaped_pulse(shname1,shpw1,zero,2.0e-4,2.0e-6);

if (SE[0] == 'y')
 {

  if (ipap_flg[0] == 'y')
  {
    if ((tau1+pwN*2.0) < pwS2) delay((pwS2*0.5-tau1*0.5-pwN)*0.5);
    if (grad3_flg[0]== 'y')
     delay(taunh*0.5-shpw1*0.533-pwS1*0.5+(gt3*2.0+2.0*gstab+pwN*3.0));
    else
     delay(taunh*0.5-shpw1*0.533-pwS1*0.5+pwN);

    hn_simshapedpulse(refpat,shbw,shofs-4.8,"bip720_50_20",40.0,0.0, zero, zero, 0.0, 0.0);
    obspower(shlvl2);
    obspwrf(4095.0);
    compo1_pulse(shname2,shpw2,pwN,shdmf2,t1,tau1,c13refoc,pwS,taunh,pwS1,pwS2,gt1,gt3,gzlvl3,grad3_flg,gstab);
    obspower(shlvl2);
    obspwrf(4095.0);
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    h_sim3shapedpulse(refpat,shbw,shofs-4.8,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    delay(taunh*0.5-gt1-gstab-POWER_DELAY-pwS1*0.5);
    if ((tau1+pwN*2.0) < pwS2) delay((pwS2*0.5-tau1*0.5-pwN)*0.5);
    if (ab_flg[0] == 'a')
      dec2rgpulse(pwN,one,0.0,0.0);
    else
      dec2rgpulse(pwN,three,0.0,0.0);
    if (grad3_flg[0]== 'y')
     {
      delay(gt3+gstab);
      dec2rgpulse(pwN*2.0,zero,0.0,0.0);
      zgradpulse(gzlvl3,gt3);
      delay(gstab);
     }
  }
  else
  {
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    if ((tau1+pwN*2.0) < pwS2) 
     delay(taunh-gt1-gstab-shpw1*0.533-adjust-(pwS2*0.5-tau1*0.5-pwN)*0.5);
    else
     delay(taunh-gt1-gstab-shpw1*0.533-adjust);
    obspower(shlvl2);
    obspwrf(tpwrsf);
    compo_pulse(shname2,shpw2,pwN,shdmf2,t1,tau1,c13refoc,pwS);
    obspower(shlvl1);
    obspwrf(4095.0);
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    if ((tau1+pwN*2.0) < pwS2) 
     delay(taunh-gt1-gstab-POWER_DELAY-(pwS2*0.5-tau1*0.5-pwN)*0.5);
    else
     delay(taunh-gt1-gstab-POWER_DELAY);
  }
 }
else
 {
  if ((ni == 0) || (ni == 1))
   {
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    delay(taunh-gt1-gstab-WFG_START_DELAY+pwN*4.0-shpw1*0.533-adjust);
    obspwrf(tpwrsf);
    obspower(shlvl2);

    xmtrphase(zero);
    xmtron();
    obsunblank();
    obsprgon(shname2,1/shdmf2,9.0);
    delay(shpw2);
    obsprgoff();
    obsblank();
    xmtroff();

    obspower(shlvl2);
    obspwrf(4095.0);
    dec2rgpulse(pwN,t1,0.0,0.0);
    dec2rgpulse(pwN*2.0,zero,0.0,0.0);
    dec2rgpulse(pwN,zero,0.0,0.0);
   }
  else
   {
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    delay(taunh-gt1-gstab-shpw1*0.533-adjust);
    obspower(shlvl2);
    obspwrf(tpwrsf);
    compo_pulse(shname2,shpw2,pwN,shdmf2,t1,tau1,c13refoc,pwS);
    obspower(shlvl1);
    obspwrf(4095.0);
   }

  if (ipap_flg[0] == 'y')
   {
   if (ab_flg[0] == 'b')
     {
     zgradpulse(gzlvl1, gt1);
     delay(gstab);
     delay(taunh-gt1-gstab-pwN-POWER_DELAY);
     dec2rgpulse(pwN,one,0.0,0.0);
     }
   else
     {
     zgradpulse(gzlvl1, gt1);
     delay(gstab);
     delay(taunh*0.5-gt1-pwN-gstab);
     dec2rgpulse(pwN*2.0,zero,0.0,0.0);
     delay(taunh*0.5-pwN-POWER_DELAY);
     }
   }
  else
   {
   zgradpulse(gzlvl1, gt1);
   delay(gstab);
   delay(taunh-gt1-gstab-POWER_DELAY);
   }
 }
 dec2power(dpwr2);
 lk_sample(); 
 setreceiver(t2);
 status(C);


}
Exemplo n.º 4
0
pulsesequence()
{
   char   
          shname1[MAXSTR],
	  f1180[MAXSTR],
	  f2180[MAXSTR],
          SE_flg[MAXSTR],
          dec_flg[MAXSTR],
          CT_flg[MAXSTR];

   int    icosel=1,
          t1_counter,
          t2_counter,
          ni2 = getval("ni2"),
          phase;


   double d2_init=0.0,
          d3_init=0.0,
          pwS1,pwS2,pwS3,pwS4,pwS5,pwS6,
          lambda = getval("lambda"),
          CTdelay =  getval("CTdelay"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl3 = getval("gzlvl3"), 
          gzlvl4 = getval("gzlvl4"), 
          gzlvl5 = getval("gzlvl5"), 
          gzlvl6 = getval("gzlvl6"), 
          gt1 = getval("gt1"),
          gt2 = getval("gt2"),
          gt3 = getval("gt3"),
          gt4 = getval("gt4"),
          gt5 = getval("gt5"),
          gt6 = getval("gt6"),
          gstab = getval("gstab"),
          tpwrsf = getval("tpwrsf"),
          shlvl1,
          shpw1,
          pwClvl = getval("pwClvl"),
          pwC = getval("pwC"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          dpwr2 = getval("dpwr2"),
          d2 = getval("d2"),
          shbw = getval("shbw"),
          shofs = getval("shofs")-4.77,
          timeTN = getval("timeTN"),
          tauC = getval("tauC"),
          tau1 = getval("tau1"),
          tau2 = getval("tau2"),
          taunh = getval("taunh");



   getstr("shname1", shname1);
   getstr("SE_flg",SE_flg);
   getstr("dec_flg",dec_flg);
   getstr("CT_flg",CT_flg);
   getstr("f1180",f1180);
   getstr("f2180",f2180);



  phase = (int) (getval("phase") + 0.5);
   
   settable(t1,2,phi1);
   settable(t3,4,phi3);
   settable(t10,1,phi10);
   settable(t12,4,phi12);
   settable(t13,4,phi13);

/*   INITIALIZE VARIABLES   */

   shpw1 = pw*8.0;
   shlvl1 = tpwr;

   pwS1 = c13pulsepw("co", "ca", "sinc", 90.0);
   pwS2 = c13pulsepw("co", "ca", "sinc", 180.0);
   pwS3 = c13pulsepw("ca", "co", "square", 180.0);
   pwS4 = h_shapedpw("eburp2",shbw,shofs,zero, 0.0, 0.0);  
   pwS6 = h_shapedpw("reburp",shbw,shofs,zero, 0.0, 0.0);
   pwS5 = h_shapedpw("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);


if (SE_flg[0] == 'y')
{
   if ( ni2*1/(sw2)/2.0 > (timeTN-pwS2*0.5-pwS4))
       { printf(" ni2 is too big. Make ni2 equal to %d or less.\n",
         ((int)((timeTN-pwS2*0.5-pwS4)*2.0*sw2)));    psg_abort(1);}
}
else
{
   if ( ni2*1/(sw2)/2.0 > (timeTN-pwS2*0.5))
       { printf(" ni2 is too big. Make ni2 equal to %d or less.\n",
         ((int)((timeTN-pwS2*0.5)*2.0*sw2)));    psg_abort(1);}
}

if (CT_flg[0] == 'y')
{
   if ( ni*1/(sw1) > (CTdelay))
       { printf(" ni is too big. Make ni equal to %d or less.\n",
         ((int)(CTdelay*sw1)));    psg_abort(1);}
}


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

if (SE_flg[0] =='y')
{
  if (phase2 == 2)  {tsadd(t10,2,4); icosel = +1;}
            else                               icosel = -1;
}
else
{
  if (phase2 == 2) tsadd(t3,1,4);
}

 

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

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

  
    


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

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



   status(A);
      rcvroff();  

   decpower(pwClvl);
   decoffset(dof);
   dec2power(pwNlvl);
   dec2offset(dof2);
   obspwrf(tpwrsf);
   decpwrf(4095.0);
   obsoffset(tof);
   set_c13offset("co");


     zgradpulse(gzlvl2, gt2);
       delay(1.0e-4);

       delay(d1-gt2);
lk_hold();

        h_shapedpulse("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);  

	delay(lambda-pwS5*0.5-pwS6*0.4); 

   	h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);

	delay(lambda-pwS5*0.5-pwS6*0.4);

        h_shapedpulse("pc9f_",shbw,shofs,one, 0.0, 0.0);  


   obspower(shlvl1);
/**************************************************************************/
      dec2rgpulse(pwN,zero,0.0,0.0);

           zgradpulse(gzlvl6,gt6);
           delay(timeTN-pwS2*0.5-gt6);

      sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);

           delay(timeTN-pwS2*0.5-taunh*0.5-shpw1);
           shaped_pulse(shname1,shpw1,two,0.0,0.0);
           zgradpulse(gzlvl6, gt6);
           delay(taunh*0.5-gt6);

     dec2rgpulse(pwN,zero,0.0,0.0);				     
           shaped_pulse(shname1,shpw1,zero,0.0,0.0);
/**************************************************************************/
/***        CO -> CA transfer             *********************************/
/**************************************************************************/
        c13pulse("co", "ca", "sinc", 90.0, zero, 2.0e-6, 0.0);

        zgradpulse(-gzlvl4, gt4);
        decphase(zero);
        delay(tauC - gt4 - 0.5*10.933*pwC);

        decrgpulse(pwC*158.0/90.0, zero, 0.0, 0.0);
        decrgpulse(pwC*171.2/90.0, two, 0.0, 0.0);
        decrgpulse(pwC*342.8/90.0, zero, 0.0, 0.0);      /* Shaka 6 composite */
        decrgpulse(pwC*145.5/90.0, two, 0.0, 0.0);
        decrgpulse(pwC*81.2/90.0, zero, 0.0, 0.0);
        decrgpulse(pwC*85.3/90.0, two, 0.0, 0.0);

        zgradpulse(-gzlvl4, gt4);
        decphase(one);
        delay(tauC - gt4 - 0.5*10.933*pwC - WFG_START_DELAY - 2.0e-6);
        c13pulse("co", "ca", "sinc", 90.0, one, 2.0e-6, 0.0);
/**************************************************************************/
/*  xxxxxxxxxxxxxxxxxxxx       13Ca EVOLUTION       xxxxxxxxxxxxxxxxxx    */
/**************************************************************************/
        set_c13offset("ca");

    if (CT_flg[0] == 'y')
    {
        c13pulse("ca", "co", "square", 90.0, t1, 2.0e-6, 0.0);   
        delay(tau1*0.5);
        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 0.0, 0.0);
        delay(CTdelay*0.5);
        c13pulse("cab", "co", "square", 180.0, zero, 0.0, 0.0);   
        delay((CTdelay-tau1)*0.5);
        c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);   

        c13pulse("ca", "co", "square", 90.0, zero, 0.0, 0.0);   
    }
    else
    {
      if (dec_flg[0] == 'y')
      {
        c13pulse("ca", "co", "square", 90.0, t1, 2.0e-6, 2.0e-6);   
        delay(tau1*0.5);
        c_shapedpulse2("isnob5",30.0,-31.0,"isnob5",30.0,120.0 , zero, 0.0, 0.0);
        dec2rgpulse(pwN*2.0,zero,0.0,0.0);				     
        delay(tau1*0.5);

        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
 
        dec2rgpulse(pwN*2.0,two,0.0,0.0);				     
        c_shapedpulse2("isnob5",30.0,-31.0,"isnob5",30.0,120.0 , two, 0.0, 0.0);

        c13pulse("ca", "co", "square", 90.0, zero, 2.0e-6, 2.0e-6);   
      }
      else
      {
        c13pulse("ca", "co", "square", 90.0, t1, 2.0e-6, 2.0e-6);   
        delay(tau1*0.5);
        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        delay(tau1*0.5);

        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
        c13pulse("co", "ca", "sinc", 180.0, zero, 2.0e-6, 2.0e-6);   
        if (pwN*2.0 > pwS2)  delay(pwN*2.0 - pwS2);

        c13pulse("ca", "co", "square", 90.0, zero, 2.0e-6, 2.0e-6);   
       }
     }
     
        set_c13offset("co");
        zgradpulse(gzlvl3, gt3);
        delay(1.0e-4);
/**************************************************************************/
/***        CO -> CA transfer             *********************************/
/**************************************************************************/
       c13pulse("co", "ca", "sinc", 90.0, one, 2.0e-6, 0.0);

        zgradpulse(gzlvl4, gt4*0.7);
        delay(tauC - gt4*0.7 - 0.5*10.933*pwC);

        decrgpulse(pwC*158.0/90.0, zero, 0.0, 0.0);
        decrgpulse(pwC*171.2/90.0, two, 0.0, 0.0);
        decrgpulse(pwC*342.8/90.0, zero, 0.0, 0.0);     /* Shaka 6 composite */
        decrgpulse(pwC*145.5/90.0, two, 0.0, 0.0);
        decrgpulse(pwC*81.2/90.0, zero, 0.0, 0.0);
        decrgpulse(pwC*85.3/90.0, two, 0.0, 0.0);

        zgradpulse(gzlvl4, gt4*0.7);
        delay(tauC - gt4*0.7 - 0.5*10.933*pwC - WFG_START_DELAY - 2.0e-6);
                                                           /* WFG_START_DELAY */
        c13pulse("co", "ca", "sinc", 90.0, zero, 2.0e-6, 0.0);



/**************************************************************************/

   obspower(shlvl1);
        shaped_pulse(shname1,shpw1,zero,0.0,0.0);

     dec2rgpulse(pwN,t3,0.0,0.0);

      if (SE_flg[0] == 'y')
      {
           delay(tau2*0.5);
        c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);
          delay(taunh*0.5-pwS3);
        shaped_pulse(shname1,shpw1,two,0.0,0.0);
          delay(timeTN-pwS2*0.5-shpw1-taunh*0.5-gt1-1.0e-4);

        zgradpulse(-gzlvl1, gt1);
        delay(1.0e-4);
      sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
           delay(timeTN-pwS2*0.5-tau2*0.5-pwS4);
        h_shapedpulse("eburp2",shbw,shofs,zero, 2.0e-6, 0.0); 
	dec2rgpulse(pwN, t10, 0.0, 0.0);
      }
      else
      {
           delay(tau2*0.5);
        c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);
          delay(taunh*0.5-pwS3);
        shaped_pulse(shname1,shpw1,two,0.0,0.0);
          delay(timeTN-pwS2*0.5-taunh*0.5-shpw1);

      sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
       delay(timeTN-pwS2*0.5-tau2*0.5);
       dec2rgpulse(pwN, zero, 0.0, 0.0);
      }

/**************************************************************************/
if (SE_flg[0] == 'y')
{
	zgradpulse(gzlvl5, gt5);
	delay(lambda-pwS6*0.4  - gt5);

   	h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl5, gt5);
	delay(lambda-pwS6*0.4  - gt5);

	dec2rgpulse(pwN, one, 0.0, 0.0);
  
        h_shapedpulse("eburp2_",shbw,shofs,one, 0.0, 0.0); 
 

	txphase(zero);
	dec2phase(zero);
	delay(lambda-pwS4*0.5-pwS6*0.4);

   	h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

	dec2phase(t10);
	delay(lambda-pwS4*0.5-pwS6*0.4);

 
        h_shapedpulse("eburp2",shbw,shofs,zero, 0.0, 0.0); 


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

        h_shapedpulse("reburp",shbw,shofs,zero, 0.0, rof2); 
        zgradpulse(icosel*gzlvl2, gt1/10.0);            /* 2.0*GRADIENT_DELAY */
        delay(gstab);
}
else
{
        h_shapedpulse("eburp2",shbw,shofs,zero, 2.0e-6, 0.0);
        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.4  - gt5);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.4  - gt5-POWER_DELAY-1.0e-4);
}

	dec2power(dpwr2);				       /* POWER_DELAY */
lk_sample();
if (SE_flg[0] == 'y')
	setreceiver(t13);
else
	setreceiver(t12);
      rcvron();  
statusdelay(C,1.0e-4 );

}		 
Exemplo n.º 5
0
pulsesequence()
{
   char   
          shname1[MAXSTR],
	  f1180[MAXSTR],
	  f2180[MAXSTR],
          SE_flg[MAXSTR];

   int    icosel = 0,
          t1_counter,
          t2_counter,
          ni2 = getval("ni2"),
          phase;


   double d2_init=0.0,
          d3_init=0.0,
          pwS1,pwS2,pwS3,pwS4,pwS5,pwS6,pwS7,
          lambda = getval("lambda"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl6 = getval("gzlvl6"), 
          gzlvl5 = getval("gzlvl5"), 
          gt1 = getval("gt1"),
          gt6 = getval("gt6"),
          gt5 = getval("gt5"),
          gstab = getval("gstab"),
          shlvl1 = getval("shlvl1"),
          shpw1 = getval("shpw1"),
          pwClvl = getval("pwClvl"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          d2 = getval("d2"),
          timeTN = getval("timeTN"),
          timeTN1,
          Delta,
          tauNCO = getval("tauNCO"),
          tauC = getval("tauC"),
          tau1 = getval("tau1"),
          tau2 = getval("tau2"),
          taunh = getval("taunh");



   getstr("shname1", shname1);
   getstr("SE_flg",SE_flg);
   getstr("f1180",f1180);
   getstr("f2180",f2180);

  phase = (int) (getval("phase") + 0.5);
   
   settable(t1,2,phi1);
   settable(t3,4,phi3);
   settable(t10,1,phi10);
   settable(t12,4,phi12);
   settable(t13,4,phi13);

/*   INITIALIZE VARIABLES   */

  timeTN1= timeTN-tauC;
  Delta = timeTN-tauC-tauNCO;

   pwS1 = c13pulsepw("ca", "co", "square", 90.0);
   pwS2 = c13pulsepw("ca", "co", "square", 180.0);
   pwS3 = c13pulsepw("co", "ca", "sinc", 180.0);
   pwS7 = c13pulsepw("co", "ca", "sinc", 90.0);
   pwS4 = h_shapedpw("eburp2",4.0,3.5,zero, 0.0, 0.0);  
   pwS5 = h_shapedpw("reburp",4.0,3.5,zero, 0.0, 0.0);
   pwS6 = h_shapedpw("pc9f",4.0,3.5,zero, 2.0e-6, 0.0);



if (SE_flg[0] == 'y')
{
   if ( ni2*1/(sw2)/2.0 > (timeTN1-Delta-pwS3-pwS4))
       { printf(" ni2 is too big. Make ni2 equal to %d or less.\n",
         ((int)((timeTN1-Delta-pwS3-pwS4)*2.0*sw2)));    psg_abort(1);}
}
else
{

   if ( ni2*1/(sw2)/2.0 > (timeTN1-Delta-pwS3))
       { printf(" ni2 is too big. Make ni2 equal to %d or less.\n",
         ((int)((timeTN1-Delta-pwS3)*2.0*sw2)));    psg_abort(1);}
}



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

if (SE_flg[0] =='y')
{
  if (phase2 == 2)  {tsadd(t10,2,4); icosel = +1;}
            else 			       icosel = -1;   
}
else
{
  if (phase2 == 2) {tsadd(t3,1,4); icosel = 1;}
}
 

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

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

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

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



   status(A);
   decpower(pwClvl);
   dec2power(pwNlvl);
   set_c13offset("co");

   zgradpulse(gzlvl6, gt6);
   delay(d1-gt6 +1.0e-4);
lk_hold();
     rcvroff();
        h_shapedpulse("pc9f",4.0,3.5,zero, 2.0e-6, 0.0);  

	delay(lambda-pwS5*0.5-pwS6*0.4); 

   	h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);

	delay(lambda-pwS5*0.5-pwS6*0.4);

        h_shapedpulse("pc9f_",4.0,3.5,one, 2.0e-6, 0.0);  


   obspower(shlvl1);
/**************************************************************************/
/*   xxxxxxxxxxxxxxxxxxxxxx   N-> CA transfer           xxxxxxxxxxxxxxxxxx    */
/**************************************************************************/
      dec2rgpulse(pwN,zero,0.0,0.0);

           delay(timeTN1);

      sim3_c13pulse("", "ca", "co", "square", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);

           delay(Delta);
	c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);      
           delay(timeTN1-Delta-pwS3+pwN*4.0/3.0);

	c13pulse("co", "ca", "sinc", 90.0, zero, 0.0, 0.0);      
           delay(tauC);
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
           delay(tauC-taunh*0.5-shpw1+pwS2+pwS7);
        shaped_pulse(shname1,shpw1,zero,0.0,0.0);
           delay(taunh*0.5-pwS2-pwS7);
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
	c13pulse("co", "ca", "sinc", 90.0, one, 0.0, 0.0);      
        

     dec2rgpulse(pwN,zero,0.0,0.0);				     
/**************************************************************************/
/*   xxxxxxxxxxxxxxxxxxxxxx       13CA EVOLUTION        xxxxxxxxxxxxxxxxxx    */
/**************************************************************************/
   set_c13offset("ca");
   
	c13pulse("ca", "co", "square", 90.0, t1, 2.0e-6, 0.0);       
        delay(tau1*0.5);
        sim3_c13pulse(shname1, "co", "ca", "sinc", "", shpw1, 180.0, 2.0*pwN,
                                                  zero, zero, zero, 0.0, 0.0);
        delay(tau1*0.5);
	c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);      

        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 0.0,
                                                   zero, zero, zero, 0.0, 0.0);
        if (pwN*2.0 > pwS3) delay(pwN*2.0-pwS3);
	c13pulse("ca", "co", "square", 90.0, zero, 0.0, 0.0);       

   set_c13offset("co");
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
   obspower(shlvl1);

     dec2rgpulse(pwN,t3,0.0,0.0);

	c13pulse("co", "ca", "sinc", 90.0, one, 0.0, 0.0);      
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
           delay(tauC);
        sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
        c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 2.0e-6);
           delay(tauC-taunh*0.5-shpw1);
        shaped_pulse(shname1,shpw1,zero,0.0,0.0);
           delay(taunh*0.5);
	c13pulse("co", "ca", "sinc", 90.0, zero, 0.0, 0.0);      
/**************************************************************************/

      if (SE_flg[0] == 'y')
      {
 	   delay(tau2*0.5);
        shaped_pulse(shname1,shpw1,two,0.0,0.0);
           delay(timeTN1+pwN*4.0/3.0-shpw1-gt1-1.0e-4);
        zgradpulse(-gzlvl1, gt1);
        delay(1.0e-4);
      sim3_c13pulse("", "ca", "co", "square", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
       delay(Delta);
	c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);      
           delay(timeTN1-tau2*0.5-pwS4-Delta-pwS3);
        h_shapedpulse("eburp2",4.0,3.5,zero, 2.0e-6, 0.0); 
	dec2rgpulse(pwN, t10, 0.0, 0.0);
      }
      else
      {
 	   delay(tau2*0.5);
        shaped_pulse(shname1,shpw1,two,0.0,0.0);
           delay(timeTN1+pwN*4.0/3.0-shpw1);
      sim3_c13pulse("", "ca", "co", "square", "", 0.0, 180.0, 2.0*pwN,
                                             zero, zero, zero, 2.0e-6, 2.0e-6);
       delay(Delta);
	c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);      
       delay(timeTN1-tau2*0.5-Delta-pwS3);
       dec2rgpulse(pwN, zero, 0.0, 0.0);
      }

/**************************************************************************/
if (SE_flg[0] == 'y')
{
	zgradpulse(gzlvl5, gt5);
	delay(lambda-pwS6*0.4  - gt5);

   	h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl5, gt5);
	delay(lambda-pwS6*0.4  - gt5);

	dec2rgpulse(pwN, one, 0.0, 0.0);
  
        h_shapedpulse("eburp2_",4.0,3.5,one, 0.0, 0.0); 
 

	txphase(zero);
	dec2phase(zero);
	delay(lambda-pwS4*0.5-pwS6*0.4);

   	h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

	dec2phase(t10);
	delay(lambda-pwS4*0.5-pwS6*0.4);

 
        h_shapedpulse("eburp2",4.0,3.5,zero, 0.0, 0.0); 


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

        h_shapedpulse("reburp",4.0,3.5,zero, 0.0, 0.0); 
        zgradpulse(icosel*gzlvl2, gt1/10.0);            /* 2.0*GRADIENT_DELAY */
        delay(gstab);
}
else
{
        h_shapedpulse("eburp2",4.0,3.5,zero, 2.0e-6, 0.0);
        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.4  - gt5);

        h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.4  - gt5-POWER_DELAY-1.0e-4);
}

	dec2power(dpwr2);				       /* POWER_DELAY */
lk_sample();
if (SE_flg[0] == 'y')
	setreceiver(t13);
else
	setreceiver(t12);
      rcvron();  
statusdelay(C,1.0e-4 );

}		 
Exemplo n.º 6
0
pulsesequence()
{
   char   
          shname1[MAXSTR],
	  f1180[MAXSTR],
          SE_flg[MAXSTR];

   int    icosel = 0,
          t1_counter,
          phase;


   double d2_init=0.0,
          pwS4,pwS5,pwS6,pwS7,
          lambda = getval("lambda"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl3 = getval("gzlvl3"), 
          gzlvl5 = getval("gzlvl5"), 
          gt1 = getval("gt1"),
          gt3 = getval("gt3"),
          gt5 = getval("gt5"),
          gstab = getval("gstab"),
          shpw1,shlvl1=getval("shlvl1"),
          pwClvl = getval("pwClvl"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          ni = getval("ni"),
          d2 = getval("d2"),
          tau1 = getval("tau1");

   getstr("shname1", shname1);
   getstr("SE_flg",SE_flg);
   getstr("f1180",f1180);



  phase = (int) (getval("phase") + 0.5);
   
   settable(t3,2,phi3);
   settable(t10,1,phi10);
   settable(t12,2,phi12);
   settable(t13,2,phi13);

/*   INITIALIZE VARIABLES   */

   shpw1 = getval("shpw1");
   pwS4 = h_shapedpw("eburp2",4.0,3.5,zero, 0.0, 0.0);  
   pwS5 = h_shapedpw("pc9f",4.0,3.5,zero, 2.0e-6, 0.0);
   pwS6 = h_shapedpw("reburp",4.0,3.5,zero, 0.0, 0.0);
   pwS7 = c_shapedpw2("isnob5",40.0,-125.0,"isnob5",40.0,0.0 , two, 0.0, 0.0);

if (SE_flg[0] =='y')
{
  if (phase == 2)  {tsadd(t10,2,4); icosel = +1;}
            else                               icosel = -1;
}
else
{
  if (phase == 2) {tsadd(t3,1,4); icosel=1;}
}
 

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

   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); tsadd(t13,2,4); }



   status(A);
   decpower(pwClvl);
   dec2power(pwNlvl);
   set_c13offset("co");
   zgradpulse(gzlvl3, gt3);
   delay(d1-gt3);
   lk_hold();
   rcvroff();
        h_shapedpulse("pc9f",4.0,3.5,zero, 2.0e-6, 0.0);  

	delay(lambda-pwS5*0.5-pwS6*0.4); 

   	h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);

	delay(lambda-pwS5*0.5-pwS6*0.4);

        h_shapedpulse("pc9f_",4.0,3.5,one, 0.0, 0.0);  


   obspower(shlvl1);
/**************************************************************************/ 
/** Sensitivity enhanced version                     **********************/
/**************************************************************************/ 
      if (SE_flg[0] == 'y')
      {
        shaped_pulse(shname1,shpw1,zero,0.0,0.0);
     dec2rgpulse(pwN,t3,0.0,0.0);
           delay(tau1*0.5);
        shaped_pulse(shname1,shpw1,two,0.0,0.0);
 c_shapedpulse2("isnob5",40.0,-125.0,"isnob5",40.0,0.0 , two, 0.0, 0.0);
           delay(tau1*0.5);
        zgradpulse(-gzlvl1, gt1);
           delay(pwS4-shpw1-pwS7-gt1);
     dec2rgpulse(pwN*2.0,zero,0.0,0.0);

        h_shapedpulse("eburp2",4.0,3.5,zero, 2.0e-6, 0.0); 
	dec2rgpulse(pwN, t10, 0.0, 0.0);
      }

/**************************************************************************/ 
/** standard INEPT-based version                     **********************/
/**************************************************************************/ 
      else
      {
      if (ni < 1.0)
      {
       dec2rgpulse(pwN,t3,0.0,0.0);
       dec2rgpulse(pwN*2.0, zero, 0.0, 0.0);
       dec2rgpulse(pwN, zero, 0.0, 0.0);
      }
      else
      {
           if (tau1 < shpw1)
           {
           shaped_pulse(shname1,shpw1,two,0.0,0.0);
           shaped_pulse(shname1,shpw1,zero,0.0,0.0);
           dec2rgpulse(pwN,t3,0.0,0.0);
           delay(tau1);
           dec2rgpulse(pwN*3.0, zero, 0.0, 0.0);
           }
           else
           {
             if  (tau1*0.5 < (pwS7+shpw1*0.5))
             {
             shaped_pulse(shname1,shpw1,two,0.0,0.0);
             dec2rgpulse(pwN,t3,0.0,0.0);
             delay(tau1*0.5-shpw1*0.5);
             shaped_pulse(shname1,shpw1,zero,0.0,0.0);
             delay(tau1*0.5-shpw1*0.5);
             dec2rgpulse(pwN*3.0, zero, 0.0, 0.0);
             }
             else
             {
             shaped_pulse(shname1,shpw1,two,0.0,0.0);
             dec2rgpulse(pwN,t3,0.0,0.0);
             delay(tau1*0.5-shpw1*0.5);
             shaped_pulse(shname1,shpw1,zero,0.0,0.0);
             c_shapedpulse2("isnob5",40.0,-125.0,"isnob5",40.0,0.0 , two, 0.0, 0.0);
             delay(tau1*0.5-shpw1*0.5-pwS7);
             dec2rgpulse(pwN*3.0, zero, 0.0, 0.0);
             }
           } 
      }
      }
/**************************************************************************/ 

if (SE_flg[0] == 'y')
{
	zgradpulse(gzlvl5, gt5);
	delay(lambda-pwS6*0.4  - gt5);

   	h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

	zgradpulse(gzlvl5, gt5);
	delay(lambda-pwS6*0.4  - gt5);

	dec2rgpulse(pwN, one, 0.0, 0.0);
  
        h_shapedpulse("eburp2_",4.0,3.5,one, 0.0, 0.0); 
 

	txphase(zero);
	dec2phase(zero);
	delay(lambda-pwS4*0.5-pwS6*0.4);

   	h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

	dec2phase(t10);
	delay(lambda-pwS4*0.5-pwS6*0.4);

 
        h_shapedpulse("eburp2",4.0,3.5,zero, 0.0, 0.0); 


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

        h_shapedpulse("reburp",4.0,3.5,zero, 0.0, 0.0); 
        zgradpulse(icosel*gzlvl2, gt1/10.0);            /* 2.0*GRADIENT_DELAY */
        delay(gstab);
}
else
{
        h_shapedpulse("eburp2",4.0,3.5,zero, 2.0e-6, 0.0);
        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.4  - gt5);

        h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.4  - gt5-POWER_DELAY-1.0e-4); 
}

	dec2power(dpwr2);				       /* POWER_DELAY */
lk_sample();
if (SE_flg[0] == 'y')
	setreceiver(t13);
else
	setreceiver(t12);
statusdelay(C,1.0e-4 );

}		 
Exemplo n.º 7
0
pulsesequence()
{
   char   
          shname1[MAXSTR],
	  f1180[MAXSTR],
	  f2180[MAXSTR],
          n15_flg[MAXSTR],
          CT_flg[MAXSTR];


   int    icosel,
          t1_counter,
          t2_counter,
          ni2 = getval("ni2"),
          phase;


   double d2_init=0.0,
          d3_init=0.0,
          pwS1,pwS2,pwS3,pwS4,pwS5,pwS6,
          kappa,
          lambda = getval("lambda"),
          CTdelay = getval("CTdelay"),
          gzlvl1 = getval("gzlvl1"),
          gzlvl2 = getval("gzlvl2"), 
          gzlvl4 = getval("gzlvl4"), 
          gzlvl5 = getval("gzlvl5"), 
          gzlvl6 = getval("gzlvl6"), 
          gt1 = getval("gt1"),
          gt4 = getval("gt4"),
          gt5 = getval("gt5"),
          gt6 = getval("gt6"),
          gstab = getval("gstab"),
          scale = getval("scale"),
          sw1 = getval("sw1"),
          tpwrsf = getval("tpwrsf"),
          shlvl1,
          shpw1 = getval("shpw1"),
          pwC = getval("pwC"),
          pwClvl = getval("pwClvl"),
          pwNlvl = getval("pwNlvl"),
          pwN = getval("pwN"),
          dpwr2 = getval("dpwr2"),
          d2 = getval("d2"),
          t2a,t2b,halfT2,
          t1a,t1b,halfT1,
          shbw = getval("shbw"),
          shofs = getval("shofs")-4.77,
          timeTN = getval("timeTN"),
          timeTN1 = getval("timeTN1"),
          timeCN = getval("timeCN"),
          tauC = getval("tauC"),
          tauCC = getval("tauCC"),
          tau1 = getval("tau1"),
          tau2 = getval("tau2"),
          taunh = getval("taunh");



   getstr("shname1", shname1);
   getstr("f1180",f1180);
   getstr("f2180",f2180);
   getstr("n15_flg",n15_flg);
   getstr("CT_flg",CT_flg);



  phase = (int) (getval("phase") + 0.5);
   
   settable(t1,2,phi1);
   settable(t2,4,phi2);
   settable(t3,1,phi3);
   settable(t4,8,phi4);
   settable(t5,1,phi5);
   settable(t14,8,phi14);
   settable(t24,8,phi24);


/*   INITIALIZE VARIABLES   */
   kappa = 5.4e-3;
   //shpw1 = pw*8.0;
   shlvl1 = tpwr;
   f1180[0] ='n'; 
   f2180[0] ='n'; 

   pwS1 = c13pulsepw("co", "ca", "sinc", 90.0);
   pwS2 = c13pulsepw("co", "ca", "sinc", 180.0);
   pwS3 = c13pulsepw("ca", "co", "square", 180.0);
   pwS4 = h_shapedpw("eburp2",shbw,shofs,zero, 0.0, 0.0);
   pwS6 = h_shapedpw("reburp",shbw,shofs,zero, 0.0, 0.0);
   pwS5 = h_shapedpw("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);



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

if   ( phase2 == 2 )
        {
        tsadd ( t3,2,4  );
        tsadd ( t5,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;


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

/************************************************************/

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

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


/************************************************************/
/* Set up CONSTANT/SEMI-CONSTANT time evolution in N15 */
/************************************************************/

   if (ni2 > 1)
   {
   halfT2 = 0.5*(ni2-1)/sw2;
   t2b = (double) t2_counter*((halfT2 - timeTN)/((double)(ni2-1)));
   if( ix==1 && halfT2 - timeTN > 0 ) printf("SCT mode on, max ni2=%g\n",timeTN*sw2*2+1);
    if(t2b < 0.0) t2b = 0.0;
    
    t2a = timeTN - tau2*0.5 + t2b;
    if(t2a < 0.2e-6)  t2a = 0.0;
    }
    else
    {
    t2b = 0.0;
    t2a = timeTN - tau2*0.5;
    }

/************************************************************/
   if (ni > 1)
   {
   halfT1 = 0.5*(ni-1)/sw1;
   t1b = (double) t1_counter*((halfT1 - timeTN1)/((double)(ni-1)));
    if(t1b < 0.0) t1b = 0.0;
    t1a = timeTN1 - tau1*0.5 + t1b;
    if(t1a < 0.2e-6)  t1a = 0.0;
    }
    else
    {
    t1b = 0.0;
    t1a = timeTN1 - tau1*0.5;
    }
/************************************************************/


   status(A);
      rcvroff();  

   decpower(pwClvl);
   decoffset(dof);
   dec2power(pwNlvl);
   dec2offset(dof2);
   obspwrf(tpwrsf);
   decpwrf(4095.0);
   obsoffset(tof);
   set_c13offset("co");


      dec2rgpulse(pwN*2.0,zero,0.0,0.0);
     zgradpulse(1.7*gzlvl4, gt4);
       delay(1.0e-4);

lk_sample();
       delay(d1-gt4);
lk_hold();
        h_shapedpulse("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);

        delay(lambda-pwS5*0.5-pwS6*0.5);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0);

        delay(lambda-pwS5*0.5-pwS6*0.5);

   if(n15_flg[0]=='y') h_shapedpulse("pc9f_",shbw,shofs,three, 0.0, 0.0);
     else h_shapedpulse("pc9f_",shbw,shofs,one, 0.0, 0.0);

         shaped_pulse(shname1,shpw1,zero,0.0,0.0);

           zgradpulse(2.3*gzlvl4, gt4);
           delay(1.0e-4);
/**************************************************************************/
/***         N -> CO transfer             *********************************/
/**************************************************************************/
      dec2rgpulse(pwN,t1,0.0,0.0);

           delay(tau1*0.5);
         c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);
         delay(taunh-pwS3);
         shaped_pulse(shname1,shpw1,two,0.0,0.0);
         delay(timeTN1-pwS2-taunh-shpw1);
        c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);
        delay (t1b);
        dec2rgpulse (2.0*pwN, zero, 0.0, 0.0);
        delay (t1a);

     dec2rgpulse(pwN,zero,0.0,0.0);
/**************************************************************************/
/***        CO -> CA transfer             *********************************/
/**************************************************************************/
        c13pulse("co", "ca", "sinc", 90.0, t2, 2.0e-6, 0.0);

        zgradpulse(-gzlvl4, gt4);
        decphase(zero);
        delay(tauC - gt4 - 0.5*10.933*pwC);

        decrgpulse(pwC*158.0/90.0, zero, 0.0, 0.0);
        decrgpulse(pwC*171.2/90.0, two, 0.0, 0.0);
        decrgpulse(pwC*342.8/90.0, zero, 0.0, 0.0);      /* Shaka 6 composite */
        decrgpulse(pwC*145.5/90.0, two, 0.0, 0.0);
        decrgpulse(pwC*81.2/90.0, zero, 0.0, 0.0);
        decrgpulse(pwC*85.3/90.0, two, 0.0, 0.0);

        zgradpulse(-gzlvl4, gt4);
        decphase(one);
        delay(tauC - gt4 - 0.5*10.933*pwC - WFG_START_DELAY - 2.0e-6);
        c13pulse("co", "ca", "sinc", 90.0, one, 0.0, 0.0);
/**************************************************************************/
/***        CA -> N transfer             *********************************/
/**************************************************************************/
        set_c13offset("ca");

        c13pulse("ca", "co", "square", 90.0, zero, 2.0e-6, 0.0);
        delay(tauC);
        c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);
        delay(timeCN-tauC);
   sim3_c13pulse("", "cab", "co", "square", "", 0.0, 180.0, 2.0*pwN, zero, zero, zero, 2.0e-6, 2.0e-6);
        delay(timeCN);
        c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);
        c13pulse("ca", "co", "square", 90.0, one, 2.0e-6, 0.0);


/**************************************************************************/
/***        N -> CA back transfer         *********************************/
/**************************************************************************/
     dec2rgpulse(pwN,t4,0.0,0.0);

           delay(tau2*0.5);
         c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);
         //delay(timeTN-pwS3-pwS2-gt1-1.0e-4);
       
        delay(timeTN-pwS3-pwS2-gt1-1.0e-4-2.0*GRADIENT_DELAY-4*POWER_DELAY-4*PWRF_DELAY-(4/PI)*pwN);
         zgradpulse(-gzlvl1, gt1); 
       delay(1.0e-4);
        c13pulse("ca", "co", "square", 180.0, zero, 0.0, 0.0);
        delay (t2b);
        dec2rgpulse (2.0*pwN, zero, 0.0, 0.0);
        delay (t2a);

/**************************************************************************/
        delay(gt1/10.0+1.0e-4);
        h_shapedpulse("eburp2_",shbw,shofs,t3, 2.0e-6, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.5-pwS4*scale- gt5);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);

        zgradpulse(gzlvl5, gt5);
        delay(lambda-pwS6*0.5-pwS4*scale- gt5);

        h_shapedpulse("eburp2",shbw,shofs,zero, 0.0, 0.0);
        delay(gt1/10.0+1.0e-4);

     dec2rgpulse(pwN,one,0.0,0.0);
        zgradpulse(gzlvl6, gt6);

        txphase(zero);
        delay(lambda-pwS6*0.5-gt6);

        h_sim3shapedpulse("reburp",shbw,shofs,0.0,2.0*pwN, zero, zero, zero, 0.0, 0.0);
        zgradpulse(gzlvl6, gt6);

        delay(lambda-pwS6*0.5-gt6);
     dec2rgpulse(pwN,t5,0.0,0.0);
/**************************************************************************/

        zgradpulse(-icosel*gzlvl2, gt1/10.0);
        dec2power(dpwr2);                                      /* POWER_DELAY */
lk_sample();
 if (n15_flg[0] =='y')
{
   setreceiver(t14);
}
else
{
   setreceiver(t24);
}

      rcvron();
statusdelay(C,1.0e-4 );

}