Exemplo n.º 1
0
pulsesequence()

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

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

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

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

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

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

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

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

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

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

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

status(A);
   obspower(tpwr);

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

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

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

   decpower(pwxlvl);

status(B);

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

     rgpulse(pw,v6,rof1,rof1);
     delay(tau);
     simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
     delay(tau);
     rgpulse(pw,v1,rof1,rof1);
	zgradpulse(hsglvl,2*hsgt);
	delay(1e-3);
     decrgpulse(pwx,v2,rof1,2.0e-6);
     
      delay(d2/2);
     rgpulse(2*pw,zero,2.0e-6,2.0e-6);
      delay(d2/2);
     zgradpulse(gzlvlE,gtE);
     delay(taug - gtE - 2*GRADIENT_DELAY);
     simpulse(mult*pw,2*pwx,zero,zero,rof1,rof1);
     delay(taug + evolcorr); 
     
     decrgpulse(pwx,v4,2.0e-6,rof1);
	zgradpulse(ZZgsign*0.6*hsglvl,1.2*hsgt);
	delay(1e-3);
     rgpulse(pw,v3,rof1,rof1);
     delay(tau - (2*pw/PI) - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof2);
     decpower(dpwr);
     zgradpulse(icosel*2.0*gzlvlE/EDratio,gtE/2.0);
     delay(tau - gtE/2.0 - 2*GRADIENT_DELAY - POWER_DELAY);
   status(C);
}
Exemplo n.º 2
0
void pulsesequence()
{

  double j1min = getval("j1min"),
         j1max = getval("j1max"),
         pwx180 = getval("pwx180"),
         pwxlvl180 = getval("pwxlvl180"),
         pwx180r = getval("pwx180r"),
         pwxlvl180r = getval("pwxlvl180r"),
         mult = getval("mult"),
         gzlvl0 = getval("gzlvl0"),
         gt0 = getval("gt0"),
         gzlvlE = getval("gzlvlE"),
         gtE = getval("gtE"),
         EDratio = getval("EDratio"),
         gstab = getval("gstab"),
	 tauA,
         tauB,
         tau,
         taumb,
         taug,
         grad1,
         grad2,
         grad3,
         grad4;

  char   pwx180ad[MAXSTR], 
         pwx180ref[MAXSTR];

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

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

  getstr("pwx180ad", pwx180ad);
  getstr("pwx180ref", pwx180ref);

  tauA = 1/(2*(j1min + 0.146*(j1max - j1min)));
  tauB = 1/(2*(j1max - 0.146*(j1max - j1min)));
  tau = 1/(j1max + j1min);
  taumb = 1 / (2 * (getval("jnxh")));

  taug = tau + getval("tauC");

  icosel = 1;

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

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

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

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

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

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

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

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

  grad2 = gzlvlE;
  grad3 = -1.5*gzlvlE;
  grad1 = -1.0*grad2*(EDratio + icosel)/EDratio;
  grad4 = -1.0*grad3*(EDratio - icosel)/EDratio;

  if (mult > 0.5)
  {
    grad4 = -1.0*grad3*(EDratio + icosel)/EDratio;
  }

  status(A);

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

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

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

   obspower(tpwr);
   decpower(pwxlvl);

  status(B);

   if (getflag("cpmgflg"))
   {
     rgpulse(pw, v6, rof1, 0.0);
     cpmg(v6, v15);
   }
   else
     rgpulse(pw, v6, rof1, rof2);

/* Start of J filter  */

   if (getflag("jfilter"))
   {
     zgradpulse(gzlvl0,gt0);
     delay(tauA - gt0);
     decrgpulse(pwx, zero, rof1, rof1);
     zgradpulse(-gzlvl0*2/3,gt0);
     delay(tauB - gt0);
     decrgpulse(pwx, zero, rof1, rof1);
     zgradpulse(-gzlvl0/3,gt0);
    }

/* End of J filter */

    delay(taumb);

    zgradpulse(grad1,gtE);
    delay(gstab);

    decrgpulse(pwx, v2, rof1, rof1);

    if (mult > 0.5)
    {
    decpower(pwxlvl180r);
    zgradpulse(grad2,gtE);
    delay(taug-gtE-2*GRADIENT_DELAY);
    decshaped_pulse(pwx180ref, pwx180r, zero, rof1, rof1);

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

    delay(taug-(gtE+gstab+2*GRADIENT_DELAY)+(4*pwx/PI+2*rof1+2*POWER_DELAY-2*pw-2*rof1));
    zgradpulse(grad3,gtE);
    delay(gstab);
    decshaped_pulse(pwx180ref, pwx180r, zero, rof1, rof1);
    }

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

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

    delay(taug/2+(pwx180r-pwx180)/2.0+(4*pwx/PI+2*rof1+2*POWER_DELAY-2*pw-2*rof1));
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    delay(taug/2+(pwx180r-pwx180)/2-gtE-gstab-2*GRADIENT_DELAY);
    zgradpulse(grad3,gtE);
    delay(gstab);
    }

    decpower(pwxlvl);

    decrgpulse(pwx, v1, rof1, rof2);
    decpower(dpwr);
    zgradpulse(grad4,gtE);
    delay(gstab);

  status(C);
}
Exemplo n.º 3
0
pulsesequence()
{   
   int	phase1 = (int)(getval("phase")+0.5),
  	prgcycle=(int)(getval("prgcycle")+0.5);


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

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

/* CONSTANTS FOR PHASE CALCULATIONS */
    initval( 8.0,v13);
    initval( 32.0,v12);
    initval( 20.0,v11);
    initval( 192.0,v10);

/* CALCULATE PHASECYCLE */
   assign(zero,v14);	/* phase of first pulse */
   mod2(v17,v1);
   dbl(v1,v1);		/* 0202 */
			/* even/odd flag */
   hlv(v17,v2);
   hlv(v2,v3);
   dbl(v3,v3);		/* 0000222244446666 */
			/* phase for transients 3 + 4*n */
			/* 1+4*n = 0 */
   mod2(v2,v2);		/* 0011 */
			/* switch for pairs */
   assign(v13,v4);	/* 8 */
   ifzero(v2);
      incr(v4);
   elsenz(v2);
      decr(v4);
   endif(v2);
   modn(v4,v13,v4);	/* 1177 */
			/* standard phases for even transients */
			/*      1 for 2+4*n, 7 for 4*n         */
   hlv(v13,v8);		/* 4 */
   add(v17,v8,v5);	/* (ct+4) */
   divn(v5,v12,v5);	/* (ct+4)/32 */
   divn(v17,v12,v6);	/* ct/32 */
   sub(v5,v6,v5);	/* ((ct+4)/32-ct/32 */
			/* 00000000 00000000 00000000 00001111 */
   add(v17,v11,v6);	/* (ct+20) */
   divn(v6,v10,v6);	/* (ct+20)/192 */
   sub(v11,v7,v7);	/* 16 */
   add(v17,v7,v7);	/* (ct+16) */
   divn(v7,v10,v7);	/* (ct+16)/192 */
   add(v5,v6,v5);
   sub(v5,v7,v5);	/* ((ct+4)/32-ct/32)+((ct+20)/192-(ct+16)/192) */
                        /* flag for exceptions on even transients */
   dbl(v2,v6);		/* 0022 */
   add(v6,three,v6);	/* 3355 */
   ifzero(v1);		/* for odd transients */
      ifzero(v2);       /* 1+4n:                             */
         assign(zero,v3);             /* 0xxx 0xxx 0xxx 0xxx */
      endif(v2);        /* 3+4n:         xx0x xx2x xx4x xx6x */
   elsenz(v1);		/* for even transients */
      ifzero(v5);	/* normal case:        */
         assign(v4,v3); /*                x1x7 */
      elsenz(v5);	/* exceptions:         */
         assign(v6,v3); /*                x3x5 */
      endif(v5);	/* v3 = phase of first and second pulse */
			/*      in 45 degrees steps:            */
                        /* 01070127 01470167 01070127 01470365  */
                        /* 01070127 01470167 01070127 01470365  */
                        /* 01070127 01470167 01070127 01470365  */
                        /* 01070127 01470167 01070127 01470365  */
                        /* 01070127 01470167 01070127 01470365  */
                        /* 01070127 01470365 01070127 01470365  */
   endif(v1);
   assign(two,v4);	/* v4 = phase of last 90 degrees pulse */
   assign(v1,oph);	/* oph = 0202 */

   assign(zero,v20);
  if (getflag("prgflg") && (satmode[0] == 'y'))
        assign(v14,v20);
  add(oph,v18,oph);
  add(oph,v19,oph);

   if (phase1 == 2) 
	incr(v14); /* States - Habercorn */

/*
      mod2(id2,v9);
      dbl(v9,v9);
*/
	initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v9);

      add(v14,v9,v14);
      add(oph,v9,oph);
 
/* BEGIN ACTUAL PULSE SEQUENCE CODE */
   status(A);

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

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

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

   status(B);
      xmtrphase(v3);
      rgpulse(pw, v14, rof1, 2.0e-6);
      if (d2 > 0.0)
         delay(d2 - (4.0*pw/PI) - 4.0e-6);
      else
	delay(d2);
      rgpulse(pw, zero, 2.0e-6, rof1);
      xmtrphase(zero);
      rgpulse(pw, v4, rof1, rof2);
   status(C);
} 
Exemplo n.º 4
0
pulsesequence()
{
   double  gzlvl1 = getval("gzlvl1"),
              gt1 = getval("gt1"),
           zqfpw1 = getval("zqfpw1"),
          zqfpwr1 = getval("zqfpwr1"),
         gzlvlzq1 = getval("gzlvlzq1"),
	    gstab = getval("gstab"),
     h1freq_local = getval("h1freq_local"),
            flip1 = getval("flip1"),
            flip2 = getval("flip2"),
         swfactor = 9.0,    /* do the adiabatic sweep over 9.0*sw  */
         gzlvlzq,invsw;
   int     iphase = (int) (getval("phase") + 0.5),
	 prgcycle = (int)(getval("prgcycle")+0.5);
   char		   satmode[MAXSTR],
		   zqfpat1[MAXSTR],
		   wet[MAXSTR],
		   antiz_flg[MAXSTR],
		   alt_grd[MAXSTR];
           

   getstr("satmode",satmode);
   getstr("wet",wet);
   getstr("zqfpat1",zqfpat1);
   getstr("antiz_flg", antiz_flg);
   getstr("alt_grd",alt_grd);

   invsw = sw*swfactor;
   if (invsw > 60000.0) invsw = 60000.0; /* do not exceed 60 kHz */
   invsw = invsw/0.97;     /* correct for end effects of the cawurst-20 shape */

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

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

//   sub(ct,ssctr,v12);
   settable(t1,8,ph1);  getelem(t1,v17,v1);
   settable(t2,8,ph2);  getelem(t2,v17,v2);
   settable(t3,8,ph3);  getelem(t3,v17,v3);
   settable(t4,8,ph4);  getelem(t4,v17,oph);

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

   if (alt_grd[0] == 'y') mod2(ct,v8); /* alternate gradient sign */
   if (getflag("Gzqfilt")) add(oph,two,oph);
   if (iphase == 2) incr(v1);

/* HYPERCOMPLEX MODE USES REDFIELD TRICK TO MOVE AXIAL PEAKS TO EDGE */
   initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v6);
   if ((iphase==1)||(iphase==2))
      {add(v1,v6,v1); add(oph,v6,oph);}

/* BEGIN THE ACTUAL PULSE SEQUENCE */
   status(A);
   delay(5.0e-5);
   if (getflag("sspul"))
        steadystate();

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

	else
	     {
        	satpulse(satdly,v6,rof1,rof1);
		if (getflag("prgflg"))
		   purge(v1,v6,v18,v19);
	     }
     }
   else
        delay(d1);

   if (wet[0] == 'y')
     wet4(zero,one);

      obsstepsize(45.0);
      initval(7.0,v7);
      xmtrphase(v7);
   status(B);
      if (antiz_flg[0] == 'n') rgpulse(flip1*pw/90.0,v1,rof1,1.0e-6);
                         else rgpulse(flip1*pw/90.0+2.0*pw,v1,rof1,1.0e-6);
      xmtrphase(zero);
      if (d2 > 0.0)
        {
         if (antiz_flg[0] == 'n') 
           delay(d2-1.0e-6-rof1-SAPS_DELAY-(2.0*pw/3.14159)*(flip1+flip2)/90.0);
         else
           delay(d2-1.0e-6-rof1-SAPS_DELAY-(2.0*pw/3.14159)*(flip1+flip2)/90.0+4.0*pw); 
        }
        else delay(0.0);
      if (antiz_flg[0] == 'n') rgpulse(flip2*pw/90.0,v2,rof1,1.0e-6);
                         else rgpulse(flip2*pw/90.0+2.0*pw,v2,rof1,1.0e-6);
   status(C);
        if (getflag("Gzqfilt"))
        {
         obspower(zqfpwr1);
         rgradient('z',gzlvlzq1);
         delay(100.0e-6);
         shaped_pulse(zqfpat1,zqfpw1,zero,rof1,rof1);
         delay(100.0e-6);
         rgradient('z',0.0);
         delay(gstab);
	 obspower(tpwr);
        }
        ifzero(v8); zgradpulse(gzlvl1,gt1);
              elsenz(v8); zgradpulse(-1.0*gzlvl1,gt1); endif(v8);
        delay(gstab);
   status(D);
      rgpulse(flip2*pw/90.0,v3,rof1,rof2);
}
Exemplo n.º 5
0
pulsesequence()
{
   double	   mixN = getval("mixN"),
		   gzlvlC = getval("gzlvlC"),
		   gtC = getval("gtC"),
		   gstab = getval("gstab"),
                   selpwrA = getval("selpwrA"),
                   selpwA = getval("selpwA"),
                   gzlvlA = getval("gzlvlA"),
                   gtA = getval("gtA"),
                   selpwrB = getval("selpwrB"),
                   selpwB = getval("selpwB"),
                   gzlvlB = getval("gzlvlB"),
                   gtB = getval("gtB"),
		   selfrq = getval("selfrq"),
		   zqfpw3 = getval("zqfpw3"),
		   zqfpwr3 = getval("zqfpwr3"),
		   gzlvlzq3 = getval("gzlvlzq3"),
		   mixNcorr,
		   sweeppw = getval("sweeppw"),
		   sweeppwr = getval("sweeppwr");
   char		   sweepshp[MAXSTR],
                   selshapeA[MAXSTR],
                   selshapeB[MAXSTR],
		   zqfpat3[MAXSTR];
  int 		   prgcycle=(int)(getval("prgcycle")+0.5);

//synchronize gradients to srate for probetype='nano'
//   Preserve gradient "area"
        gtC = syncGradTime("gtC","gzlvlC",1.0);
        gzlvlC = syncGradLvl("gtC","gzlvlC",1.0);
        gtA = syncGradTime("gtA","gzlvlA",1.0);
        gzlvlA = syncGradLvl("gtA","gzlvlA",1.0);
        gtB = syncGradTime("gtB","gzlvlB",1.0);
        gzlvlB = syncGradLvl("gtB","gzlvlB",1.0);

   getstr("sweepshp",sweepshp);
   getstr("selshapeA",selshapeA);
   getstr("selshapeB",selshapeB);
   getstr("zqfpat3",zqfpat3);

   mixNcorr=0.0;
   if (getflag("Gzqfilt"))
	mixNcorr=getval("zqfpw3");

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

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

   assign(zero,v16);
   if (getflag("STEP"))
     {
	mod2(v17,v16);
	hlv(v17,v17);
     }

   hlv(v17,v1); hlv(v1,v1); hlv(v1,v1); hlv(v1,v1); mod4(v1,v1);
   mod4(v17,v2); add(v1,v2,v2);
   hlv(v17,v3); hlv(v3,v3); mod4(v3,v3); add(v1,v3,v3); dbl(v3,v4);
   dbl(v2,oph); add(oph,v4,oph); add(oph,v1,oph);

   if (!getflag("NOE"))
	assign(v1,oph);
			/* if prgflg='n' the next two steps are non-events */
   add(oph,v18,oph);
   add(oph,v19,oph);
			/* if STEP='n', the next two steps are non-events */
   add(oph,v16,oph);
   add(oph,v16,oph);
   add(v1,v16,v16);	/*v16 is the phase of first echo pulse in steptrain */
			/* example: v1=0,0,2,2 v16=0,1,2,3 oph=0,2,2,0  - if STEP='y'*/
			/*	    v1=0,2 v16=0 oph=0,2 - if STEP='n' */


  if (getflag("prgflg") && (satmode[0] == 'y'))
        assign(v1,v6);

/* BEGIN THE ACTUAL PULSE SEQUENCE */
   status(A);
   obspower(tpwr);
   delay(5.0e-5);

   if (getflag("sspul"))
        steadystate();

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

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

   status(B);
	rgpulse(pw,v1,rof1,rof2);
   if (getflag("STEP"))
	steptrain(v1,v16);

   if (getflag("NOE"))
   {
      if (selfrq != tof)
        obsoffset(selfrq);

        zgradpulse(gzlvlA,gtA);
        delay(gstab);
        obspower(selpwrA);
        shaped_pulse(selshapeA,selpwA,v2,rof1,rof1);
        obspower(tpwr);
        zgradpulse(gzlvlA,gtA);
        delay(gstab);

      if (selfrq != tof)
        delay(2*OFFSET_DELAY);

        zgradpulse(gzlvlB,gtB);
        delay(gstab);
        obspower(selpwrB);
        shaped_pulse(selshapeB,selpwB,v3,rof1,rof1);
        obspower(tpwr);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);

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

      rgpulse(pw,v1,rof1,rof1);

        obspower(sweeppwr);
	delay(0.31*mixN);
	zgradpulse(gzlvlC,gtC);
	delay(gstab);
	shaped_pulse(sweepshp,sweeppw,zero,rof1,rof1);
	delay(gstab);
	zgradpulse(-gzlvlC,gtC);
	delay(0.49*mixN);
	zgradpulse(-gzlvlC,2*gtC);
	delay(gstab);
	if (getflag("Gzqfilt"))
	   {
                obspower(zqfpwr3);
                rgradient('z',gzlvlzq3);
                delay(100.0e-6);
                shaped_pulse(zqfpat3,zqfpw3,zero,rof1,rof1);
                delay(100.0e-6);
                rgradient('z',0.0);
	   }
	else
		shaped_pulse(sweepshp,sweeppw,zero,rof1,rof1);
	delay(gstab);
	zgradpulse(gzlvlC,2*gtC);
	delay(0.2*mixN);
	obspower(tpwr);

      rgpulse(pw,v1,rof1,rof2);
    }

   status(C);
}
Exemplo n.º 6
0
pulsesequence()
{

   double	   gtE = getval("gtE"),
		   gzlvlE=getval("gzlvlE"),
		   selpwrPS = getval("selpwrPS"),
		   selpwPS = getval("selpwPS"),
		   gzlvlPS = getval("gzlvlPS"),
		   droppts=getval("droppts"),
		   gstab = getval("gstab");
   int 		   prgcycle=(int)(getval("prgcycle")+0.5);
   char		   selshapePS[MAXSTR];

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

   getstr("selshapePS",selshapePS);

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

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

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

   getelem(t1,v17,v1);
   getelem(t2,v17,v2);
   getelem(t3,v17,v3);
   getelem(t4,v17,v4);
   assign(v4,oph);

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

/* BEGIN THE ACTUAL PULSE SEQUENCE */
   status(A);
      obspower(tpwr);

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

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

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


   status(B);
      obspower(tpwr);
      rgpulse(pw, v1, rof1, rof2);

	delay(d2/2.0);

	delay((0.25/sw1) - gtE - gstab - 2*pw/PI - rof2 - 2*GRADIENT_DELAY);
	zgradpulse(gzlvlE,gtE);
	delay(gstab);
	rgpulse(2*pw,v2,rof1,rof1);
	delay(0.25/sw1);

	delay(gstab);
	zgradpulse(-1.0*gzlvlE,gtE);
	delay(gstab);
	obspower(selpwrPS);
	rgradient('z',gzlvlPS);
	shaped_pulse(selshapePS,selpwPS,v3,rof1,rof1);
	rgradient('z',0.0);
	obspower(tpwr);
	delay(gstab);
	zgradpulse(-2.0*gzlvlE,gtE);
	delay(gstab - droppts/sw);

	delay(d2/2.0);

   status(C);
}
Exemplo n.º 7
0
pulsesequence()
{
   double          selpwrA = getval("selpwrA"),
                   selpwA = getval("selpwA"),
                   gzlvlA = getval("gzlvlA"),
                   gtA = getval("gtA"),
                   selpwrB = getval("selpwrB"),
                   selpwB = getval("selpwB"),
                   gzlvlB = getval("gzlvlB"),
                   gtB = getval("gtB"),
                   gstab = getval("gstab"),
                   slpwrT = getval("slpwrT"),
                   slpwT = getval("slpwT"),
                   mixT = getval("mixT"),
                   gzlvl1 = getval("gzlvl1"),
                   gt1 = getval("gt1"),
                   gzlvl2 = getval("gzlvl2"),
                   gt2 = getval("gt2"),
		   alfa1,
		   t1dly,
                   zqfpw1 = getval("zqfpw1"),
                   zqfpwr1 = getval("zqfpwr1"),
                   zqfpw2 = getval("zqfpw2"),
                   zqfpwr2 = getval("zqfpwr2"),
                   gzlvlzq1 = getval("gzlvlzq1"),
                   gzlvlzq2 = getval("gzlvlzq2");
   char            slpatT[MAXSTR],
                   selshapeA[MAXSTR],
                   selshapeB[MAXSTR],
                   zqfpat1[MAXSTR],
                   zqfpat2[MAXSTR];
   int             phase1 = (int)(getval("phase")+0.5),
                   prgcycle = (int)(getval("prgcycle")+0.5);

//synchronize gradients to srate for probetype='nano'
//   Preserve gradient "area"
        gtA = syncGradTime("gtA","gzlvlA",1.0);
        gzlvlA = syncGradLvl("gtA","gzlvlA",1.0);
        gtB = syncGradTime("gtB","gzlvlB",1.0);
        gzlvlB = syncGradLvl("gtB","gzlvlB",1.0);

/* LOAD AND INITIALIZE VARIABLES */
   getstr("selshapeA",selshapeA);
   getstr("selshapeB",selshapeB);
   getstr("slpatT",slpatT);
   getstr("zqfpat1",zqfpat1);
   getstr("zqfpat2",zqfpat2);

   alfa1 = (4*pw/PI) + 4.0e-6;
   if (getflag("homodec"))
        alfa1 = alfa1 + 2.0e-6 + 2*pw;
   t1dly = d2-alfa1;
   if (t1dly > 0.0)
        t1dly = t1dly;
   else
        t1dly = 0.0;

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

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

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

/*
   mod2(id2,v14);
   dbl(v14,v14);
 */
  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v14);
 
   settable(t1,4,ph1); 	getelem(t1,v17,v6);
   settable(t2,4,ph2); 	getelem(t2,v17,v1);
   settable(t3,8,ph3); 	getelem(t3,v17,oph);
   settable(t5,4,ph5); 	getelem(t5,v17,v21);
   settable(t7,8,ph7); 	getelem(t7,v17,v7);
   settable(t8,4,ph8); 	getelem(t8,v17,v8);   
    
  if (getflag("prgflg") && (satmode[0] == 'y'))
        sub(v6,one,v6);

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

   assign(v1,v11);
   add(v11,two,v12);
   assign(oph,v13);

   if (phase1 == 2)
      {incr(v1); incr(v6);}

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

   if (getflag("homodec"))
	add(oph,two,oph);

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

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

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

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

   status(B);
      rgpulse(pw, v1, rof1, 2.0e-6);

      if (getflag("homodec"))
       {
                delay(t1dly/2);
                rgpulse(2*pw,v13,1.0e-6,1.0e-6);
       }
      else
                delay(t1dly);

        zgradpulse(gzlvlA,gtA);
        delay(gstab);
        obspower(selpwrA);
        shaped_pulse(selshapeA,selpwA,v11,rof1,rof1);
        obspower(tpwr);
        zgradpulse(gzlvlA,gtA);
        delay(gstab);

      if (getflag("homodec"))
                delay(t1dly/2);

        zgradpulse(gzlvlB,gtB);
        delay(gstab);
        obspower(selpwrB);
        shaped_pulse(selshapeB,selpwB,v12,rof1,rof1);
        obspower(tpwr);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);

      rgpulse(pw,v7,2.0e-6,rof1);

      if (mixT > 0.0)
      {
        if (getflag("Gzqfilt"))
        {
         obspower(zqfpwr1);
         rgradient('z',gzlvlzq1);
         delay(100.0e-6);
         shaped_pulse(zqfpat1,zqfpw1,zero,rof1,rof1);
         delay(100.0e-6);
         rgradient('z',0.0);
         delay(100e-6);
        }
        obspower(slpwrT);
        zgradpulse(gzlvl1,gt1);
        delay(gt1);
        
        if (dps_flag)
          rgpulse(mixT,v21,0.0,0.0);
        else
          SpinLock(slpatT,mixT,slpwT,v21);

        if (getflag("Gzqfilt"))
        {
         obspower(zqfpwr2);
         rgradient('z',gzlvlzq2);
         delay(100.0e-6);
         shaped_pulse(zqfpat2,zqfpw2,zero,rof1,rof1);
         delay(100.0e-6);
         rgradient('z',0.0);
         delay(100e-6);
        }
        obspower(tpwr);
        zgradpulse(gzlvl2,gt2);
        delay(gt2);
      }

     rgpulse(pw,v8,rof1,rof2);
           
   status(C);
}
Exemplo n.º 8
0
pulsesequence()
{

  double j1min = getval("j1min"),
         j1max = getval("j1max"),
	 pwxlvl180 = getval("pwxlvl180"),
	 pwx180 = getval("pwx180"),
         gzlvl0 = getval("gzlvl0"),
         gt0 = getval("gt0"),
         gzlvlE = getval("gzlvlE"),
         gtE = getval("gtE"),
         EDratio = getval("EDratio"),
         gstab = getval("gstab"),
	 grad1,
	 grad2,
         tau,
	 tauA,
         tauB,
         taumb;

  char   pwx180ad[MAXSTR]; 
  int	 icosel,
         prgcycle = (int)(getval("prgcycle")+0.5),
	 phase1 = (int)(getval("phase")+0.5);

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

  getstr("pwx180ad", pwx180ad);
  grad1 = gzlvlE;
  grad2 = -1.0*gzlvlE*(EDratio-1)/(EDratio+1);
  tauA = 1/(2*(j1min + 0.146*(j1max - j1min)));
  tauB = 1/(2*(j1max - 0.146*(j1max - j1min)));
  taumb = 1 / (2 * (getval("jnxh")));
  tau = 1 / (j1min+j1max);

  icosel = 1;

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

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

  settable(t1, 1, ph1);
  settable(t2, 1, ph2);
  settable(t3, 2, ph3);
  settable(t4, 1, ph4);
  settable(t5, 4, ph5);
  settable(t6, 4, ph6);

  getelem(t1, v17,v1);
  getelem(t2, v17,v2);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t5, v17, v5);
  getelem(t6, v17, oph);

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

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

  add(v3, v10, v3);
  add(oph, v10, oph);

  if ((phase1 == 2) || (phase1 == 5))
  {
    icosel = -1;
    grad1 = gzlvlE*(EDratio-1)/(EDratio+1);
    grad2 = -1.0*gzlvlE;
  }

  status(A);

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

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

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

   decpower(pwxlvl);

  status(B);
    rgpulse(pw, v1, rof1, rof2);

/* Start of J filter  */
   if (getflag("jfilter"))
   {
     zgradpulse(gzlvl0/2,gt0);
     delay(tauA - gt0);
     decrgpulse(pwx, zero, rof1, rof1);
     zgradpulse(-gzlvl0/3,gt0);
     delay(tauB - gt0);
     decrgpulse(pwx, zero, rof1, rof1);
     zgradpulse(-gzlvl0/6,gt0);
     delay(gstab);
    }
/* End of J filter */

    delay(taumb);
    decrgpulse(pwx, v3, rof1, rof1);

    delay(d2 / 2.0);
    rgpulse(2 * pw, v4, rof1, rof1);
    delay(d2 / 2.0);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    delay(2 * pw + 2*POWER_DELAY + 4 * rof1 + (4 * pwx / 3.1416));
    zgradpulse(icosel * grad1, gtE);
    delay(gstab);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    zgradpulse(icosel * grad2, gtE);
    decpower(pwxlvl);
    delay(gstab);

    decrgpulse(pwx, v5, rof1, rof2);
    decpower(dpwr);

  status(C);
}
Exemplo n.º 9
0
pulsesequence()
{
   double  hsglvl = getval("hsglvl"),
             hsgt = getval("hsgt"),
           satpwr = getval("satpwr"),
           satdly = getval("satdly");
   int     prgcycle = (int)(getval("prgcycle")+0.5);
   char    sspul[MAXSTR],satmode[MAXSTR],wet[MAXSTR];

   getstr("satmode",satmode);
   getstr("sspul", sspul);
   getstr("wet",wet);

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

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

   settable(t1,4,ph1);     getelem(t1,v17,v1);
   settable(t2,8,ph2);     getelem(t2,v17,v2);
   assign(v1,oph);
   add(oph,v18,oph);
   add(oph,v19,oph);

/* BEGIN ACTUAL SEQUENCE */
   status(A);
      obspower(tpwr);
 
   delay(5.0e-5);
   if (getflag("sspul"))
	steadystate();

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

     }
   else
	delay(d1);

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

   status(B);
      rgpulse(pw, v1, rof1, rof1);
      delay(d2/2);
      rgpulse(2.0*pw, v2, rof1, 2*rof1);
      delay(d2/2 + 2*pw/PI);
   status(C);
}
Exemplo n.º 10
0
pulsesequence()
{
   double          slpwrR = getval("slpwrR"),
                   slpwR = getval("slpwR"),
                   mixR = getval("mixR"),
                   gzlvlz = getval("gzlvlz"),
                   gtz = getval("gtz"),
		   zfphinc = getval("zfphinc");
   char		   slpatR[MAXSTR];
   int             phase1 = (int)(getval("phase")+0.5),
                   prgcycle = (int)(getval("prgcycle")+0.5);

/* LOAD AND INITIALIZE PARAMETERS */
   getstr("slpatR",slpatR);

   if (strcmp(slpatR,"cw") &&
        strcmp(slpatR,"troesy") &&
        strcmp(slpatR,"dante"))
        abort_message("SpinLock pattern %s not supported!.\n", slpatR);

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

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

   settable(t1,4,ph1);	getelem(t1,v17,v1);
   settable(t2,8,ph2);	getelem(t2,v17,v20);
   settable(t3,8,ph3);	
   settable(t8,4,ph8);	getelem(t8,v17,v8);
   settable(t6,8,ph6);	getelem(t6,v17,v6);
  
   assign(v1,oph); 
   if (getflag("zfilt"))
	getelem(t3,v17,oph);

   assign(v20,v9);
   if (!strcmp(slpatR,"troesy"))
	assign(v20,v21);
   else
	add(v20,one,v21);

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

  if (getflag("prgflg") && (satmode[0] == 'y'))
	assign(v1,v6);
   if (phase1 == 2)
      {incr(v1); incr(v6);}			/* hypercomplex method */

/*
   mod2(id2,v13);
   dbl(v13,v13);
*/
  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v13);

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

/* The following is for flipback pulse */
   zfphinc=zfphinc+180;
   if (zfphinc < 0) zfphinc=zfphinc+360;
   initval(zfphinc,v10);

/* BEGIN ACTUAL PULSE SEQUENCE */
   status(A);
      obspower(tpwr);

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

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

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

   status(B);
      rgpulse(pw, v1, rof1, rof1);
      if (d2 > 0.0)
       delay(d2 - POWER_DELAY - (2*pw/PI) - rof1);
      else
       delay(d2);
      
      obspower(slpwrR);

      if (mixR > 0.0)
      {
        if (dps_flag)
          	rgpulse(mixR,v21,0.0,0.0);
        else
          SpinLock(slpatR,mixR,slpwR,v21);
      }

       if ((getflag("zfilt")) && (getflag("PFGflg")))
        {
           obspower(tpwr);
           rgpulse(pw,v9,1.0e-6,rof1);
           zgradpulse(gzlvlz,gtz);
           delay(gtz/3);
           if (getflag("flipback"))
                FBpulse(v8,v10);
           rgpulse(pw,v8,rof1,rof2);
        }
       else
/* Add 2*pw/PI to final rof2, so ddrpm can be set to
   a value of 'p' for both zfilt options */

           delay(rof2+(2*pw/PI));

   status(C);
}
Exemplo n.º 11
0
void pulsesequence()
{
double  gzlvlE = getval("gzlvlE"),
        gtE = getval("gtE"),
        EDratio = getval("EDratio"),
        gstab = getval("gstab"),
        mult = getval("mult"),
	pwx180 = getval("pwx180"),
	pwxlvl180 = getval("pwxlvl180"),
	pwx180r = getval("pwx180r"),
	pwxlvl180r = getval("pwxlvl180r"),
        hsglvl = getval("hsglvl"),
        hsgt = getval("hsgt"),
        tauA=getval("tauA"),        //compensation for tauB and tauD
        tauB=getval("tauB"),        //effect of rof2
        tauD=getval("tauD"),        //effect of alfa
        tBal=getval("tBal"),        //supports inova console if ~1/(fb*1.3)
        pwr_XBIP = getval("pwr_XBIP"),
        pw_XBIP = getval("pw_XBIP"),
        pwr_HBIP = getval("pwr_HBIP"),
        pw_HBIP = getval("pw_HBIP"),
        gzlvlcr = getval("gzlvlcr"),
        gtcr = getval("gtcr"),        //crusher gradient in BIRD
        npoints = getval("npoints"),  // npoints should be an integer multiple of np
        tau, evolcorr, taug,cycles;
int     prgcycle = (int)(getval("prgcycle")+0.5),
	phase1 = (int)(getval("phase")+0.5),
	icosel, ZZgsign;
char	pwx180ad[MAXSTR], pwx180adR[MAXSTR], pwx180ref[MAXSTR],
        shp_XBIP[MAXSTR], shp_HBIP[MAXSTR], BIRD[MAXSTR], BIRDmode[MAXSTR];

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

  getstr("pwx180ad", pwx180ad);
  getstr("pwx180adR", pwx180adR);
  getstr("pwx180ref", pwx180ref);
  getstr("shp_XBIP",shp_XBIP);
  getstr("shp_HBIP",shp_HBIP);
  getstr("BIRD",BIRD);
  getstr("BIRDmode",BIRDmode);

  tau = 1 / (4*(getval("j1xh")));
  evolcorr = (4*pwx/PI)+2*pw+8.0e-6;
  cycles=np/npoints;
  cycles = (double)((int)((cycles)));
  initval(cycles,v20);

  if (mult > 0.5)
    taug = 2*tau + getval("tauC");
  else
    taug = gtE + gstab + 2 * GRADIENT_DELAY;
  ZZgsign=-1; 
  if (mult == 2) ZZgsign=1;
  icosel = 1;
 
  assign(ct,v17);
  assign(zero,v18);
  assign(zero,v19);

  if (getflag("prgflg") && (satmode[0] == 'y') && (prgcycle > 1.5))
    {
        hlv(ct,v17);
        mod2(ct,v18); dbl(v18,v18);
        if (prgcycle > 2.5)
           {
                hlv(v17,v17);
                hlv(ct,v19); mod2(v19,v19); dbl(v19,v19);
           }
     }
 
     if (BIRD[0]=='n')          //gHSQC phases
        {
                settable(t1,4,ph1);
                settable(t2,2,ph2);
                settable(t3,8,ph3);
                settable(t4,16,ph4);
                settable(t5,16,ph5);
        }
     else                      //rtgHSQC-BIRD phases
        {
                settable(t1,8,ph11);
                settable(t2,2,ph12);
                settable(t3,16,ph13);
                settable(t4,32,ph14);
                settable(t5,32,ph15);
                settable(t7,4,ph17);
                settable(t8,4,ph18);
                settable(t9,4,ph19);
                getelem(t7, v17, v7);
                getelem(t8, v17, v8);
                getelem(t9, v17, v9);
        }

     getelem(t1, v17, v1);
     getelem(t3, v17, v3);
     getelem(t4, v17, v4);
     getelem(t2, v17, v2);
     getelem(t5, v17, oph);

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

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

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

status(A);
   obspower(tpwr); decpower(pwxlvl);
   delay(5.0e-5);
   if (getflag("sspul"))
        steadystate();

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

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

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

/*********gHSQC or gHSQC part of pure shift starts here *****/

    if (getflag("cpmgflg"))
    {
      rgpulse(pw, v6, rof1, 0.0);
      cpmg(v6, v15);
    }
    else
      rgpulse(pw, v6, rof1, rof1);
    delay(tau);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    rgpulse(2.0 * pw, zero, rof1, rof1);
    delay(tau + 2 * POWER_DELAY);
    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
    decpower(pwxlvl);
    rgpulse(pw, v1, rof1, rof1);
    zgradpulse(hsglvl, 2 * hsgt);
    delay(1e-3);
    decrgpulse(pwx, v2, rof1, 2.0e-6);

      delay(d2 / 2);
    rgpulse(2 * pw, zero, 2.0e-6, 2.0e-6);
      delay(d2 / 2);

    delay(taug - POWER_DELAY);
    if (mult > 0.5)
    {
    decpower(pwxlvl180r);
    decshaped_pulse(pwx180ref, pwx180r, zero, rof1, rof1);
    rgpulse(mult * pw, zero, rof1, rof1);
    delay(taug - mult * pw - 2 * rof1 + POWER_DELAY - gtE - gstab - 2 * GRADIENT_DELAY+evolcorr);
    zgradpulse(gzlvlE, gtE);
    delay(gstab);
    decshaped_pulse(pwx180ref, pwx180r, zero, rof1, rof1);
    }
    else
    {
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    delay(taug + POWER_DELAY - gtE - gstab - 2 * GRADIENT_DELAY+evolcorr);
    zgradpulse(gzlvlE, gtE);
    delay(gstab);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    }

    decpower(pwxlvl);

    decrgpulse(pwx, v4, 2.0e-6, rof1);
    zgradpulse(ZZgsign*0.6 * hsglvl, 1.2 * hsgt);
    delay(1e-3);
    rgpulse(pw, v3, rof1, rof1);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
    decpower(dpwr);
    delay(tau - (2 * pw / PI) - 2*rof1);
    rgpulse(2 * pw, zero, rof1, rof2);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    decpower(dpwr);
    zgradpulse(icosel * 2.0*gzlvlE/EDratio, gtE/2.0);
    delay(tau - gtE/2.0 - 2 * GRADIENT_DELAY);

/********gHSQC part stops and BIRD Acquisition starts here*************/
    // delay(tBal);
        //filter delay (Hoult) for inova; adjust tBal manually for the same effect
        //delay(1.0/(getval("fb")*1.3))

        if (BIRD[0]=='y')
        {
#ifdef NVPSG
                setacqmode(WACQ|NZ);    //use this line only for vnmrs console; comment this out in inova
#endif
                obsblank();
//                delay(rof2);
                startacq(alfa);
        }

/*----------------------------------------------------------------------------
         Observe the 1st half chunk
-----------------------------------------------------------------------------*/

        if (BIRD[0]=='y')
        {
                status(C);
                acquire(npoints/2.0,1.0/sw);
                rcvroff();                                            
                status(B);
                obspower(tpwr);

/*------------------------------------------------------------------------
         Using hard 13C inversion pulse in BIRD
--------------------------------------------------------------------------*/

                if (BIRDmode[0]== 'h')
                {
                        rgpulse(pw,v7,rof1,rof1);
                        decpower(pwxlvl);
                        delay(tau);        
                        zgradpulse(gzlvlcr,gtcr);
                        delay(tau-gtcr);
                        simpulse(2.0*pw,2.0*pwx,v8,v8,rof1,rof1);
                        decpower(dpwr);
                        delay(tau);
                        zgradpulse(gzlvlcr,gtcr);
                        delay(tau-gtcr);
                        rgpulse(pw,v9,rof1,rof1);
                }

/*---------------------------------------------------------------------------
        Using BIP 13C inversion pulse in BIRD
----------------------------------------------------------------------------*/

                if (BIRDmode[0]== 'b')
                {
                  rgpulse(pw,v7,rof1,rof1);                     
                  if (pwr_XBIP!=pwxlvl) decpower(pwr_XBIP); else decpower(pwxlvl);
                  if (pwr_HBIP!=tpwr)  obspower(pwr_HBIP);
                  delay(tau); 
                  zgradpulse(gzlvlcr,gtcr);
                  delay(tau-gtcr);                              
                  simshaped_pulse(shp_HBIP,shp_XBIP,2.0*pw,pw_XBIP,v8,v8,rof1,rof1);
                  if (pwr_HBIP!=tpwr) obspower(tpwr);
                  decpower(dpwr);
                  delay(tau);
                  zgradpulse(gzlvlcr,gtcr);
                  delay(tau-gtcr);
                  rgpulse(pw,v9,rof1,rof1);
                }
                
                delay(tauA);
                rgpulse(pw*2.0,v7,rof1,rof1);  // hard 180 degree refocusing pulse
                obsblank();
                delay(tauB);
                rcvron();       //this includes rof3
                delay(tauD);
                decr(v20);

/*------------------------------------------------------------------------------
                Loops for more chunks
------------------------------------------------------------------------------*/

                starthardloop(v20);
                status(C);
                        acquire(npoints,1.0/sw);
                        rcvroff();                                    
                status(B);
                        obspower(tpwr);                               

/*------------------------------------------------------------------------                                              
Using hard 13C inversion pulse in BIRD
--------------------------------------------------------------------------*/
                if (BIRDmode[0]== 'h')
                {
                        rgpulse(pw,v7,rof1,rof1);
                        decpower(pwxlvl);                             
                        delay(tau);         
                        zgradpulse(gzlvlcr,gtcr);
                        delay(tau-gtcr);                      
                        simpulse(2.0*pw,2.0*pwx,v8,v8,rof1,rof1);
                        decpower(dpwr);
                        delay(tau);
                        zgradpulse(gzlvlcr,gtcr);
                        delay(tau-gtcr);
                        rgpulse(pw,v9,rof1,rof1);
                }
/*---------------------------------------------------------------------------
Using BIP 13C inversion pulse in BIRD
----------------------------------------------------------------------------*/
//                if (BIRDmode[0]== 'b')
                if (BIRDmode[0]== 'b')
                {
                        rgpulse(pw,v7,rof1,rof1);                     
                        if (pwr_XBIP!=pwxlvl) decpower(pwr_XBIP); else decpower(pwxlvl);
                        delay(tau);      
                        zgradpulse(gzlvlcr,gtcr);
                        delay(tau-gtcr);                         
                        simshaped_pulse(shp_HBIP,shp_XBIP,2*pw,pw_XBIP,v8,v8,rof1,rof1);
                        decpower(dpwr);
                        delay(tau);
                        zgradpulse(gzlvlcr,gtcr);
                        delay(tau-gtcr);
                rgpulse(pw,v9,rof1,rof1);
                }

                delay(tauA);
                rgpulse(pw*2.0,v7,rof1,rof1);            // hard 180 degree refocusing pulse
                obsblank();
                delay(tauB);
                rcvron();       //this includes rof3
                delay(tauD);

                endhardloop();

/*----------------------------------------------------------------
                Acquisition of last half chunk
----------------------------------------------------------------*/
                status(C);
                        acquire(npoints/2.0,1.0/sw);
                        rcvroff();                                    
                        endacq();
                        incr(v20);
        }
                 /****** BIRD ends here for all *****/
/***************** ACQ for conventional gHSQC ******************************/
        else
        status(C);
}
Exemplo n.º 12
0
pulsesequence()
{

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

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

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

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

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

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

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

  taug = tau + getval("tauC");

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

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

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

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

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

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

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

  status(A);

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

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

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

    obspower(tpwr);
    decpower(pwxlvl);

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

  status(B);

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

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

    decrgpulse(pwx,v2,rof1,rof1);

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

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

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

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

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

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

    zgradpulse(icosel*gzlvlE,gtE);

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

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

    obspower(tpwr);

    delay(tau);

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

  status(C);

    delay(tau+tau3+3*pwx+6*rof1-tau1+WFG_START_DELAY+WFG_STOP_DELAY);
}
Exemplo n.º 13
0
pulsesequence()
{
    /* DECLARE VARIABLES */
    char     satmode[MAXSTR],f1180[MAXSTR],sspul[MAXSTR],comm[MAXSTR],
             pwx180ad[MAXSTR],pwx180adR[MAXSTR],pwx180ref[MAXSTR];
    int	  phase,satmove,maxni,t1_counter,icosel=1,
                                         prgcycle = (int)(getval("prgcycle")+0.5);
    double   tau1,tauxh, tauxh1, taucc,av180,
             hsgt   = getval("hsgt"),
             gt1    = getval("gt1"),
             gt2    = getval("gt2"),
             gt3    = getval("gt3"),
             hsglvl = getval("hsglvl"),
             gzlvl1 = getval("gzlvl1"),
             gzlvl2 = getval("gzlvl2"),
             gzlvl3 = getval("gzlvl3"),
             pwx    = getval("pwx"),
             pwxlvl = getval("pwxlvl"),
             j1xh   = getval("j1xh"),
             jcc    = getval("jcc"),
             satdly = getval("satdly"),
             satpwr = getval("satpwr"),
             satfrq = getval("satfrq"),
             sw1    = getval("sw1"),
             gstab  = getval("gstab"),
             kappa  = getval("kappa"),
             dofdec = getval("dofdec"),
             pwx180 = getval("pwx180"),
             pwxlvl180  = getval("pwxlvl180");

    getstr("f1180",f1180);
    getstr("satmode",satmode);
    getstr("sspul",sspul);
    getstr("pwx180ad", pwx180ad);
    ni = getval("ni");
    av180 = (double)((int)(1e6*(9.45*4*pwx/1.54+0.5e-6))/1e6); /* round it to 1usec */
    phase = (int) (getval("phase") + 0.5);
    satmove = ( fabs(tof - satfrq) >= 0.1 );

    /* construct a command line for Pbox */

    if((getval("arraydim") < 1.5) || (ix==1))        /* execute only once */
    {   sprintf(comm, "Pbox ad180 -u %s -w \"cawurst-10 %.1f/%.6f\" -s 1.0 -0\n",
                userdir, 1.0/pwx, 30*pwx);
        system(comm);                         /* create adiabatic 180 pulse */
        sprintf(comm, "Pbox av180 -u %s -w \"av180b %.6f\" -s 1.0 -0\n", userdir, av180);
        system(comm);                        /* create refocusing 180 pulse */
    }

    /* LOAD VARIABLES */

    settable(t1, 1, phi1);
    settable(t2, 1, phi2);
    settable(t4, 2, phi4);
    settable(t5, 4, phi5);
    settable(t6, 4, phi6);
    settable(t8, 1, phi8);
    settable(t9, 8, phi9);
    settable(t10, 16, phi10);
    settable(t11, 1, phi11);
    settable(t31, 16, phi31);

    /* INITIALIZE VARIABLES */
    if (j1xh != 0.0)
    {
        tauxh = 1/(4*j1xh);
        tauxh1 = 1/(6*j1xh);
    }
    else
    {
        tauxh = 1.80e-3;
        tauxh1 = 1.80e-3;
    }

    if ( jcc != 0.0 ) taucc = 1/(4*jcc);
    else  taucc = 1/(4*40);

    /*  Phase incrementation for hypercomplex echo-antiecho 2D data */

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

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

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

    /* Check constant-time conditions */
    if (kappa == 1.0)
    {
        maxni = (int) (taucc*sw1*2.0);
        if (maxni < ni)
        {
            abort_message("too many increments! maxni = %d   ",maxni);
        }
    }

    /* SET UP FOR (-90,180) PHASE CORRECTIONS IF f1180='y' */
    tau1 = d2;
    if(f1180[A] == 'y')  tau1 += ( 1.0/(2.0*sw1) ); /* Wait half a dwell time */
    tau1 = tau1/2.0;

    /* BEGIN ACTUAL PULSE SEQUENCE */

    status(A);
    decpower(pwxlvl);
    decoffset(dof);     /* Set decoupler power to pwxlvl */

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

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

    }
    else
        delay(d1);

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

    status(B);
    rcvroff();
    rgpulse(pw,t1,1.0e-6,0.0);
    txphase(t1);
    decphase(t1);
    delay(tauxh-15.0*pwx);                        /* delay=1/4J(XH) */
    simshaped_pulse("","ad180",2*pw,30*pwx,t1,t1,0.0,0.0);
    txphase(t2);
    decphase(t4);
    delay(tauxh-15.0*pwx);
    simpulse(pw,pwx,t2,t4,0.0,0.0);
    decphase(t8);
    delay(taucc);
    decshaped_pulse("av180",av180,t8,0.0,0.0);
    decphase(t9);
    delay(taucc);
    decrgpulse(pwx,t9,0.0,0.0);
    delay(tau1);
    rgpulse(2*pw,t1,1.0e-6,0.0);
    delay(tau1);
    delay(gt1 + gstab + 2*GRADIENT_DELAY - 2*pw -1.0e-6);
    decshaped_pulse("av180",av180,t11,1.0e-6,0.0);
    zgradpulse(gzlvl1, gt1);
    delay(gstab);
    decrgpulse(pwx*1.3333,t10,1.0e-6,0.0);   /* 120 Grad pulse */
    decphase(t11);
    delay(taucc - kappa*tau1);
    decshaped_pulse("av180",av180,t11,0.0,0.0);
    delay(10.0e-6);
    zgradpulse(gzlvl2,gt2);
    delay(gstab);
    delay(taucc - 10.0e-6 - gstab - gt2 - 2*GRADIENT_DELAY - 1.0e-6);
    rgpulse(kappa*2*pw,t1,1.0e-6,0.0);
    delay(kappa*tau1);
    simpulse(pw,pwx,t1,t5,1.0e-6,0.0);
    txphase(t1);
    decphase(t1);
    delay(tauxh1);                        /* delay=1/4J (XH);1/6J XH,XH2, XH3) */
    simshaped_pulse("","av180",2*pw,av180,t1,t1,0.0,0.0);
    txphase(t2);
    decphase(t6);
    delay(tauxh1);
    simpulse(pw,pwx,t2,t6,0.0,0.0);
    txphase(t1);
    decphase(t1);
    delay(tauxh-15.0*pwx);
    simshaped_pulse("","ad180",2*pw,30*pwx,t1,t1,0.0,0.0);
    txphase(t1);
    delay(tauxh-15.0*pwx-0.5e-6);
    rgpulse(pw,t1,0.0,0.0);
    decpower(dpwr);
    decoffset(dofdec);  /* lower decoupler power for decoupling */
    delay(gt3 + gstab + 2*GRADIENT_DELAY-POWER_DELAY-1.0e-6);
    rgpulse(2*pw,t1,1.0e-6,0.0);
    zgradpulse(icosel*gzlvl3, gt3);
    delay(gstab);
    rcvron();
    status(C);
    setreceiver(t31);
}
Exemplo n.º 14
0
void pulsesequence()

{

   double   hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            tau,
	    evolcorr,
	    pwx180 = getval("pwx180"),
	    pwxlvl180 = getval("pwxlvl180"),
	    selpwxA = getval("selpwxA"),
	    selpwxlvlA = getval("selpwxlvlA"),
	    gzlvlA = getval("gzlvlA"),
	    gtA = getval("gtA"),
	    selpwxB = getval("selpwxB"),
	    selpwxlvlB = getval("selpwxlvlB"),
	    gzlvlB = getval("gzlvlB"),
	    gtB = getval("gtB"),
	    gstab = getval("gstab"),
	    impress = getval("impress"),
            null = getval("null");
  int	    phase1 = (int)(getval("phase")+0.5),
            prgcycle = (int)(getval("prgcycle")+0.5),
	    iimphase = (int)(getval("imphase")+0.5);
  char      pwx180ad[MAXSTR],
	    selpwxshpA[MAXSTR],
	    selpwxshpB[MAXSTR],
            pwx180adR[MAXSTR];

//synchronize gradients to srate for probetype='nano'
//   Preserve gradient "area"
        gtA = syncGradTime("gtA","gzlvlA",1.0);
        gzlvlA = syncGradLvl("gtA","gzlvlA",1.0);
        gtB = syncGradTime("gtB","gzlvlB",1.0);
        gzlvlB = syncGradLvl("gtB","gzlvlB",1.0);

  getstr("pwx180ad", pwx180ad);
  getstr("pwx180adR", pwx180adR);
  getstr("selpwxshpA", selpwxshpA);
  getstr("selpwxshpB", selpwxshpB);
  evolcorr=(4*pwx/PI)+2*pw+8.0e-6;

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

  if (impress > 0.5)
  {
    selpwxA = getval("imppw1");
    selpwxlvlA = getval("imppwr1");
    getstr("impshp1", selpwxshpA);
    if (iimphase == 1)
    {
    	selpwxB = getval("imppw1");
	selpwxlvlB = getval("imppwr1");
	getstr("impshp1",selpwxshpB);
    }
    if (iimphase == 2)
    {
        selpwxB = getval("imppw2");
        selpwxlvlB = getval("imppwr2");
        getstr("impshp2",selpwxshpB);
    }
    if (iimphase == 3)
    {
        selpwxB = getval("imppw3");
        selpwxlvlB = getval("imppwr3");
        getstr("impshp3",selpwxshpB);
    }
    if (iimphase == 4)
    {
        selpwxB = getval("imppw4");
        selpwxlvlB = getval("imppwr4");
        getstr("impshp4",selpwxshpB);
    }
  }

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

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

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

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

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

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

  if (impress > 0.5)
  {
        if (getflag("fadflg"))
        {
                add(v2, v14, v2);
                add(oph, v14, oph);
        }
  }
  else
        {
                add(v2, v14, v2);
                add(oph, v14, oph);
        }


  status(A);

   obspower(tpwr);

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

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

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

   decpower(pwxlvl);

  status(B);

    if ((getflag("PFGflg")) && (getflag("nullflg")))
    {
        rgpulse(0.5 * pw, zero, rof1, rof1);
        delay(2 * tau);
        decpower(pwxlvl180);
        decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
        rgpulse(2.0 * pw, zero, rof1, rof1);
        delay(2 * tau + 2 * POWER_DELAY);
        decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
        decpower(pwxlvl);
        rgpulse(1.5 * pw, two, rof1, rof1);
        zgradpulse(hsglvl, hsgt);
        delay(1e-3);
    }
    else if (null != 0.0)
    {
        rgpulse(pw, zero, rof1, rof1);
        delay(2 * tau);
        decpower(pwxlvl180);
        decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
        rgpulse(2.0 * pw, zero, rof1, rof1);
        delay(2 * tau + 2 * POWER_DELAY);
        decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
        decpower(pwxlvl);
        rgpulse(pw, two, rof1, rof1);
        if (satmode[1] == 'y')
        {
	   if (getflag("slpsat"))
                shaped_satpulse("BIRDnull",null,zero);
           else
                satpulse(null,zero,rof1,rof1);
        }
	else
	   delay(null);
    }

    if (getflag("cpmgflg"))
    {
       rgpulse(pw, v6, rof1, 0.0);
       cpmg(v6, v15);
    }
    else
       rgpulse(pw, v6, rof1, rof1);
    delay(tau);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    rgpulse(2.0 * pw, zero, rof1, rof1);
    delay(tau + 2 * POWER_DELAY);
    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
    decpower(pwxlvl);
    rgpulse(pw, t1, rof1, rof1);
    if (getflag("PFGflg"))
    {
      zgradpulse(hsglvl, 2 * hsgt);
      delay(1e-3);
    }
    decrgpulse(pwx, v2, rof1, 2.0e-6);
      delay(d2 / 2);
    rgpulse(2 * pw, zero, 2.0e-6, 2.0e-6);
      delay(d2 / 2);

      zgradpulse(gzlvlA,gtA);
      delay(gstab);
      decpower(selpwxlvlA);
      decshaped_pulse(selpwxshpA, selpwxA, zero, rof1, rof1);
      decpower(pwxlvl);
      zgradpulse(gzlvlA,gtA);
      delay(gstab + evolcorr);

      zgradpulse(gzlvlB,gtB);
      delay(gstab);
      decpower(selpwxlvlB);
      decshaped_pulse(selpwxshpB, selpwxB, zero, rof1, rof1);
      decpower(pwxlvl);
      zgradpulse(gzlvlB,gtB);
      delay(gstab);

    decrgpulse(pwx, t4, 2.0e-6, rof1);
    if (getflag("PFGflg"))
    {
      zgradpulse(0.6 * hsglvl, 1.2 * hsgt);
      delay(1e-3);
    }
    rgpulse(pw, t3, rof1, rof1);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
    decpower(dpwr);
    delay(tau - (2 * pw / PI) - 2*rof1);
    rgpulse(2 * pw, zero, rof1, rof2);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    decpower(dpwr);
    delay(tau - POWER_DELAY);
  status(C);
}
Exemplo n.º 15
0
pulsesequence()
{

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

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

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

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

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

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

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

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

  icosel = 1;

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

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

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

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

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

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

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

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

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

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

  status(A);

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

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

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

    obspower(tpwr);
    decpower(pwxlvl);

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

  status(B);

    rgpulse(pw, v6, rof1, rof1);

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

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

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

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

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

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

  status(C);

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

}
Exemplo n.º 16
0
pulsesequence()

{
   double   hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            slpwT = getval("slpwT"),
            slpwrT = getval("slpwrT"),
            trim = getval("trim"),
            mixT = getval("mixT"),
            mult = getval("mult"),
            tau,
	    null = getval("null");
   char	    slpatT[MAXSTR];
   int	    phase1 = (int)(getval("phase")+0.5),
            prgcycle = (int)(getval("prgcycle")+0.5);

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

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


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

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

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

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

   assign(two,v21);

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

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

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

status(A);

   obspower(tpwr);

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

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

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

   decpower(pwxlvl);

status(B);

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

     rgpulse(pw,v6,rof1,rof1);
     delay(tau - pwx - 2*pw/PI - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
     delay(tau - pwx - 2*pwx/PI - 2*rof1);
     rgpulse(pw,v1,rof1,rof1);
     if (getflag("PFGflg"))
      {
	zgradpulse(hsglvl,2*hsgt);
	delay(1.0e-3);
      }
     decrgpulse(pwx,v2,rof1,2.0e-6);
     if (d2/2 > 0.0)
      delay(d2/2 - (2*pwx/PI) - pw - 4.0e-6);
     else
      delay(d2/2);
     rgpulse(2*pw,zero,2.0e-6,2.0e-6);
     if (d2/2 > 0.0) 
      delay(d2/2 - (2*pwx/PI) - pw - 4.0e-6);  
     else
      delay(d2/2);
     decrgpulse(pwx,v4,2.0e-6,rof1);
     if (getflag("PFGflg"))
      {
	zgradpulse(-0.6*hsglvl,1.2*hsgt);
        delay(1.0e-3);
      }
     rgpulse(pw,v3,rof1,rof1);
     delay(tau - (2*pw/PI) - rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof1);
     obspower(slpwrT);
     decpower(dpwr);
     delay(tau - rof1 - 2*POWER_DELAY);

     if (mixT > 0.0)
     {         
        rgpulse(trim,zero,0.0,0.0);
        if (dps_flag)
          rgpulse(mixT,v21,0.0,0.0);
        else
          SpinLock(slpatT,mixT,slpwT,v21);
     }  

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

   status(C);
}
Exemplo n.º 17
0
void pulsesequence()
{
   double   gzlvlE = getval("gzlvlE"),
            gtE = getval("gtE"),
            EDratio = getval("EDratio"),
            gstab = getval("gstab"),
            hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            slpwT = getval("slpwT"),
            slpwrT = getval("slpwrT"),
            trim = getval("trim"),
            mixT = getval("mixT"),
            mult = getval("mult"),
            tau,
	    gtau;
   int      icosel,
            prgcycle = (int)(getval("prgcycle")+0.5),
	    phase1 = (int)(getval("phase")+0.5);
   char     slpatT[MAXSTR];

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

   getstr("slpatT",slpatT);

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

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

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

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

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

  assign(zero,v4);
  getelem(t1,v17,v1);
  getelem(t2,v17,v2);
  getelem(t3,v17,oph);

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

  assign(three,v21);

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

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

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

status(A);
  obspower(tpwr);

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

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

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

   decpower(pwxlvl);

status(B);

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

      if (getflag("cpmgflg"))
      {
        rgpulse(pw, v6, rof1, 0.0);
        cpmg(v6, v15);
      }
      else
        rgpulse(pw, v6, rof1, rof1);
     delay(2*tau - 2*rof1 - (2*pw/PI));

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

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

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

     decrgpulse(pwx,v2,rof1,rof1);
     delay(2*tau - rof1 - POWER_DELAY);
     obspower(slpwrT);

     if (mixT > 0.0)
     {
        rgpulse(trim,three,0.0,0.0);
        if (dps_flag)
          rgpulse(mixT,v21,0.0,0.0);
        else
          SpinLock(slpatT,mixT,slpwT,v21);
     }

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

  status(C);
} 
Exemplo n.º 18
0
void pulsesequence()

{

   double   selpwrA = getval("selpwrA"),
            selpwA = getval("selpwA"),
            gzlvlA = getval("gzlvlA"),
            gtA = getval("gtA"),
            selpwrB = getval("selpwrB"),
            selpwB = getval("selpwB"),
            gzlvlB = getval("gzlvlB"),
            gtB = getval("gtB"),
   	    gzlvlE = getval("gzlvlE"),
            gtE = getval("gtE"),
            EDratio = getval("EDratio"),
            gstab = getval("gstab"),
	    pwx180 = getval("pwx180"),
	    pwxlvl180 = getval("pwxlvl180"),
            hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            tau,
	    evolcorr,
	    jdly,
	    bird;
   int      icosel,
	    ijscale,
            prgcycle = (int)(getval("prgcycle")+0.5),
	    phase1=(int)(getval("phase")+0.5);
   char     selshapeA[MAXSTR],
            selshapeB[MAXSTR],
   	    pwx180ad[MAXSTR],
	    pwx180adR[MAXSTR];

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

  getstr("selshapeA",selshapeA);
  getstr("selshapeB",selshapeB);
  getstr("pwx180ad", pwx180ad);
  getstr("pwx180adR", pwx180adR);
  evolcorr=(4*pwx/PI)+2*pw+8.0e-6;
  bird = 1 / (4*(getval("j1xh")));
  tau = 1/(4*(getval("jnxh")));
  ijscale=(int)(getval("jscale") + 0.5);
  jdly=(d2*ijscale);

  icosel = 1;

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

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

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

   getelem(t1,v17,v1);
   getelem(t2,v17,v2);
   getelem(t4,v17,v4);
   getelem(t5,v17,oph);

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

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

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

status(A);
   obspower(tpwr);

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

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

   decpower(pwxlvl);

  status(B);

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

    if (getflag("cpmgflg"))
    {
       rgpulse(pw, v1, rof1, 0.0);
       cpmg(v1, v15);
    }
    else
       rgpulse(pw, v1, rof1, rof1);
    delay(tau/2 - gtA - gstab);
    delay(jdly/4);

        zgradpulse(gzlvlA,gtA);
        delay(gstab);
        obspower(selpwrA);
        decpower(pwxlvl180);
        decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
        shaped_pulse(selshapeA,selpwA,zero,rof1,rof1);
        zgradpulse(gzlvlA,gtA);
        delay(gstab);

    delay(tau/2 - gtA - gstab);
    delay(jdly/2);
    delay(tau/2 - gtB - gstab);

        zgradpulse(gzlvlB,gtB);
        delay(gstab);
        obspower(selpwrB);
        decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
        shaped_pulse(selshapeB,selpwB,two,rof1,rof1);
	obspower(tpwr);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);
	decpower(pwxlvl);

    delay(jdly/4);
    delay(tau/2 - gtB - gstab);

    rgpulse(pw, one, rof1, rof1);
    zgradpulse(hsglvl, 2 * hsgt);
    delay(1e-3);
    decrgpulse(pwx, v2, rof1, 2.0e-6);

      delay(d2/2);
    rgpulse(2 * pw, zero, 2.0e-6, 2.0e-6);
      delay(d2/2);

    delay(gtE + gstab + 2*GRADIENT_DELAY - POWER_DELAY);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    zgradpulse(gzlvlE, gtE);
    delay(gstab + POWER_DELAY + evolcorr);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    decpower(pwxlvl);

    decrgpulse(pwx, v4, 2.0e-6, rof1);
    zgradpulse(-0.6 * hsglvl, 1.2 * hsgt);
    delay(1e-3);
    rgpulse(pw, zero, rof1, rof1);

    zgradpulse(icosel * 2.0*gzlvlE/EDratio, gtE/2.0);
    delay(gstab);

    delay(tau - gtA - 2*gstab - gtE/2);
        zgradpulse(gzlvlA,gtA);
        delay(gstab);
        obspower(selpwrA);
        decpower(pwxlvl180);
        decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
        shaped_pulse(selshapeA,selpwA,zero,rof1,rof1);
        zgradpulse(gzlvlA,gtA);
        delay(gstab);

    delay(tau - gtA - gstab);

    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);

        decpower(dpwr);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);
        obspower(selpwrB);
        shaped_pulse(selshapeB,selpwB,two,rof1,rof2);
        obspower(tpwr);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);

  status(C);
}
Exemplo n.º 19
0
void pulsesequence()
{
  double satdly = getval("satdly");
  int prgcycle=(int)(getval("prgcycle")+0.5);
  char	satmode[MAXSTR],
	sspul[MAXSTR];

  getstr("satmode",satmode);
  getstr("sspul",sspul);

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

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

  settable(t1,4,phs1);
  settable(t2,8,phs2);
  settable(t3,4,phs3);
  getelem(t1,v17,v1);
  getelem(t2,v17,v2);
  getelem(t3,v17,v3);
  assign(v1,oph);
  add(oph,v18,oph);
  add(oph,v19,oph);

  if (getflag("prgflg") && (satmode[0] == 'y'))
	assign(v3,v2);

   /* equilibrium period */
   status(A);

   delay(5.0e-5);
   if (sspul[0] == 'y')
        steadystate();

   if (satmode[0] == 'y')
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
	if (getflag("slpsat"))
		shaped_satpulse("relaxD",satdly,v2);
	else
        	satpulse(satdly,v2,rof1,rof1);
     }
   else
	delay(d1);

   status(B);

   pulse(p1,zero); 

   if (satmode[0] == 'y')
     {
        if (getflag("slpsat"))
           {
                shaped_satpulse("relaxD",d2,v2);
                if (getflag("prgflg"))
                   shaped_purge(v1,v2,v18,v19);
           }
        else
           {
                satpulse(d2,v2,rof1,rof1);
                if (getflag("prgflg"))
                   purge(v1,v2,v18,v19);
           }
     }
   else
     delay(d2); 
   rgpulse(pw,v1,rof1,rof2);

   status(C);
}
Exemplo n.º 20
0
pulsesequence()
{
        int  prgcycle = (int)(getval("prgcycle")+0.5);
        double cmult = getval("cmult");

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

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

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

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

        if (getflag("prgflg") && (satmode[0] == 'y'))
	   assign(v1,v4);

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

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

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

status(A);

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

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

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


status(B);
	rgpulse(pw, v1, rof1, rof1);
	delay(d2); 
	rgpulse(cmult*pw, v2, rof1, rof2);

status(C);
}
Exemplo n.º 21
0
pulsesequence()
{
  double mix = getval("mix"),
	 pw180 = 0.0,
	 tpwr_cf = getval("tpwr_cf"),
         j1xh = getval("j1xh"), 
         hsglvl = getval("hsglvl"),
         hsgt = getval("hsgt"),
         gzlvlE = getval("gzlvlE"),
         gtE = getval("gtE"),
         EDratio = getval("EDratio"),
         gstab = getval("gstab"),
	 pwxlvl = getval("pwxlvl"),
	 pwx = getval("pwx"),
	 taua=getval("taua");       /* asap delay ca 0.3/J */
  char   asap[MAXSTR], adiabatic[MAXSTR],lkgate_flg[MAXSTR],cmd[MAXSTR];
  int    ncycles=0, icosel=1,
         iphase = (int)(getval("phase")+0.5);

  getstr("asap",asap);    
  getstr("adiabatic",adiabatic);    
  getstr("lkgate_flg",lkgate_flg);
  if(j1xh<1.0) j1xh=150.0;
   
  if (FIRST_FID)
  {
    if(adiabatic[A] == 'y')
      ad180 = pbox_ad180("ad180", pwx, pwxlvl);    /* make adiabatic 180 */
    sprintf(cmd, "Pbox wu2mix -u %s -w \"WURST2m 20k/0.4m\" -p %.0f -l %.2f -s 2.0",userdir,
    tpwr, 1.0e6*pw*tpwr_cf);
    system(cmd);
    mixsh = getDsh("wu2mix");
  }

  if(adiabatic[A] == 'y')
    pw180 = ad180.pw;

  ncycles = (int) (0.5 + mix/mixsh.pw);

  if ((0.5/j1xh) < (gtE+gstab))
  {
    text_error("0.5/1jxh must be greater than gtE+gstab\n");
    psg_abort(1);
  }

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

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

  if (iphase == 2)
    icosel = -1;

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

  status(A);
  
     if (lkgate_flg[0] == 'y')  lk_hold(); /* turn lock sampling off */
     if (asap[A] == 'y')
     {
        mix = 7.0e-5 + 2.0*POWER_DELAY + 2.0*hsgt + mixsh.pw*ncycles;
        delay(1.0e-5);
        obspower(mixsh.pwr);
        zgradpulse(hsglvl,hsgt);
        delay(5.0e-5);

        obsunblank(); xmtron();
        obsprgon(mixsh.name, 1.0/mixsh.dmf, mixsh.dres);
        delay(mixsh.pw*ncycles);
	obsprgoff(); obsblank();
        xmtroff(); 

           
        delay(1.0e-5);
        zgradpulse(hsglvl,hsgt);
        obspower(tpwr);
        delay(d1 - mix);
      }
      else
      {
        delay(1.0e-5);
        obspower(tpwr);
        zgradpulse(hsglvl,2.0*hsgt);
        rgpulse(pw, zero, rof1, rof1);
        zgradpulse(hsglvl,hsgt);
        rgpulse(pw, one, rof1, rof1);
        zgradpulse(0.5*hsglvl,hsgt);
        delay(d1 - 2.0*hsgt - 4.0*rof1 - 2.0*pw - 1.0e-5 - POWER_DELAY);
      }


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

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

  status(B);
     decpower(pwxlvl);

      if (asap[0] == 'y')
      {
        rgpulse(pw,zero,rof1,rof1);
        delay(taua/2.0 - pw - 2.0*rof1 + pw180/2.0);
	if(adiabatic[A] == 'y')
	{
          rgpulse(2.0*pw,two,rof1,0.0);
          decshaped_pulse(ad180.name,ad180.pw,zero,0.0,rof1);
	}
	else
          simpulse(2.0*pw,2.0*pwx,two,zero,rof1,rof1); 
        delay(taua/2.0 - pw - 2.0*rof1 - pw180/2.0);
        simpulse(pw,pwx,zero,v1,rof1,1.0e-6);
      }
      else
      {
        rgpulse(pw,zero,rof1,rof1);
        delay(taua - rof1 - (2*pw/PI));
        decrgpulse(pwx,v1,rof1,1.0e-6);
      }
      delay(gtE + 2*gstab + 2*GRADIENT_DELAY - (2*pwx/PI) - pwx - 1.0e-6 - rof1);
      if(adiabatic[A] == 'y')
        decshaped_pulse(ad180.name,ad180.pw,v4,rof1,1.0e-6);
      else
        decrgpulse(2*pwx,v4,rof1,1.0e-6); 
      delay(gstab - pwx - 1.0e-6);
      zgradpulse(gzlvlE,gtE);
      delay(gstab - rof1 - pw);
      delay(d2/2);
      rgpulse(2.0*pw,zero,rof1,rof1);
      delay(d2/2);

      delay(gstab - rof1 - pw);
      zgradpulse(gzlvlE,gtE);
      delay(gstab - pwx - rof1);
      if(adiabatic[A] == 'y')
        decshaped_pulse(ad180.name,ad180.pw,zero,rof1,1.0e-6);
      else
        decrgpulse(2*pwx,zero,rof1,1.0e-6); 
      delay(gtE + 2*gstab + 2*GRADIENT_DELAY - (2*pwx/PI) - pwx - 1.0e-6 - rof1);
      decrgpulse(pwx,t2,rof1,rof1);
      if(asap[0] == 'y')
      {
        delay(0.25/j1xh + ad180.pw/2.0);    
        if(adiabatic[A] == 'y')
	{
          rgpulse(2.0*pw,zero,rof1,0.0);
          decshaped_pulse(ad180.name,ad180.pw,zero,0.0,rof1);
	}
	else
          simpulse(2.0*pw,2.0*pwx,zero,zero,rof1,rof1); 	
        delay(0.1*gstab - rof1);
        if(EDratio > 4)
        {
          zgradpulse(icosel*gzlvlE/EDratio*4.0,gtE/2.0);
          delay(0.25/j1xh - ad180.pw/2.0 - gtE/2.0 - 0.1*gstab - 2*GRADIENT_DELAY);
        }
        else
        {
          zgradpulse(icosel*gzlvlE/EDratio*2.0,gtE);
          delay(0.25/j1xh - ad180.pw/2.0 - gtE - 0.1*gstab - 2*GRADIENT_DELAY);
        }
      }
      else
      {
        delay(0.1*gstab - rof1);
        if(EDratio > 4)
        {
          zgradpulse(icosel*gzlvlE/EDratio*4.0,gtE/2.0);
          delay(0.5/j1xh - gtE/2.0 - 0.1*gstab - 2*GRADIENT_DELAY);
        }
        else
        {
          zgradpulse(icosel*gzlvlE/EDratio*2.0,gtE);
          delay(0.5/j1xh - gtE - 0.1*gstab - 2*GRADIENT_DELAY);
        }
      }
      if (lkgate_flg[0] == 'y') lk_sample(); /* turn lock sampling on */
      decpower(dpwr);
      delay(rof2 - POWER_DELAY);
      
  status(C);
} 
Exemplo n.º 22
0
pulsesequence()

{

   double   gzlvlE = getval("gzlvlE"),
            gtE = getval("gtE"),
            EDratio = getval("EDratio"),
            gstab = getval("gstab"),
            mult = getval("mult"),
	    pwx180 = getval("pwx180"),
	    pwxlvl180 = getval("pwxlvl180"),
	    pwx180r = getval("pwx180r"),
	    pwxlvl180r = getval("pwxlvl180r"),
            tpwr180 = getval("tpwr180"),
            pw180 = getval("pw180"),
            hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            gzlvl5 = getval("gzlvl5"),
            tau,
            taug;
   int      icosel,
	    phase1 = (int)(getval("phase")+0.5),
            prgcycle = (int)(getval("prgcycle")+0.5),
	    ZZgsign;
   char	    pwx180ad[MAXSTR],
	    pwx180ref[MAXSTR],
	    bipflg[MAXSTR],
	    pw180ad[MAXSTR];

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

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

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

  if (mult > 0.5)
    taug = 2*tau + getval("tauC");
  else
    taug = gtE + gstab + 2 * GRADIENT_DELAY;
  ZZgsign=-1; 
  if (mult == 2) ZZgsign=1;
  icosel = 1;
 
  assign(ct,v17);
  assign(zero,v18);
  assign(zero,v19);

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

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

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

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

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

status(A);
   obspower(tpwr);

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

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

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

   obspower(tpwr);
   decpower(pwxlvl180);

  status(B);

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

    rgpulse(pw, v6, rof1, rof1);
    obspower(tpwr180);
    shaped_pulse(pw180ad,pw180,zero,rof1,rof1);
    delay(tau+2.0*POWER_DELAY+2.0*rof1);
    simshaped_pulse(pw180ad,pwx180ad,pw180,pwx180,zero,zero,rof1,rof1);
    delay(tau);
    obspower(tpwr);
    rgpulse(pw, v1, rof1, rof1);
    zgradpulse(hsglvl, 2 * hsgt);
    decpower(pwxlvl);
    obspower(tpwr180);
    delay(1e-3);
    decrgpulse(pwx, v2, rof1, 2.0e-6);

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

    delay(taug - POWER_DELAY);
    decpower(pwxlvl180r);
    decshaped_pulse(pwx180ref, pwx180r, zero, rof1, rof1);

    if(mult < 1.5)
      {
       obspower(tpwr);
       if (mult <0.5)
         delay(2*rof1);
       else
         rgpulse(mult*pw,zero,rof1,rof1);
      }
    else
      shaped_pulse(pw180ad,pw180,zero,rof1,rof1);

    if(mult < 1.5)
      delay(4*pwx/PI + 4.0e-6 + taug - gtE - gstab - 2 * GRADIENT_DELAY + WFG_START_DELAY + pw180 + WFG_STOP_DELAY - mult*pw);
    else
      delay(4*pwx/PI + 4.0e-6 + POWER_DELAY + taug  - gtE - gstab - 2 * GRADIENT_DELAY);

    zgradpulse(gzlvlE, gtE);
    delay(gstab);
    decshaped_pulse(pwx180ref, pwx180r, zero, rof1, rof1);
    decpower(pwxlvl);

    decrgpulse(pwx, v4, 2.0e-6, rof1);
    obspower(tpwr);
    decpower(pwxlvl180);
    zgradpulse(ZZgsign*0.6 * hsglvl, 1.2 * hsgt);
    delay(1e-3);

    rgpulse(pw, v3, rof1, rof1);
    obspower(tpwr180);
    shaped_pulse(pw180ad,pw180,zero,rof1,rof1);
    zgradpulse(gzlvl5,gtE/2.0);
    delay(tau-gtE/2.0+2.0*POWER_DELAY);
    simshaped_pulse(pw180ad,pwx180ad,pw180,pwx180,zero,zero,rof1,rof2);
    zgradpulse(gzlvl5+icosel * 2.0*gzlvlE/EDratio, gtE/2.0);
    delay(tau-gtE/2.0);
    decpower(dpwr);

  status(C);
}
Exemplo n.º 23
0
pulsesequence()

{

   double   hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            tau,
            evolcorr,
	    mixN = getval("mixN"),
	    mixNcorr,
	    pwx180 = getval("pwx180"),
	    pwxlvl180 = getval("pwxlvl180"),
	    selpwxA = getval("selpwxA"),
	    selpwxlvlA = getval("selpwxlvlA"),
	    gzlvlA = getval("gzlvlA"),
	    gtA = getval("gtA"),
	    selpwxB = getval("selpwxB"),
	    selpwxlvlB = getval("selpwxlvlB"),
	    gzlvlB = getval("gzlvlB"),
	    gtB = getval("gtB"),
	    gstab = getval("gstab"),
            gzlvl1 = getval("gzlvl1"),
            gt1 = getval("gt1"),
            zqfpw1 = getval("zqfpw1"),
            zqfpwr1 = getval("zqfpwr1"),
            gzlvlzq1 = getval("gzlvlzq1"),
	    impress = getval("impress"),
            null = getval("null");
  int	    phase1 = (int)(getval("phase")+0.5),
            prgcycle = (int)(getval("prgcycle")+0.5),
	    iimphase = (int)(getval("imphase")+0.5);
  char      pwx180ad[MAXSTR],
	    selpwxshpA[MAXSTR],
	    selpwxshpB[MAXSTR],
            pwx180adR[MAXSTR],
            satmode[MAXSTR],
            zqfpat1[MAXSTR],
            wet[MAXSTR];


  getstr("pwx180ad", pwx180ad);
  getstr("pwx180adR", pwx180adR);
  getstr("selpwxshpA", selpwxshpA);
  getstr("selpwxshpB", selpwxshpB);
  getstr("satmode", satmode);
  getstr("zqfpat1", zqfpat1);
  getstr("wet", wet);
  evolcorr=(4*pwx/PI)+2*pw+8.0e-6;

        mixNcorr = gt1 + gstab;
        if (getflag("Gzqfilt"))
                mixNcorr += gstab + zqfpw1;
        if (wet[1] == 'y')
                mixNcorr += 4*(getval("pwwet")+getval("gtw")+getval("gswet"));
   if (mixNcorr > mixN)
        mixN=mixNcorr;

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

  if (impress > 0.5)
  {
    selpwxA = getval("imppw1");
    selpwxlvlA = getval("imppwr1");
    getstr("impshp1", selpwxshpA);
    if (iimphase == 1)
    {
    	selpwxB = getval("imppw1");
	selpwxlvlB = getval("imppwr1");
	getstr("impshp1",selpwxshpB);
    }
    if (iimphase == 2)
    {
        selpwxB = getval("imppw2");
        selpwxlvlB = getval("imppwr2");
        getstr("impshp2",selpwxshpB);
    }
    if (iimphase == 3)
    {
        selpwxB = getval("imppw3");
        selpwxlvlB = getval("imppwr3");
        getstr("impshp3",selpwxshpB);
    }
    if (iimphase == 4)
    {
        selpwxB = getval("imppw4");
        selpwxlvlB = getval("imppwr4");
        getstr("impshp4",selpwxshpB);
    }
  }

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

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

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

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

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

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

  if (impress > 0.5)
  {
        if (getflag("fadflg"))
        {
                add(v2, v14, v2);
                add(oph, v14, oph);
        }
  }
  else
        {
                add(v2, v14, v2);
                add(oph, v14, oph);
        }


  status(A);

   obspower(tpwr);

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

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

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

   decpower(pwxlvl);

  status(B);

    if ((getflag("PFGflg")) && (getflag("nullflg")))
    {
        rgpulse(0.5 * pw, zero, rof1, rof1);
        delay(2 * tau);
        decpower(pwxlvl180);
        decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
        rgpulse(2.0 * pw, zero, rof1, rof1);
        delay(2 * tau + 2 * POWER_DELAY);
        decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
        decpower(pwxlvl);
        rgpulse(1.5 * pw, two, rof1, rof1);
        zgradpulse(hsglvl, hsgt);
        delay(1e-3);
    }
    else if (null != 0.0)
    {
        rgpulse(pw, zero, rof1, rof1);
        delay(2 * tau);
        decpower(pwxlvl180);
        decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
        rgpulse(2.0 * pw, zero, rof1, rof1);
        delay(2 * tau + 2 * POWER_DELAY);
        decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
        decpower(pwxlvl);
        rgpulse(pw, two, rof1, rof1);
        if (satmode[1] == 'y')
        {
	   if (getflag("slpsat"))
                shaped_satpulse("BIRDnull",null,zero);
           else
                satpulse(null,zero,rof1,rof1);
        }
	else
	   delay(null);
    }

    rgpulse(pw, v6, rof1, rof1);
    delay(tau);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    rgpulse(2.0 * pw, zero, rof1, rof1);
    delay(tau + 2 * POWER_DELAY);
    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
    decpower(pwxlvl);
    rgpulse(pw, t1, rof1, rof1);
    if (getflag("PFGflg"))
    {
      zgradpulse(hsglvl, 2 * hsgt);
      delay(1e-3);
    }
    decrgpulse(pwx, v2, rof1, 2.0e-6);
      delay(d2 / 2);
    rgpulse(2 * pw, zero, 2.0e-6, 2.0e-6);
      delay(d2 / 2);

      zgradpulse(gzlvlA,gtA);
      delay(gstab);
      decpower(selpwxlvlA);
      decshaped_pulse(selpwxshpA, selpwxA, zero, rof1, rof1);
      decpower(pwxlvl);
      zgradpulse(gzlvlA,gtA);
      delay(gstab + evolcorr);

      zgradpulse(gzlvlB,gtB);
      delay(gstab);
      decpower(selpwxlvlB);
      decshaped_pulse(selpwxshpB, selpwxB, zero, rof1, rof1);
      decpower(pwxlvl);
      zgradpulse(gzlvlB,gtB);
      delay(gstab);

    decrgpulse(pwx, t4, 2.0e-6, rof1);
    if (getflag("PFGflg"))
    {
      zgradpulse(0.6 * hsglvl, 1.2 * hsgt);
      delay(1e-3);
    }
    rgpulse(pw, t3, rof1, rof1);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180adR, pwx180, zero, rof1, rof1);
    decpower(dpwr);
    delay(tau);
    rgpulse(2 * pw, zero, rof1, rof1);
    decpower(pwxlvl180);
    decshaped_pulse(pwx180ad, pwx180, zero, rof1, rof1);
    decpower(dpwr);
    delay(tau);

    rgpulse(pw,three,rof1,rof1);
      if (satmode[1] == 'y')
        {
        if (getflag("slpsat"))
                shaped_satpulse("mixN1",(mixN-mixNcorr)*0.7,zero);
        else
                satpulse((mixN-mixNcorr)*0.7,zero,rof1,rof1);
        }
      else
        delay((mixN - mixNcorr)*0.7);

        if (getflag("Gzqfilt"))
        {
         obspower(zqfpwr1);
         rgradient('z',gzlvlzq1);
         delay(100.0e-6);
         shaped_pulse(zqfpat1,zqfpw1,zero,rof1,rof1);
         delay(100.0e-6);
         rgradient('z',0.0);
         delay(gstab);
         obspower(tpwr);
        }
        zgradpulse(gzlvl1,gt1);
        delay(gstab);
      if (satmode[1] == 'y')
        {
        if (getflag("slpsat"))
                shaped_satpulse("mixN2",(mixN-mixNcorr)*0.3,zero);
        else
                satpulse((mixN-mixNcorr)*0.3,zero,rof1,rof1);
        }
      else
        delay((mixN - mixNcorr)*0.3);
      if (wet[1] == 'y')
        wet4(zero,one);

      rgpulse(pw,one,rof1,rof2);

  status(C);
}
Exemplo n.º 24
0
void pulsesequence()
{
  double   tpwr180r = getval("tpwr180r"),
           pw180r = getval("pw180r"),
	   pwx180 = getval("dnbippw"),
	   pwxlvl180 = getval("dnbippwr"),
           pp = getval("pp"),
           pplvl = getval("pplvl"),
	   tauC = getval("tauC"),
	   tau;
  int      prgcycle=(int)(getval("prgcycle")+0.5);
  char     pw180ref[MAXSTR],
	   dnbipshp[MAXSTR],
	   bipflg[MAXSTR];

  getstr("pw180ref", pw180ref);
  getstr("dnbipshp", dnbipshp);
  getstr("bipflg",bipflg);
  tau    = 1.0 / (2.0 * (getval("j1xh")));

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

  if (getflag("prgflg") && getflag("satmode") && (prgcycle > 1.5))
    {
        hlv(ct,v17);
        mod2(ct,v18); dbl(v18,v18);
        if (prgcycle > 2.5)
           {
                hlv(v17,v17);
                hlv(ct,v19); mod2(v19,v19); dbl(v19,v19);
           }
     }

  settable(t1,4,phs1);
  settable(t2,8,phs2);
  settable(t3,4,phs3);
  getelem(t1,v17,v1);
  getelem(t2,v17,v2);
  getelem(t3,v17,v3);
  assign(v1,oph);
  add(oph,v18,oph);
  add(oph,v19,oph);

  if (getflag("prgflg") && getflag("satmode"))
        assign(v3,v2);

   /* equilibrium period */
   status(A);

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

   if (getflag("satmode"))
     {
        if ((d1-satdly) > 0.02)
                delay(d1-satdly);
        else
                delay(0.02);
        if (getflag("slpsat"))
           {
                shaped_satpulse("relaxD",satdly,v2);
                if (getflag("prgflg"))
                   shaped_purge(v1,v2,v18,v19);
           }
        else
           {
                satpulse(satdly,v2,rof1,rof1);
                if (getflag("prgflg"))
                   purge(v1,v2,v18,v19);
           }
     }
   else
	delay(d1);

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

   status(B);

	obspower(tpwr);
	if (bipflg[1] == 'y')
	    decpower(pwxlvl180);
	else
	    decpower(pplvl);

        rgpulse(pw,v1,rof1,rof1);
	if (bipflg[1] == 'y')
	    { 
		decshaped_pulse(dnbipshp,pwx180,zero,2.0e-6,2.0e-6);
		delay(tau+tauC);
	    }
	else
	    {
	    	decrgpulse(2*pp,zero,2.0e-6,2.0e-6);
		delay(tau);
	    }
	obspower(tpwr180r);
	shaped_pulse(pw180ref,pw180r,v1,rof1,rof1);
        if (bipflg[1] == 'y')
            { 
                decshaped_pulse(dnbipshp,pwx180,zero,2.0e-6,2.0e-6);
                delay(tau+tauC);
            }
        else
            {
                decrgpulse(2*pp,zero,2.0e-6,2.0e-6);
                delay(tau);
            }

        shaped_pulse(pw180ref,pw180r,v1,rof1,rof2);
	decpower(dpwr);
	obspower(tpwr);

   status(C);
}
Exemplo n.º 25
0
pulsesequence()
{
   double  hsglvl = getval("hsglvl"),
             hsgt = getval("hsgt"),
           satpwr = getval("satpwr"),
           satdly = getval("satdly"),
           tpwr180 = getval("tpwr180"),
           pw180 = getval("pw180"),
           pp = getval("pp"),
           pplvl = getval("pplvl");
   int     prgcycle = (int)(getval("prgcycle")+0.5);
   char    sspul[MAXSTR],satmode[MAXSTR],wet[MAXSTR],pw180ad[MAXSTR];

   getstr("satmode",satmode);
   getstr("sspul", sspul);
   getstr("wet",wet);
   getstr("pw180ad",pw180ad);

  assign(ct,v17);

 
   settable(t1,4,ph1);     getelem(t1,v17,v1);
   settable(t2,8,ph2);     getelem(t2,v17,v2);
   assign(v1,oph);

/* BEGIN ACTUAL SEQUENCE */
   status(A);
      obspower(tpwr);
 
   delay(5.0e-5);
   if (getflag("sspul"))
	steadystate();

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

     }
   else
	delay(d1);

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

   status(B);
      rgpulse(pw, v1, rof1, rof1);
      decpower(pplvl);
      obspower(tpwr180);
      delay(d2/2);
      simshaped_pulse(pw180ad,"",pw180,pp*2,v2,v2,rof1,2*rof1); 
      delay(d2/2);
      decpower(dpwr);
      obspower(tpwr);
   status(C);
}
Exemplo n.º 26
0
pulsesequence()

{
   double   hsglvl = getval("hsglvl"),
            hsgt = getval("hsgt"),
            tau,
            evolcorr,
	    taug,
	    mult = getval("mult"),
	    null = getval("null");
   int	    phase1 = (int)(getval("phase")+0.5),
            prgcycle = (int)(getval("prgcycle")+0.5),
	    ZZgsign;

   tau  = 1/(4*(getval("j1xh")));
   if (mult > 0.5)
    taug = 2*tau;
   else
    taug = 0.0;
   evolcorr=2*pw+4.0e-6;
   ZZgsign=-1;
   if (mult == 2) ZZgsign=1;

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

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

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

  getelem(t1, v17, v1);
  getelem(t3, v17, v3);
  getelem(t4, v17, v4);
  getelem(t2, v17, v2);
  getelem(t5, v17, oph);

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

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

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

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

   if (mult > 0.5) 
	add(oph,two,oph);

   status(A);
   obspower(tpwr);

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

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

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

   decpower(pwxlvl);

    status(B);

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

     rgpulse(pw,v6,rof1,rof1);
     delay(tau);
     simpulse(2*pw,2*pwx,zero,zero,rof1,rof1);
     delay(tau);
     rgpulse(pw,v1,rof1,rof1);
     if (getflag("PFGflg"))
     {
	zgradpulse(hsglvl,2*hsgt);
	delay(1e-3);
     }
     decrgpulse(pwx,v2,rof1,2.0e-6);

     if (mult > 0.5)
     {
	delay(d2/2);
	rgpulse(2*pw,zero,2.0e-6,2.0e-6);
	delay(d2/2);
     delay(taug);
     simpulse(mult*pw,2*pwx,zero,zero,rof1,rof1);
     delay(taug + evolcorr);
     }
     else
     {
     if (d2/2 > 0.0)
      delay(d2/2 - (2*pwx/PI) - pw - 4.0e-6);
     else
      delay(d2/2);
     rgpulse(2*pw,zero,2.0e-6,2.0e-6);
     if (d2/2 > 0.0)
      delay(d2/2 - (2*pwx/PI) - pw - 4.0e-6);
     else
      delay(d2/2);
     }

     decrgpulse(pwx,v4,2.0e-6,rof1);
     if (getflag("PFGflg"))
     {
	zgradpulse(ZZgsign*0.6*hsglvl,1.2*hsgt);
	delay(1e-3);
     }
     rgpulse(pw,v3,rof1,rof1);
     delay(tau - (2*pw/PI) - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof2);
     decpower(dpwr);
     delay(tau - POWER_DELAY);
   status(C);
}
Exemplo n.º 27
0
pulsesequence()
{
   double          selpwrA = getval("selpwrA"),
                   selpwA = getval("selpwA"),
                   gzlvlA = getval("gzlvlA"),
                   gtA = getval("gtA"),
                   selpwrB = getval("selpwrB"),
                   selpwB = getval("selpwB"),
                   gzlvlB = getval("gzlvlB"),
                   gtB = getval("gtB"),
                   gstab = getval("gstab"),
                   slpwrR = getval("slpwrR"),
                   slpwR = getval("slpwR"),
                   mixR = getval("mixR"),
                   gzlvlz = getval("gzlvlz"),
                   gtz = getval("gtz"),
		   alfa1,
		   t1dly,
		   zfphinc = getval("zfphinc");
   char		   slpatR[MAXSTR],
                   selshapeA[MAXSTR],
                   selshapeB[MAXSTR];
   int             phase1 = (int)(getval("phase")+0.5),
                   prgcycle = (int)(getval("prgcycle")+0.5);

//synchronize gradients to srate for probetype='nano'
//   Preserve gradient "area"
        gtA = syncGradTime("gtA","gzlvlA",1.0);
        gzlvlA = syncGradLvl("gtA","gzlvlA",1.0);
        gtB = syncGradTime("gtB","gzlvlB",1.0);
        gzlvlB = syncGradLvl("gtB","gzlvlB",1.0);

/* LOAD AND INITIALIZE PARAMETERS */
   getstr("selshapeA",selshapeA);
   getstr("selshapeB",selshapeB);
   getstr("slpatR",slpatR);

   alfa1 = POWER_DELAY + (2*pw/PI) + rof1;
   if (getflag("homodec"))
        alfa1 = alfa1 + 2.0e-6 + 2*pw;
   t1dly = d2-alfa1;
   if (t1dly > 0.0)
        t1dly = t1dly;
   else
        t1dly = 0.0;

   if (strcmp(slpatR,"cw") &&
        strcmp(slpatR,"troesy") &&
        strcmp(slpatR,"dante"))
        abort_message("SpinLock pattern %s not supported!.\n", slpatR);

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

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

   settable(t1,4,ph1);	getelem(t1,v17,v1);
   settable(t2,8,ph2);	getelem(t2,v17,v20);
   settable(t3,8,ph3);	
   settable(t8,4,ph8);	getelem(t8,v17,v8);
   settable(t6,8,ph6);	getelem(t6,v17,v6);
  
   assign(v1,oph); 
   if (getflag("zfilt"))
	getelem(t3,v17,oph);

   assign(v20,v9);
   if (!strcmp(slpatR,"troesy"))
	assign(v20,v21);
   else
	add(v20,one,v21);

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

  if (getflag("prgflg") && (satmode[0] == 'y'))
	assign(v1,v6);
   if (phase1 == 2)
      {incr(v1); incr(v6);}			/* hypercomplex method */

  assign(v1,v11);
  add(v11,two,v12);
  assign(oph,v14);

/*
   mod2(id2,v13);
   dbl(v13,v13);
*/
  initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v13);

  if (getflag("fadflg"))
  {
       add(v1,v13,v1);
       add(v6,v13,v6);
       add(oph,v13,oph);
  }

  if (getflag("homodec"))
	add(oph,two,oph);

/* The following is for flipback pulse */
   zfphinc=zfphinc+180;
   if (zfphinc < 0) zfphinc=zfphinc+360;
   initval(zfphinc,v10);

/* BEGIN ACTUAL PULSE SEQUENCE */
   status(A);
      obspower(tpwr);

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

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

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

   status(B);
      rgpulse(pw, v1, rof1, rof1);
      if (getflag("homodec"))
       {
                delay(t1dly/2);
                rgpulse(2*pw,v14,1.0e-6,1.0e-6);
       }
      else
                delay(t1dly);

        zgradpulse(gzlvlA,gtA);
        delay(gstab);
        obspower(selpwrA);
        shaped_pulse(selshapeA,selpwA,v11,rof1,rof1);
        obspower(tpwr);
        zgradpulse(gzlvlA,gtA);
        delay(gstab);

      if (getflag("homodec"))
                delay(t1dly/2);

        zgradpulse(gzlvlB,gtB);
        delay(gstab);
        obspower(selpwrB);
        shaped_pulse(selshapeB,selpwB,v12,rof1,rof1);
        obspower(tpwr);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);
      
      obspower(slpwrR);

      if (mixR > 0.0)
      {
        if (dps_flag)
          	rgpulse(mixR,v21,0.0,0.0);
        else
          SpinLock(slpatR,mixR,slpwR,v21);
      }

       if ((getflag("zfilt")) && (getflag("PFGflg")))
        {
           obspower(tpwr);
           rgpulse(pw,v9,1.0e-6,rof1);
           zgradpulse(gzlvlz,gtz);
           delay(gtz/3);
           if (getflag("flipback"))
                FBpulse(v8,v10);
           rgpulse(pw,v8,rof1,rof2);
        }
       else
           delay(rof2);

   status(C);
}