Exemple #1
0
pulsesequence()
{
  char    mixpat[MAXSTR], pshape[MAXSTR], httype[MAXSTR], sspul[MAXSTR];
  double  rg1	= 2.0e-6,
          mix	= getval("mix"),	/* mixing time */
	  mixpwr = getval("mixpwr"),	/* mixing pwr */
	  compH  = getval("compH"),
	  gt0    = getval("gt0"),	/* gradient pulse in sspul */
	  gt2    = getval("gt2"),	/* gradient pulse preceding mixing */
	  gzlvl0 = getval("gzlvl0"),	/* gradient level for gt0 */
	  gzlvl2 = getval("gzlvl2"),	/* gradient level for gt2 */
	  gstab  = getval("gstab");	/* delay for gradient recovery */
  shape   hdx;
  void    setphases();

  getstr("sspul", sspul);
  getstr("pshape", pshape);
  getstr("httype", httype);
  getstr("mixpat", mixpat);
  setlimit("mixpwr", mixpwr, 48.0);

  (void) setphases();
  if (httype[0] == 'i')
    assign(zero,v2);

  /* MAKE PBOX SHAPES */

  if (FIRST_FID)
    hhmix = pbox_mix("HHmix", mixpat, mixpwr, pw*compH, tpwr);

  /* HADAMARD stuff */
  if(httype[0] == 'e')                           /* excitation */
    hdx = pboxHT_F1e(pshape, pw*compH, tpwr);
  else if(httype[0] == 'r')                      /* refocusing */
    hdx = pboxHT_F1r(pshape, pw*compH, tpwr);
  else if(httype[0] == 'd')                      /* DPFGSE */
  {
    hdx = pboxHT_F1r(pshape, pw*compH, tpwr);
    if (FIRST_FID)
      ref180 = hdx;
  }
  else /* httype[0] == 'i' */                    /* inversion */
    hdx = pboxHT_F1i(pshape, pw*compH, tpwr);

  if (getval("htcal1") > 0.5)          /* Optional fine power calibration */
    hdx.pwr += getval("htpwr1");

 /* THE PULSE PROGRAMM STARTS HERE */

  status(A);


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

    pre_sat();
      
    if (getflag("wet"))
      wet4(zero,one);
      
    delay(1.0e-5);

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

  status(B);

    if (httype[0] == 'i')           /* longitudinal encoding */
    {
      ifzero(v1);
        delay(2.0*(pw+rg1));
        zgradpulse(gzlvl2,gt2);
        delay(gstab);
      elsenz(v1);
        rgpulse(2.0*pw,v3,rg1,rg1);
        zgradpulse(gzlvl2,gt2);
        delay(gstab);
      endif(v1);

      pbox_pulse(&hdx, zero, rg1, rg1);
      zgradpulse(gzlvl2,gt2);
      delay(gstab);
    }
    else                            /* transverse encoding */
    {
      if (httype[0] == 'e')
        pbox_pulse(&hdx, oph, rg1, rg1);
      else
      {
        rgpulse(pw,oph,rg1,rg1);
        if (httype[0] == 'd')       /* DPFGSE */
        {
          zgradpulse(2.0*gzlvl2,gt2);
          delay(gstab);
          pbox_pulse(&ref180, oph, rg1, rg1);
          zgradpulse(2.0*gzlvl2,gt2);
          delay(gstab);
        }
        zgradpulse(gzlvl2,gt2);
        delay(gstab);
        pbox_pulse(&hdx, v2, rg1, rof2);
        zgradpulse(gzlvl2,gt2);
        delay(gstab - POWER_DELAY);
      }
    }

    if (mix)
      pbox_spinlock(&hhmix, mix, v2);

    if (httype[0] == 'i')
    {
      zgradpulse(0.87*gzlvl2,gt2);
      delay(gstab);
      obspower(tpwr);
      txphase(v3);
      rgpulse(pw,v3,rg1,rof2);
    }

  status(C);
}
Exemple #2
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);
}
Exemple #3
0
pulsesequence()
{
  char    pshape[MAXSTR], httype[MAXSTR];
  int     Hdim    = (int) (0.5 + getval("Hdim")); /* dimension for testing */
  double  rg1	  = 2.0e-6,
          compH   = getval("compH"),	/* compression factor for H-1 channel */
	  gt0     = getval("gt0"),	/* gradient pulse preceding d1 */
	  gt1     = getval("gt1"),	/* gradient pulse preceding mixing */
	  gt2     = getval("gt2"),	/* gradient pulse following mixing */
	  gzlvl0  = getval("gzlvl0"),	/* gradient level for gt1 */
	  gzlvl1  = getval("gzlvl1"),	/* gradient level for gt2 */
	  gzlvl2  = getval("gzlvl2"),	/* gradient level for gt3 */
	  gstab   = getval("gstab");	/* delay for gradient recovery */

  shape   hdx;

  getstr("pshape", pshape);
  getstr("httype", httype);
  add(one,oph,v1);
  
  /* MAKE PBOX SHAPES */

  if(Hdim == 0)
    hdx = pboxHT(pshape, pw*compH, tpwr, httype[0]); /* HADAMARD stuff */
  else /* if(Hdim == 1) */
    hdx = pboxHT_F1(pshape, pw*compH, tpwr, httype[0]);

/* Optional stuff to enable manual power calibration */

  if ((Hdim == 0) && (getval("htcal") > 0.5)) hdx.pwr = getval("htpwr");
  if ((Hdim == 1) && (getval("htcal1") > 0.5)) hdx.pwr = getval("htpwr1");

/* THE PULSE PROGRAMM STARTS HERE */

  status(A);
    delay(1.0e-4);
    zgradpulse(gzlvl0,gt0);

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

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

  status(B);

    if ((httype[0] == 'i') || (httype[0] == 's'))  /* inversion and sequential inversion */
    {
      pbox_pulse(&hdx, zero, rof1, rof1);
      zgradpulse(gzlvl2,gt2);
      obspower(tpwr);
      delay(gstab);
      rgpulse(pw,oph,rg1,rof2);
    }
    else if (httype[0] == 'r')              /* gradient echo */
    {
      obspower(tpwr);
      rgpulse(pw,oph,rg1,rg1);
      zgradpulse(gzlvl1,gt1);
      delay(gstab);
      pbox_pulse(&hdx, oph, rg1, rof2);
      zgradpulse(gzlvl1,gt1);
      delay(gstab);
    }
    else /* if (httype[0] == 'e') */        /* selective excitation */
      pbox_pulse(&hdx, oph, rof1, rof1);

  status(C);
}
Exemple #4
0
void pulsesequence()
{
	double	gzlvl0 = getval("gzlvl0"),
		gzlvl1 = getval("gzlvl1"),
		gzlvl2 = getval("gzlvl2"),
		gt0 = getval("gt0"),
		gt1 = getval("gt1"),
		gstab = getval("gstab"),
		compH = getval("compH");
	char	sspul[MAXSTR], pshape[MAXSTR];
	int	iphase;
        shape  hdx;

	getstr("sspul",sspul);
	iphase = (int)(getval("phase")+0.5);

  /* Make HADAMARD encoding waveforms */
  
        getstr("pshape", pshape);
        hdx = pboxHT_F1e(pshape, pw*compH, tpwr);

  /* Setup Phase Cycling */

	settable(t1,8,ph1);
	settable(t2,8,ph2);
	settable(t3,8,ph3);

	getelem(t1,ct,v1);
	getelem(t2,ct,v2);
	getelem(t3,ct,oph);

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

  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);

        obspower(tpwr);
      
  status(B);

       pbox_pulse(&hdx, v1, rof1, 2.0e-6);
       obspower(tpwr);

       rgpulse(pw, v2, 2.0e-6, rof1);
       delay(gt1 + gstab + 2*GRADIENT_DELAY);
       rgpulse(2*pw, v2, rof1, rof1);
       zgradpulse(-gzlvl1,gt1);
       delay(gstab);
       rgpulse(pw, v2, rof1, rof2);
       zgradpulse(gzlvl2,gt1);
       delay(gstab - 2*GRADIENT_DELAY);

  status(C);
}
Exemple #5
0
pulsesequence()
{
        double rg1 = 2.0e-6,
	       compH = getval("compH"),
	       gt0=getval("gt0"),
	       gzlvl0=getval("gzlvl0"),
	       gt1=getval("gt1"),
	       gzlvl1=getval("gzlvl1"),
	       qlvl=getval("qlvl"),
	       grise=getval("grise"),
	       gstab=getval("gstab"),
	       taud2=getval("taud2"),
	       tau1=getval("tau1");
	int    icosel, iphase;
        char   pshape[MAXSTR], xptype[MAXSTR];
        shape  hdx;

  getstr("pshape", pshape);

  iphase = (int) (0.5 + getval("phase"));
  qlvl++ ; 
  icosel=1;    /* Default to N-type experiment */
  strcpy(xptype, "N-type");
  if (iphase == 2) 
  { 
    icosel=-1;
    strcpy(xptype, "P-type"); 
  }
  if (FIRST_FID) fprintf(stdout,"%s COSY\n", xptype);

  /* Make HADAMARD encoding waveforms */
  
    hdx = pboxHT_F1e(pshape, pw*compH, tpwr);

     status(A);
     
       delay(1.0e-4);
       zgradpulse(gzlvl0,gt0);

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

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

  status(B);

       pbox_pulse(&hdx, oph, rg1, rg1);
       obspower(tpwr);

       zgradpulse(gzlvl1,gt1);
       delay(grise); 
          
       rgpulse(pw, oph, rg1, rg1);
       delay(taud2);

       zgradpulse(gzlvl1,gt1);
       delay(grise+taud2); 

       rgpulse(pw,oph,rg1,rof2);
       delay(tau1);

       zgradpulse(gzlvl1*qlvl*(double)icosel,gt1);
       delay(grise+gstab); 

     status(C);
}