Пример #1
0
void pulsesequence()
{
/* DECLARE VARIABLES */

 char        shape_ss[MAXSTR];
             
 int	     t1_counter;

 double   
             tau1,                  /* t1/2  */
  	     taua = getval("taua"),     /* 2.25ms  */
  	     taub = getval("taub"),     /* 2.75ms  */
             time_T1,
             pwN,                   /* PW90 for N-nuc            */
             pwNlvl,                /* power level for N hard pulses */
        ncyc = getval("ncyc"),
   	compH= getval("compH"),
   	pwHs = getval("pwHs"),	        /* H1 90 degree pulse length at tpwrs */
   	tpwrs ,                    /* power for the pwHs ("H2Osinc") pulse */
   	tpwrsf ,                   /* fine power for the pwHs ("H2Osinc") pulse */
        shss_pwr,             /* power for cos modulated NH pulses */
        pw_shpss=getval("pw_shpss"),
        waterdly,              /* pw for water pulse  */
        waterpwrf,             /* fine power for water pulse  */
        waterpwr,              /* power for water pulse  */
  gt0,
  gt1 = getval("gt1"),
  gt2 = getval("gt2"),
  gt3 = getval("gt3"),
  gt4 = getval("gt4"),
  gt5 = getval("gt5"),
  gt6 = getval("gt6"),
  gzlvl0 = getval("gzlvl0"),
  gzlvl1 = getval("gzlvl1"),
  gzlvl2 = getval("gzlvl2"),
  gzlvl3 = getval("gzlvl3"),
  gzlvl4 = getval("gzlvl4"),
  gzlvl5 = getval("gzlvl5"),
  gzlvl6 = getval("gzlvl6");

/* LOAD VARIABLES */

  pwN = getval("pwN");
  pwNlvl = getval("pwNlvl"); 
  tpwrsf = getval("tpwrsf");
  waterpwrf = getval("waterpwrf");
  waterdly = getval("waterdly");


  getstr("shape_ss",shape_ss);
  
  time_T1=ncyc*(2.0*2.5e-3+pw_shpss);
  
  if (ix==1) printf(" ncyc= %f,   time_T1= %f \n", ncyc,time_T1);    


    /* 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 watergate pulse */
        waterpwr = tpwr - 20.0*log10(waterdly/(compH*pw));  
	waterpwr = (int) (waterpwr);        

    /* selective cos modulated NH 180 degree pulse */
        shss_pwr = tpwr - 20.0*log10(pw_shpss/((compH*2*pw)*2));   /* needs 2 times more */
	shss_pwr = (int) (shss_pwr);                   /* power than a square pulse */




/* check validity of parameter range */

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

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

    if (dmm2[A] == 'g' || dmm2[B] == 'g' || dmm2[C] == 'g')
	{
	printf("incorrect Dec2 decoupler flag! dmm2 should be 'ccc' ");
	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(gt1 > 15.0e-3 || gt2 > 15.0e-3 || gt3 > 15.0e-3 || gt4 > 15.0e-3)
    {
        printf("gti must be less than 15 ms \n");
        psg_abort(1);
    }


/* LOAD VARIABLES */

  settable(t1, 8, phi1);
  settable(t2, 4, phi2);
  settable(t3, 1, phi3);
  settable(t10, 8, phi10);

  settable(t14, 8, rec);
  
  

/* Phase incrementation for hypercomplex data */

   if ( phase1 == 2 )     /* Hypercomplex in t1 */
   {     ttadd(t14,t10,4);
         tsadd(t3,2,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);

      tau1=0.5*d2;	
	
      if(t1_counter %2) {
        tsadd(t2,2,4);
        tsadd(t14,2,4);
      }
      
 
/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   obspower(tpwr);               /* Set power for pulses  */
   dec2power(pwNlvl);            /* Set decoupler2 power to pwNlvl */

   initval(ncyc+0.1,v10);  /* for DIPSI-2 */

 delay(d1);

status(B);
  rcvroff();

/*destroy N15  magnetization*/	

   	dec2rgpulse(pwN, zero, 0.0, 0.0);

	zgradpulse(gzlvl1, gt1);
	delay(9.0e-5);

/*  1H-15N INEPT  */

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

  txphase(zero);  dec2phase(zero);
  zgradpulse(gzlvl2,gt2);
  delay(taua -pwN-0.5*pw  -gt2 );               /* delay=1/4J(NH)   */

  sim3pulse(2.0*pw,0.0e-6,2*pwN,zero,zero,zero,0.0,0.0);

  txphase(one);  dec2phase(t1);
  zgradpulse(gzlvl2,gt2);
  delay(taua -1.5*pwN  -gt2);               /* delay=1/4J(NH)   */

  sim3pulse(pw,0.0e-6,pwN,one,zero,t1,0.0,0.0);


  if (tpwrsf < 4095.0)
     {obspwrf(tpwrsf); tpwrs=tpwrs+6.0;}

	obspower(tpwrs); 
   	shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 0.0);   
	obspower(tpwr); obspwrf(4095.0); tpwrs=tpwrs-6.0; 
 
  txphase(zero);  dec2phase(zero);
  zgradpulse(gzlvl3,gt3);
  delay(taub -1.5*pwN  -gt3 -pwHs-2.0e-6-2.0*POWER_DELAY-WFG_START_DELAY);               /* delay=1/4J(NH)   */

  sim3pulse(2.0*pw,0.0e-6,2*pwN,zero,zero,zero,0.0,0.0);

  dec2phase(one);
  zgradpulse(gzlvl3,gt3);
  delay(taub -1.5*pwN  -gt3 );               /* delay=1/4J(NH)   */
  dec2phase(one);

  dec2rgpulse(pwN,one,0.0,0.0);
  
/* relaxation recovery */

      if (ncyc>0.6)
      {
         obspower(shss_pwr); 
         
         starthardloop(v10);
	    delay(2.5e-3);
	    shaped_pulse(shape_ss,pw_shpss,zero,0.0,0.0);
	    delay(2.5e-3);
         endhardloop();  
      
         obspower(tpwr);
      } 

  zgradpulse(gzlvl6,gt6);
  delay(200.0e-6);


  dec2rgpulse(pwN,t2,0.0,0.0);
 
  txphase(t3); dec2phase(zero);
  
/*  evolution of t1  */

  if(d2>0.001)
  {  
     zgradpulse( gzlvl0,(d2/2.0-0.0003-2.0*GRADIENT_DELAY));
     delay(300.0e-6);
     zgradpulse(-gzlvl0,(d2/2.0-0.0003-2.0*GRADIENT_DELAY));
     delay(300.0e-6);
  }
  else
     delay(d2);

  
/* ST2   */

  rgpulse(pw,t3,0.0,0.0);

  txphase(t3);
  if (waterpwrf < 4095.0)
     {obspwrf(waterpwrf); waterpwr=waterpwr+6.0;}
  obspower(waterpwr);

  rgpulse(waterdly,t3,0.0,rof1);
  if (waterpwrf < 4095.0)
     {obspwrf(4095.0); waterpwr=waterpwr-6.0;}

  obspower(tpwr); 
  txphase(zero); 

  zgradpulse(gzlvl4,gt4);
  delay(taua -pwN -0.5*pw -gt4-waterdly-rof1);           

  sim3pulse(2.0*pw,0.0e-6,2*pwN,zero,zero,zero,0.0,0.0);

  dec2phase(t3);
  zgradpulse(gzlvl4,gt4);
  delay(taua -1.5*pwN  -gt4  -waterdly-rof1);               /* delay=1/4J(NH)   */

  if (waterpwrf < 4095.0)
     {obspwrf(waterpwrf); waterpwr=waterpwr+6.0;}
  obspower(waterpwr);
  txphase(two);

  rgpulse(waterdly,two,rof1,0.0);  
  if (waterpwrf < 4095.0)
     {obspwrf(4095.0); waterpwr=waterpwr-6.0;}

  obspower(tpwr);
  sim3pulse(pw,0.0e-6,pwN,zero,zero,t3,0.0,0.0);

/*  watergate   */

  zgradpulse(gzlvl5,gt5);
 
  delay(taua-1.5*pwN-waterdly-gt5);
  txphase(two);
  if (waterpwrf < 4095.0)
     {obspwrf(waterpwrf); waterpwr=waterpwr+6.0;}
  obspower(waterpwr);
  dec2phase(zero);     

  rgpulse(waterdly,two,0.0,rof1);
  if (waterpwrf < 4095.0)
     {obspwrf(4095.0); waterpwr=waterpwr-6.0;}
  
  obspower(tpwr);
  txphase(zero); 
 
  sim3pulse(2.0*pw,0.0e-6,2*pwN,zero,zero,zero,0.0,0.0);

  if (waterpwrf < 4095.0)
     {obspwrf(waterpwrf); waterpwr=waterpwr+6.0;}
  obspower(waterpwr);
  txphase(two);

  rgpulse(waterdly,two,rof1,0.0);  
  if (waterpwrf < 4095.0)
     {obspwrf(4095.0); waterpwr=waterpwr-6.0;}

  zgradpulse(gzlvl5,gt5);
  obspwrf(4095.0); obspower(tpwr);
  delay(taua-1.5*pwN-waterdly-gt5);       

  dec2rgpulse(pwN,zero,0.0,0.0);

  
/* acquire data */

status(C);
     setreceiver(t14);
}
Пример #2
0
pulsesequence()
{
/* DECLARE VARIABLES */

 char        f1180[MAXSTR],C13refoc[MAXSTR],C13filter[MAXSTR];
             
 int	     t1_counter;

 double    	
   	dofCHn = getval("dofCHn"),
   	tauNH  = 1.0/(4.0*getval("JNH")),  /* delay for 1H-15N INEPT   1/4JNH  */
  	tauNH1 = getval("tauNH1"), /* 1/2JNH  */
  	tauNH2 = getval("tauNH2"), /* 1/2JNH  */
  	tauCH1 = getval("tauCH1"), /* 1/2JCH  */
  	tauCH2 = getval("tauCH2"), /* 1/2JCH   tauCH2=2tauNH1-2tauCH1 */
  	fact = getval("fact"),     /* scale factor for spin-echo filter */ 
  	mix = getval("mix"),             /* mixing time for H2O - NH  */ 	     
   	     tau1,
   	     pwHs = getval("pwHs"),  	      
   	     tpwrs,tpwrsf=getval("tpwrsf"),
   	     compH=getval("compH"),	  	              
  pwN = getval("pwN"),
  pwNlvl = getval("pwNlvl"), 
  pwClvl = getval("pwClvl"), 	  	        /* coarse power for C13 pulse */
  pwC = getval("pwC"),     	      /* C13 90 degree pulse length at pwClvl */
  compC = getval("compC"),
  rf0,            	          /* maximum fine power when using pwC pulses */
  rfst,	                           /* fine power for the stCall pulse */
  gt1 = getval("gt1"),
  gt2 = getval("gt2"),
  gt3 = getval("gt3"),
  gt4 = getval("gt4"),
  gt5 = getval("gt5"),
  gstab = getval("gstab"),
  gzlvl1 = getval("gzlvl1"),
  gzlvl2 = getval("gzlvl2"),
  gzlvl3 = getval("gzlvl3"),
  gzlvl4 = getval("gzlvl4"),
  gzlvl5 = getval("gzlvl5"),
  gzlvlf = getval("gzlvlf"), /* remove radiation damping in spin-echo filter */
  gzlvlm = getval("gzlvlm"), /* remove radiation damping in mixing time */
  gzlvld = getval("gzlvld"); /* remove radiation damping in t1 evolution */

/* LOAD VARIABLES */

  getstr("f1180",f1180); 
  getstr("C13refoc",C13refoc);
  getstr("C13filter",C13filter);
   
/* maximum fine power for pwC pulses (and initialize rfst) */

	rf0 = 4095.0;    rfst=0.0;

/* 180 degree adiabatic C13 pulse from 0 to 200 ppm */

     if (C13refoc[A]=='y')
       {rfst = (compC*4095.0*pwC*4000.0*sqrt((30.0*sfrq/600.0+7.0)/0.35));   
	rfst = (int) (rfst + 0.5);
	if ( 1.0/(4000.0*sqrt((30.0*sfrq/600.0+7.0)/0.35)) < pwC )
           { text_error( " Not enough C13 RF. pwC must be %f usec or less.\n", 
	    (1.0e6/(4000.0*sqrt((30.0*sfrq/600.0+7.0)/0.35))) );    psg_abort(1); }}
   
/* selective H20 one-lobe sinc pulse */
   
        tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69));   
	tpwrs = (int) (tpwrs);                   
        if (tpwrsf<4095.0) tpwrs=tpwrs+6; /* permit fine power control */
  

/* check validity of parameter range */

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

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

    if (dmm[A] == 'y')
	{
	printf("incorrect Dec2 decoupler flag!  ");
	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((gt1>5.0e-3) || (gt2>5.0e-3) || (gt3>5.0e-3) || (gt4>5.0e-3) || (gt5>5.0e-3))
    {
        printf("gti must be less than 5 ms \n");
        psg_abort(1);
    }
  
  if(gzlvlf >200 || gzlvlf >200 || gzlvld >200)
    {
        printf("gzlvlf/m/d should not be larger than 200 DAC \n");
        psg_abort(1);
    }


/* LOAD VARIABLES */

  settable(t1, 4, phi1);
  settable(t2, 1, phi2);
  settable(t3, 8, phi3);
  settable(t4, 8, phi4);
  settable(t5, 16,  phi5);
  settable(t6, 32,  phi6); 
  settable(t10, 4, phi10);
  settable(t14, 4, rec);
  
/* Phase incrementation for hypercomplex data */

   if ( phase1 == 2 )     /* Hypercomplex in t1 */
   {     tsadd(t2,2,4);
	 ttadd(t14,t10,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(t14,2,4);
      }

    tau1=d2;
    if( (f1180[A] == 'y') && (ni >1.0) )  tau1 += (1.0/(2.0*sw1));
    tau1=0.5*tau1;      
 
/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   obspower(tpwr);               /* Set power for pulses  */
   dec2power(pwNlvl);            /* Set decoupler2 power to pwNlvl */
   decpower(pwClvl);
   decpwrf(rf0);
   obsoffset(tof); 
   decoffset(dofCHn);  
 delay(d1);
status(B);
  rcvroff();
  
  txphase(t3);
  delay(9.0e-5);

/* spin-echo filter and 15N/13C double filters */

  rgpulse(pw,t3,0.0,0.0); 
 
  if(C13filter[A]=='y')   

{ 
  decphase(t5);
  zgradpulse(gzlvl1,gt1);
  delay(tauCH1-gt1); 
  decrgpulse(pwC,t5,0.0,0.0);
 
  txphase(one); dec2phase(t5);
  delay(tauNH1-tauCH1-pwN*0.5);
  sim3pulse(2.0*pw,2*pwC,pwN,one,zero,t5,0.0,0.0);
 
  decphase(t6);
  delay(tauCH2+tauCH1-tauNH1-pwN*0.5);
  decrgpulse(pwC,t6,0.0,0.0);
  
  delay(tauNH1+tauNH2-tauCH1-tauCH2-gt1-gstab); 
  zgradpulse(gzlvl1,gt1);
  delay(gstab);   
}
 
 else
  
{ 
  txphase(one); dec2phase(t5);
 if (gzlvlf>0.0) 
 {
  delay(2.0e-6);
  zgradpulse(gzlvlf,0.5*fact*tauNH1-pwN*0.25-11.0e-6);
  delay(2.0e-5); 
  zgradpulse(-gzlvlf,0.5*fact*tauNH1-pwN*0.25-11.0e-6);
  delay(2.0e-6);
  
  sim3pulse(2.0*pw,0.0e-6,pwN,one,zero,t5,0.0,0.0);
 
  delay(2.0e-6);
  zgradpulse(gzlvlf,0.5*fact*tauNH2-pwN*0.25-11.0e-6);
  delay(2.0e-5);
  zgradpulse(-gzlvlf,0.5*fact*tauNH2-pwN*0.25-11.0e-6);
  delay(2.0e-6);
 }
 else
 {
  delay(fact*tauNH1-pwN*0.5);
  sim3pulse(2.0*pw,0.0e-6,pwN,one,zero,t5,0.0,0.0);
  delay(fact*tauNH1-pwN*0.5);
 }
}
  
  txphase(two); dec2phase(t6);

  sim3pulse(pw,0.0e-6,pwN,two,zero,t6,0.0,0.0);
  txphase(t4);
  decoffset(dof);
  decpwrf(rfst);

/* mixing time */ 
  
   zgradpulse(gzlvl2,gt2);  
   delay(gstab);    
  if(mix -gstab - 4.0*GRADIENT_DELAY - gt2> 0.0)
  {
   if (gzlvlm>0.0)
   {
     zgradpulse( gzlvlm, mix-gt2-gstab);
   }
   else
    delay(mix-gt2-gstab);
  }
  
/* HN INEPT */

  rgpulse(pw,t4,0.0,0.0);  
  txphase(one);    
  zgradpulse(gzlvl3,gt3);
  delay(tauNH - pwN- gt3);               /* delay=1/4J(NH)   */

  sim3pulse(2.0*pw,0.0e-6,2*pwN,one,zero,zero,0.0,0.0);

  dec2phase(t1);
  zgradpulse(gzlvl3,gt3);
  delay(tauNH - pwN -gt3);               /* delay=1/4J(NH)   */
  
  sim3pulse(pw,0.0e-6,pwN,one,zero,t1,0.0,0.0);

  txphase(t2);  
  
/*  evolution of t1  */

 if ( (C13refoc[A]=='y') && (tau1 > 0.5e-3 + WFG2_START_DELAY) )
    {
     delay(2.0e-6);
     zgradpulse(gzlvld, tau1 - 4.0e-6 - 2.0*GRADIENT_DELAY- 0.5e-3 - WFG2_START_DELAY);
     delay(2.0e-6);
     decshaped_pulse("stC200", 1.0e-3, zero, 0.0, 0.0);
     delay(2.0e-6);
     zgradpulse(-gzlvld, tau1 - 4.0e-6 - 2.0*GRADIENT_DELAY- 0.5e-3 );
     delay(2.0e-6);
    }
 else if (tau1 - 3.0e-6 - 2.0*GRADIENT_DELAY>0 )
    {  
     delay(2.0e-6);
     zgradpulse(gzlvld, tau1 - 11.0e-6 - 2.0*GRADIENT_DELAY);
     delay(2.0e-5);
     zgradpulse(-gzlvld, tau1 - 11.0e-6 - 2.0*GRADIENT_DELAY);
     delay(2.0e-6);
    }

/* ST2PT   */

  rgpulse(pw,t2,0.0,0.0);

  txphase(zero);
  zgradpulse(gzlvl4,gt4);
  delay(tauNH - pwN - gt4);               /* delay=1/4J(NH)   */

  sim3pulse(2.0*pw,0.0e-6,2*pwN,zero,zero,zero,0.0,0.0);

  dec2phase(t2);
  zgradpulse(gzlvl4,gt4);
  delay(tauNH - pwN  - gt4);               /* delay=1/4J(NH)   */

  sim3pulse(pw,0.0e-6,pwN,zero,zero,t2,0.0,0.0);

/*  watergate   */

  zgradpulse(gzlvl5,gt5);
 
  delay(tauNH-pwN-gt5-pwHs-4.0e-6-PRG_START_DELAY);
  dec2phase(zero);     

   	obspower(tpwrs); obspwrf(tpwrsf); txphase(two);
   	shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 2.0e-6);
  	obspower(tpwr); obspwrf(4095.0);
  	txphase(zero); 
 
  sim3pulse(2.0*pw,0.0e-6,2*pwN,zero,zero,zero,0.0,0.0);

   	obspower(tpwrs); txphase(two); obspwrf(tpwrsf);
   	shaped_pulse("H2Osinc", pwHs, two, 2.0e-6 ,2.0e-6);
  	obspower(tpwr); obspwrf(4095.0);
  	txphase(zero); 
 
  zgradpulse(gzlvl5,gt5);
  delay(tauNH-pwN-gt5-pwHs-4.0e-6-PRG_START_DELAY);     

  dec2rgpulse(pwN,zero,0.0,0.0);
  dec2power(dpwr2);


/* acquire data */

status(C);
     setreceiver(t14);
}
Пример #3
0
pulsesequence()
{
/* DECLARE VARIABLES */

 char	f1180[MAXSTR],
	C13refoc[MAXSTR],
	wtg3919[MAXSTR];
             
 int	t1_counter;

 double 
        tofHN = 0.0,
    
        tau1,				/* t1/2  */
  	taua = getval("taua"),		/* 2.25ms  */

        pwN = getval("pwN"),		/* PW90 for N-nuc            */
        pwNlvl = getval("pwNlvl"),	/* power level for N hard pulses */

        pwC = getval("pwC"),		/* PW90 for N-nuc            */
        pwClvl = getval("pwClvl"),	/* power level for N hard pulses */

        relaxT = getval("relaxT"),      /* total time for NOE measuring     */
	ncyc = 0,			/* number of pulsed cycles in relaxT */

        compH = getval("compH"),
   	pwHs = getval("pwHs"),	        /* H1 90 degree pulse length at tpwrs */
   	tpwrs,				/* power for the pwHs ("H2Osinc") pulse */
        tpwrsf_a = getval("tpwrsf_a"),  /* fine power for the pwHs ("H2Osinc") pulse */
        tpwrsf_u = getval("tpwrsf_u"),  /* fine power for the pwHs ("H2Osinc") pulse */
        tpwrsf_d = getval("tpwrsf_d"),  /* fine power for the pwHs ("H2Osinc") pulse */
        phincr_a = getval("phincr_a"),  /* fine power for the pwHs ("H2Osinc") pulse */
        phincr_u = getval("phincr_u"),  /* fine power for the pwHs ("H2Osinc") pulse */
        phincr_d = getval("phincr_d"),  /* fine power for the pwHs ("H2Osinc") pulse */

        d3919 = getval("d3919"),
        pwHs_dly,
        wtg_dly,

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


/* LOAD VARIABLES */

    getstr("f1180",f1180);
    getstr("wtg3919",wtg3919);
    getstr("C13refoc",C13refoc);

    if (find("tofHN")>1) tofHN=getval("tofHN");
    if (tofHN == 0.0) tofHN=tof;

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

    pwHs_dly = pwHs +WFG_START_DELAY +2.0e-6 +2.0*POWER_DELAY +2.0*SAPS_DELAY;
    if (tpwrsf_a < 4095.0) pwHs_dly = pwHs_dly +2.0*PWRF_DELAY; /* if one flipback is calibrated */
    if (phincr_a != 0.0) pwHs_dly = pwHs_dly +2.0*SAPS_DELAY;   /* so will probably be the others */

    if (wtg3919[0] != 'y')
	wtg_dly = pwHs_dly;
    else
	wtg_dly = pw*2.385 +7.0*rof1 +d3919*2.5 +SAPS_DELAY;



/* LOAD VARIABLES */

  assign(one,v11);
  assign(three,v12);

  settable(t2, 4, phi2);
  settable(t3, 1, phi3);
  settable(t10, 4, phi10);

  settable(t14, 4, rec);
  

/* Phase incrementation for hypercomplex data */

   if ( phase1 == 2 )     /* Hypercomplex in t1 */
     { ttadd(t14,t10,4); tsadd(t3,2,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(t2,2,4); tsadd(t14,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 phincr corrections  */
   if (phincr_a < 0.0)  phincr_a=phincr_a+360.0;
   if (phincr_u < 0.0)  phincr_u=phincr_u+360.0;
   if (phincr_d < 0.0)  phincr_d=phincr_d+360.0;

/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   obspower(tpwr); 
   decpower(pwClvl);
   dec2power(pwNlvl);

   txphase(zero);
   dec2phase(zero);

   obsstepsize(1.0);

   rcvroff();

   initval(ncyc+0.1,v10);  
   delay(1.0e-5);


/* destroy magnetization of proton and nitrogen   */


   rgpulse(pw,zero,0.0,0.0);

   initval(phincr_u,v14);
   txphase(two); if (phincr_u != 0) xmtrphase(v14);
   if (tpwrsf_u < 4095.0) { obspwrf(tpwrsf_u); obspower(tpwrs+6.0); }
     else obspower(tpwrs);
   shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 0.0);
   obspower(tpwr);
   if (tpwrsf_u < 4095.0) obspwrf(4095.0);
   txphase(t3); if (phincr_u != 0) xmtrphase(zero);

   dec2rgpulse(pwN, zero, 0.0, 0.0);
   zgradpulse(gzlvl0,gt0);
   dec2phase(one);
   delay(gstab);
   dec2rgpulse(pwN, one, 0.0, 0.0);
   zgradpulse(0.7*gzlvl0,gt0);
   dec2phase(zero);
   delay(gstab);

/*  Saturation of 1H to produce NOE  */

status(B);

    if (tofHN != tof) obsoffset(tofHN);
    delay(0.5e-5);

    if (relaxT < 1.0e-4 )
     {
      ncyc = (int)(200.0*d1 + 0.5);	/* no H1 saturation */
      initval(ncyc,v1);
      obspower(-15.0); obspwrf(0.0);	/* powers set to minimum, but amplifier is unblancked identically */
           loop(v1,v2);
                   delay(2.5e-3 - 4.0*compH*1.34*pw);
                   rgpulse(4.0*compH*1.34*pw, zero, 5.0e-6, 0.0e-6);
                   rgpulse(4.0*compH*1.34*pw, zero, 0.0e-6, 0.0e-6);
                   rgpulse(4.0*compH*1.34*pw, zero, 0.0e-6, 0.0e-6);
                   rgpulse(4.0*compH*1.34*pw, zero, 0.0e-6, 5.0e-6);
                   delay(2.5e-3 - 4.0*compH*1.34*pw);
           endloop(v2);
     }
    else
     {
      ncyc = (int)(200.0*relaxT + 0.5);	/* H1 saturation */
      initval(ncyc,v1);
      if (ncyc > 0)
          {
           obspower(tpwr-12);
           loop(v1,v2);
           delay(2.5e-3 - 4.0*compH*1.34*pw);
           rgpulse(4.0*compH*1.34*pw, zero, 5.0e-6, 0.0e-6);
           rgpulse(4.0*compH*1.34*pw, zero, 0.0e-6, 0.0e-6);
           rgpulse(4.0*compH*1.34*pw, zero, 0.0e-6, 0.0e-6);
           rgpulse(4.0*compH*1.34*pw, zero, 0.0e-6, 5.0e-6);
           delay(2.5e-3 - 4.0*compH*1.34*pw);
           endloop(v2);
          }
      }
   obspower(tpwr); obspwrf(4095.0);

   if (tofHN != tof) obsoffset(tof);

/* two spin state mixing */

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

  rgpulse(pw,zero,0.0,0.0);

  initval(phincr_u,v14);
  txphase(two); if (phincr_u != 0) xmtrphase(v14);
  if (tpwrsf_u < 4095.0) { obspwrf(tpwrsf_u); obspower(tpwrs+6.0); }
    else obspower(tpwrs);
  shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 0.0);
  obspower(tpwr);
  if (tpwrsf_u < 4095.0) obspwrf(4095.0);
  txphase(t3); if (phincr_u != 0) xmtrphase(zero);
              
  zgradpulse(gzlvl3,gt3);
  delay(gstab);   

/*********************************************/
/*  inept of 15N and 1H and evolution of t1  */
/*********************************************/

  dec2rgpulse(pwN,t2,0.0,0.0);
/* H1 EVOLUTION BEGINS */
 
  txphase(t3); dec2phase(zero);
  if (C13refoc[A]=='y' && (tau1 -2.0*pwC -3.0*SAPS_DELAY) > 0.2e-6)
    {
     delay(tau1 -2.0*pwC -3.0*SAPS_DELAY);

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

     delay(tau1 -2.0*pwC -SAPS_DELAY);
    }
  else if (2.0*tau1 -2.0*SAPS_DELAY > 0.2e-6)
     delay(2.0*tau1 -2.0*SAPS_DELAY);
  
/* H1 EVOLUTION ENDS */
  rgpulse(pw, t3, 0.0, 0.0);

  initval(phincr_a,v14);
  if (phincr_a != 0) xmtrphase(v14);
  if (tpwrsf_a < 4095.0) { obspwrf(tpwrsf_a); obspower(tpwrs+6.0); }
    else obspower(tpwrs);
  shaped_pulse("H2Osinc", pwHs, t3, 2.0e-6, 0.0);
  obspower(tpwr);
  if (tpwrsf_a < 4095.0) obspwrf(4095.0);
  txphase(zero); if (phincr_a != 0) xmtrphase(zero);

  zgradpulse(gzlvl4,gt4);
  delay(taua -pwN -0.5*pw -gt4 -2.0*GRADIENT_DELAY -pwHs_dly);		/* delay=1/4J(NH)   */

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

  dec2phase(t3);
  zgradpulse(gzlvl4,gt4);
  delay(taua -1.5*pwN -gt4 -2.0*GRADIENT_DELAY -pwHs_dly);		/* delay=1/4J(NH)   */
 
  initval(phincr_d,v14);
  txphase(two); if (phincr_d != 0) xmtrphase(v14);
  if (tpwrsf_d < 4095.0) { obspwrf(tpwrsf_d); obspower(tpwrs+6.0); }
    else obspower(tpwrs);
  shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 0.0);
  obspower(tpwr);
  if (tpwrsf_d < 4095.0) obspwrf(4095.0);
  txphase(zero); if (phincr_d != 0) xmtrphase(zero);

  sim3pulse(pw, 0.0, pwN, zero, zero, t3, rof1, rof1);

  dec2phase(zero);     
  zgradpulse(gzlvl5,gt5);
  delay(taua -1.5*pwN -wtg_dly -gt5 -2.0*GRADIENT_DELAY);

     if(wtg3919[0] == 'y')		/*  3919 watergate   */
     {
       txphase(v11);
       rgpulse(pw*0.231,v11,rof1,rof1);
       delay(d3919);
       rgpulse(pw*0.692,v11,rof1,rof1);
       delay(d3919);
       rgpulse(pw*1.462,v11,rof1,rof1);

       delay(d3919/2.0-pwN);
       dec2rgpulse(2.0*pwN, zero, rof1, rof1);
       txphase(v12);
       delay(d3919/2.0-pwN);

       rgpulse(pw*1.462,v12,rof1,rof1);
       delay(d3919);
       rgpulse(pw*0.692,v12,rof1,rof1);
       delay(d3919);
       rgpulse(pw*0.231,v12,rof1,rof1);
     }
     else				/*  soft pulse watergate   */
     {
       initval(phincr_d,v14);
       txphase(two); if (phincr_d != 0) xmtrphase(v14);
       if (tpwrsf_d < 4095.0) { obspwrf(tpwrsf_d); obspower(tpwrs+6.0); }
       obspower(tpwrs);
       shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 0.0);
       obspower(tpwr);
       if (tpwrsf_d < 4095.0) obspwrf(4095.0);
       txphase(zero); if (phincr_d != 0) xmtrphase(zero);

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

       initval(phincr_u,v14);
       txphase(two); if (phincr_u != 0) xmtrphase(v14);
       if (tpwrsf_u < 4095.0) { obspwrf(tpwrsf_u); obspower(tpwrs+6.0); }
       obspower(tpwrs);
       shaped_pulse("H2Osinc", pwHs, two, 2.0e-6, 0.0);
       obspower(tpwr);
       if (tpwrsf_u < 4095.0) obspwrf(4095.0);
       txphase(zero); if (phincr_u != 0) xmtrphase(zero);
     }

  zgradpulse(gzlvl5,gt5);
  delay(taua -1.5*pwN -wtg_dly -gt5 -2.0*GRADIENT_DELAY);

  dec2rgpulse(pwN,zero,0.0,0.0);

/* acquire data */

  rcvron();
status(C);
  setreceiver(t14);
}
Пример #4
0
pulsesequence() {

// Define Variables and Objects and Get Parameter Values

   double aXxyxy8 = getval("aXxyxy8");
   double aYxyxy8 = getval("aYxyxy8");
   double pwXxyxy8 = getval("pwXxyxy8");
   double pwYxyxy8 = getval("pwYxyxy8");
   double nXYxy8 = getval("nXYxy8");
   int counter = nXYxy8;
   initval(nXYxy8,v8);
   double fXYxy8 = getval("fXYxy8");
   double onYxyxy8 = getval("onYxyxy8");
   double srate = getval("srate");

   DSEQ dec = getdseq("H");
   strncpy(dec.t.ch,"dec",3);
   putCmd("chHtppm='dec'\n"); 
   strncpy(dec.s.ch,"dec",3);
   putCmd("chHspinal='dec'\n");

   DSEQ mix = getdseq("Hmix");
   strncpy(mix.t.ch,"dec",3);
   putCmd("chHmixtppm='dec'\n");
   strncpy(dec.s.ch,"dec",3);
   putCmd("chHmixspinal='dec'\n");

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

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

// Dutycycle Protection

   DUTY d = init_dutycycle();
   d.dutyon = getval("pwX90") + nXYxy8*(pwXxyxy8 + pwYxyxy8);
   d.dutyoff = d1 + 4.0e-6;
   d.c1 = d.c1 + (!strcmp(dec.seq,"tppm"));
   d.c1 = d.c1 + ((!strcmp(dec.seq,"tppm")) && (dec.t.a > 0.0));
   d.t1 = getval("rd") + getval("ad") + at;
   d.c2 = d.c2 + (!strcmp(dec.seq,"spinal"));
   d.c2 = d.c2 + ((!strcmp(dec.seq,"spinal")) && (dec.s.a > 0.0));
   d.t2 = getval("rd") + getval("ad") + at;
   d.c3 = d.c3 + (!strcmp(mix.seq,"tppm"));
   d.c3 = d.c3 + ((!strcmp(mix.seq,"tppm")) && (mix.t.a > 0.0));
   d.t3 = nXYxy8*(1.0/srate - pwXxyxy8 - pwYxyxy8);
   d.c4 = d.c4 + (!strcmp(mix.seq,"spinal"));
   d.c4 = d.c4 + ((!strcmp(mix.seq,"spinal")) && (mix.s.a > 0.0));
   d.t4 = nXYxy8*(1.0/srate - pwXxyxy8 - pwYxyxy8);
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   settable(phX90,4,table1);
   settable(phXYxy8,8,table2);
   settable(phXxyxy8,4,table3);
   settable(phYxyxy8,4,table4);
   settable(phRec,4,table5);
   settable(ph1Rec,4,table6);
   settable(ph2Rec,4,table7);
   settable(ph3Rec,4,table8);
   int tix = counter%8;

   if ((tix == 1) || (tix == 7)) ttadd(phRec,ph1Rec,4);
   if ((tix == 2) || (tix == 6)) ttadd(phRec,ph2Rec,4);
   if ((tix == 3) || (tix == 5)) ttadd(phRec,ph3Rec,4);
   setreceiver(phRec);

// Begin Sequence

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

// X Direct Polarization

   rgpulse(getval("pwX90"),phX90,0.0,0.0);

// xy8XY Period

   if (counter > 0) {
      _dseqon(mix);
      delay(pwXxyxy8/2.0);
      obspwrf(aXxyxy8); dec2pwrf(aYxyxy8);
      sub(v1,v1,v1);
      if (counter >= 1) {
         loop(v8,v9);
	    getelem(phXYxy8,v1,v4);
	    incr(v1);
	    getelem(phXxyxy8,ct,v2);
	    getelem(phYxyxy8,ct,v3);
	    add(v4,v2,v2);
	    add(v4,v3,v3);
	    txphase(v2); dec2phase(v3);
	    delay((1.0 - fXYxy8)/srate - pwYxyxy8/2.0 - pwXxyxy8/2.0);
	    if (onYxyxy8 == 2)
               dec2rgpulse(pwYxyxy8,v3,0.0,0.0);
            else
               delay(pwYxyxy8);
	    delay(fXYxy8/srate - pwYxyxy8/2.0 - pwXxyxy8/2.0);
	    rgpulse(pwXxyxy8,v2,0.0,0.0);
	 endloop(v9);
	 delay(1.0/srate - pwXxyxy8/2.0);
      }
      _dseqoff(mix);
   }

// Begin Acquisition

   _dseqon(dec);
   obsblank(); _blank34();
   delay(getval("rd"));
   startacq(getval("ad"));
   acquire(np, 1/sw);
   endacq();
   _dseqoff(dec);
   obsunblank(); decunblank(); _unblank34();
}