示例#1
0
void pulsesequence()
{
   double pd, seqtime;
   double n,r,bigtau;
   double restol, resto_local;

   init_mri();

   restol=getval("restol");   //local frequency offset
   roff=getval("roff");       //receiver offset

   init_rf(&p1_rf,p1pat,p1,flip1,rof1,rof2);   /* hard pulse */
   calc_rf(&p1_rf,"tpwr1","tpwr1f");
   init_rf(&p2_rf,p2pat,p2,flip2,rof1,rof2);   /* hard pulse */
   calc_rf(&p2_rf,"tpwr2","tpwr2f");

/* calculate 'big tau' values */
   bigtau = getval("bigtau");
   n =  bigtau/(2.0*d2);
   n = (double)((int)((n/2.0) + 0.5)) * 2.0;
   initval(n,v3);

   seqtime = at+p1+rof1+rof2;
   seqtime += 2*d2+p2+rof1+rof2;  /* cpmg pulse and delay */
   
   pd = tr - seqtime;  /* predelay based on tr */
   if (pd <= 0.0) {
      abort_message("%s: Requested tr too short.  Min tr = %f ms",seqfil,seqtime*1e3);
    }

   resto_local=resto-restol; 

   status(A);
   delay(pd);
   xgate(ticks);
   
/* calculate exact delay and phases */

   r = d2-p2/2.0-rof2;   /* correct delay for pulse width */
   mod2(oph,v2);   /* 0,1,0,1 */
   incr(v2);   /* 1,2,1,2 = y,y,-y,-y */

   obsoffset(resto_local); 
   obspower(p1_rf.powerCoarse);
   obspwrf(p1_rf.powerFine);
   rgpulse(p1,oph,rof1,rof2);  /* 90deg */
   obspower(p2_rf.powerCoarse);
   obspwrf(p2_rf.powerFine);
   starthardloop(v3);
      delay(r);
      rgpulse(p2,v2,rof1,rof2);   /* 180deg pulse */
      delay(r);
   endhardloop();
   startacq(alfa);
   acquire(np,1.0/sw);
   endacq();
}
示例#2
0
pulsesequence()
{
   double pd, seqtime;
   double minte,ted1,ted2;
   double restol, resto_local;

   int  vph180     = v2;  /* Phase of 180 pulse */
   init_mri();              /****needed ****/

   restol=getval("restol");   //local frequency offset
   roff=getval("roff");       //receiver offset

   init_rf(&p1_rf,p1pat,p1,flip1,rof1,rof2);   /* hard pulse */
   calc_rf(&p1_rf,"tpwr1","tpwr1f");
   init_rf(&p2_rf,p2pat,p2,flip2,rof1,rof2);   /* hard pulse */
   calc_rf(&p2_rf,"tpwr2","tpwr2f");

   seqtime = at+(p1/2.0)+rof1+d2;

   pd = tr - seqtime;  /* predelay based on tr */
   if (pd <= 0.0) {
      abort_message("%s: Requested tr too short.  Min tr = %f ms",seqfil,seqtime*1e3);
    }
   minte = p1/2.0 + p2 + 2*rof2 + rof1;
   if(d2 > 0) {
     if(d2 < minte+4e-6) 
       abort_message("%s: TE too short. Min te = %f ms",seqfil,minte*1e3);
   }
   ted1 = d2/2 - p1/2 - p2/2 + rof2 + rof1;
   ted2 = d2/2 - p2/2 + rof2;
   resto_local=resto-restol; 

   status(A);
   xgate(ticks);
   delay(pd);

   /* --- observe period --- */
   obsoffset(resto_local);
   obspower(p1_rf.powerCoarse);
   obspwrf(p1_rf.powerFine);
   shapedpulse(p1pat,p1,oph,rof1,rof2);
   /* if d2=0 no 180 pulse applied */
   if (d2 > 0) {
     obspower(p2_rf.powerCoarse);
     obspwrf(p2_rf.powerFine);   
     settable(t2,2,ph180);        /* initialize phase tables and variables */
     getelem(t2,ct,v6);  /* 180 deg pulse phase alternates +/- 90 off the rcvr */
     add(oph,v6,vph180);      /* oph=zero */
     delay(ted1);
     shapedpulse(p2pat,p2,vph180,rof1,rof2);
     delay(ted2);
   }
   startacq(alfa);
   acquire(np,1.0/sw);
   endacq();
}
示例#3
0
pulsesequence()
{
  double sign,currentlimit,RMScurrentlimit,dutycycle;
  int calcpower;

  /* Initialize paramaters **********************************/
  init_mri();
  calcpower=(int)getval("calcpower");
  dutycycle=getval("dutycycle");
  currentlimit=getval("currentlimit");
  RMScurrentlimit=getval("RMScurrentlimit");

  if (gspoil>0.0) sign = 1.0;
  else sign = -1.0;

  init_rf(&p1_rf,p1pat,p1,flip1,rof1,rof2);
  if (calcpower) calc_rf(&p1_rf,"tpwr1","tpwr1f");

  if (tspoil>0.0) {
    gspoil = sqrt(dutycycle/100.0)*gmax*RMScurrentlimit/currentlimit;
    init_generic(&spoil_grad,"spoil",gspoil,tspoil);
    spoil_grad.rollOut=FALSE;
    calc_generic(&spoil_grad,WRITE,"gspoil","tspoil");
  }

  xgate(ticks);

  rotate();

  status(A);
  mod4(ct,oph);
  delay(d1);

  /* TTL scope trigger **********************************/       
  sp1on(); delay(4e-6); sp1off();

  if (calcpower) {
    obspower(p1_rf.powerCoarse);
    obspwrf(p1_rf.powerFine);
  } 
  else obspower(tpwr1);
  delay(4e-6);

  if (tspoil>0.0) {
    obl_shapedgradient(spoil_grad.name,spoil_grad.duration,0,0,spoil_grad.amp*sign,WAIT);
    delay(d2);
  }

  shapedpulse(p1pat,p1,ct,rof1,rof2);

  startacq(alfa);
  acquire(np,1.0/sw);
  endacq();
		
}
示例#4
0
pulsesequence()
{
   double pd, seqtime;

   initparms_sis();  /* initialize standard imaging parameters */

   seqtime = at+pw+rof1+rof2;
   pd = tr - seqtime;  /* predelay based on tr */
    if (pd <= 0.0) {
      abort_message("%s: Requested tr too short.  Min tr = %f ms",seqfil,seqtime*1e3);
    }

   status(A);
   delay(pd);
   xgate(ticks);

   /* --- observe period --- */
   obspower(tpwr);
   
   shapedpulse(pwpat,pw,oph,rof1,rof2);
   
   startacq(alfa);
   acquire(np,1.0/sw);
   endacq();
   
}
示例#5
0
void pulsesequence()
{
    char pwpat[MAXSTR],p1pat[MAXSTR];
    /* equilibrium period */
    getstr("pwpat",pwpat);
    if (pwpat[0] == '\0') 
    {
      abort_message("no pwpat? ABORT");
    }
    getstr("p1pat",p1pat);
    if (p1pat[0] == '\0')
    {
      abort_message("no p1pat? ABORT");
    }
      
    status(A);
    obspower(zero);
    decpower(tpwr);
    hsdelay(d1);
    rcvroff();

    status(B);
      if (is_y(rfwg[1])) decshaped_pulse(p1pat,p1,zero,rof1,rof2);
      else apshaped_decpulse(p1pat,p1,zero,t1,t2,rof1,rof2);
      hsdelay(d2);
    status(C);
      if (is_y(rfwg[1])) decshaped_pulse(pwpat,pw,oph,rof1,rof2);
      else apshaped_decpulse(pwpat,pw,oph,t1,t2,rof1,rof2);
}
示例#6
0
文件: sgl_ws2.c 项目: timburrow/ovj3
void watersuppress2() {
  int i;
  double ws_delta; // water suppresssion frequency, delta from transmitter

 // obspower(ws_rf.powerCoarse);
  ws_delta = getval("ws_delta"); 
  delay(4e-6);
  
   for (i=0; i<nwsp; i++) {
    obspower(ws_rf.powerCoarse);
    obspwrf(wsfpwr[i]);
  if (wsrf[0]=='y') //to play out the ws with/without the rf pulses
    {
    shapedpulseoffset(ws_rf.pulseName,ws_rf.rfDuration,zero,rof1,rof2,ws_delta);
    }
    else 
    {
    delay(ws_rf.rfDuration);
    }
    obl_shapedgradient(wscrush_grad.name,wscrush_grad.duration,
      kx[i]*wsgspoilamp[i],ky[i]*wsgspoilamp[i],kz[i]*wsgspoilamp[i],WAIT);
    delay(wsdel[i]);
    
    if (vapor_ovs[i])  /* Apply OVS after certain VAPOR pulses */
      ovsbands2();

  }
}
示例#7
0
文件: APTAD.c 项目: timburrow/ovj3
pulsesequence()
{
double	j1xh,
	d3,
        tpwr180 = getval("tpwr180"),
        pw180 = getval("pw180"),
	tau;
char    pw180ad[MAXSTR];

 j1xh = getval("j1xh");
 d3 = getval("d3");
 getstr("pw180ad",pw180ad);
 tau = 1/j1xh;

/* CALCULATE PHASE CYCLE */
   hlv(oph, v1);
   dbl(v1, v1);
   incr(v1);				/* v1=1133 */
   mod2(oph, v2);
   dbl(v2, v2);
   incr(v2);				/* v2=1313 */
   add(v1, oph, v1);
   sub(v1, one, v3);
   add(v2, oph, v2);
   sub(v2, one, v4);

/* ACTUAL PULSE SEQUENCE */
   status(A);		
      hsdelay(d1);
      obspower(tpwr);
   status(B);	
      rgpulse(pw, oph, rof1, rof1);
      delay(tau - rof1);
      obspower(tpwr180);
      shaped_pulse(pw180ad,pw180,v1,rof1,rof1);
   status(C);	
        delay(tau + d3 - rof1+2*POWER_DELAY);
	shaped_pulse(pw180ad,pw180,v2,rof1,rof2);
	obspower(tpwr);
        delay(d3);
}
示例#8
0
void pulsesequence()
{

  double pwx;
  char rcvrsflag[MAXSTR];

  pwx = getval("pwx");
  getstr("rcvrs",rcvrsflag);

  /* check decoupling modes */

  if ( (dm[C] == 'y') || (dm[D] == 'y') || (h**o[0] == 'y') )
  {
    printf("dm[C], dm[D] should be set to 'n' and/or h**o should set to 'n'");
    psg_abort(1);
  }

  if (strcmp(rcvrsflag,"yy"))
    printf("rcvrs parameter should be set to 'yy'\n");
  
  settable(t1,4,ph1);
  getelem(t1,ct,v1);
  assign(v1,oph);

  settable(t2,4,ph2);

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

  status(B);
  delay(d2);
  rgpulse(pw, t2, rof1, rof2);
 
  status(C);
  setactivercvrs("yn");
  startacq(alfa);
  acquire(np,1.0/sw);
  endacq();

  status(B);
  delay(d2);
  decrgpulse(pwx, t2, rof1, rof2);

  status(D);
  setactivercvrs("ny");
  startacq(alfa);
  acquire(np,1.0/sw);
  endacq();

}
示例#9
0
void pulsesequence()

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

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

   assign(zero,oph);

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

    status(B);

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

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

   status(C);
}
示例#10
0
void pulsesequence()
{
  char spinecho[MAXSTR];
  double gzlvl1,gt1,pwClvl,pwC;
  getstr("spinecho",spinecho);
  gzlvl1=getval("gzlvl1"); gt1=getval("gt1");
  pwClvl=getval("pwClvl"); pwC=getval("pwC");
    add(oph,one,v1);

  if(( rof2 < 10.0e-6) && (spinecho[A] =='n'))
   { text_error("Protect 13C preamp. Set rof2>10.0 for RF probe, >350 for cold probe");   	    psg_abort(1); }
  
 /* equilibrium period */
   status(A);
   obspower(pwClvl);
   delay(d1);

   /* --- tau delay --- */
   status(B);
   rgpulse(p1,zero,rof1,0.0);
   delay(d2);
   if (spinecho[A] =='n')
    rgpulse(pw, oph,rof1,rof2);
   else
    rgpulse(pw, oph,rof1,0.0);

   if (spinecho[A] == 'y') 
   {
    zgradpulse(gzlvl1,gt1);
    obspower(pwClvl);
    delay(d3-gt1-POWER_DELAY);
    rgpulse(2.0*pwC,v1,rof1,rof1);
    obspower(pwClvl);
    zgradpulse(gzlvl1,gt1);
    delay(d3-gt1-POWER_DELAY);
   }
  status(C);
}
示例#11
0
文件: sgl_ws2.c 项目: timburrow/ovj3
void ovsbands2() {
  int     amp[6][3],s,d, shape;
  double  freqlist[MAXNSAT];
  double  satamp[6];

  /* amp[satband][direction] is scaling on sat band slice gradient */
  /* For directions, 0 = Readout, 1 = Phase, 2 = Slice */
  /* Initialize all to zeros */
  for (s = 0; s < nsat; s++)  /* 6 sat bands */
    for (d = 0; d < 3; d++)   /* 3 directions: RO, PE, SS */
      amp[s][d] = 0;
      
  amp[0][0] = amp[1][0] = 1;  /* First two bands along readout */
  amp[2][1] = amp[3][1] = 1;  /* Next two bands along phase    */
  amp[4][2] = amp[5][2] = 1;  /* Last two bands along slice    */

  /* satamp is temporary array of satband gradients,
     necessary for offsetglist to work */
  for (s = 0; s < nsat; s++)
    satamp[s] = sat_grad.amp;

  if (ovs[0] == 'y') {
    offsetglist(satpos,satamp,0,freqlist,nsat,'i');
    shape = shapelist(satpat,sat_grad.duration,freqlist,nsat,sat_grad.rfFraction,'i');
    set_rotation_matrix(vpsi,vphi,vtheta);
    obspower(sat_rf.powerCoarse);
   // obspwrf(sat_rf.powerFine);
    delay(4e-6);

    /* Apply six sat bands, surrounding the voxel */
    /* The only thing changing is the orientation of the sat band gradient */
    for (s = 0; s < nsat; s++ ) { 
      obspwrf(satfpwr[s]);
      obl_shapedgradient(sat_grad.name,sat_grad.duration,
        sat_grad.amp*amp[s][0],
	sat_grad.amp*amp[s][1],
	sat_grad.amp*amp[s][2],NOWAIT);
      delay(sat_grad.rfDelayFront);
      shapedpulselist(shape,sat_grad.rfDuration,oph,rof1,rof2,'i',s);
      delay(sat_grad.rfDelayBack);

      obl_shapedgradient(satcrush_grad.name,satcrush_grad.duration,
	satcrush_grad.amp*amp[s][0],
	satcrush_grad.amp*amp[s][1],
	satcrush_grad.amp*amp[s][2],WAIT);
    }	  

  }  /* end if ovs */
}
示例#12
0
void pulsesequence()
{
  double pwClvl,gzlvl1,gt1;
  gzlvl1=getval("gzlvl1"); gt1=getval("gt1");
  pwClvl=getval("pwClvl");
    add(oph,one,v1);
   /* equilibrium period */
   status(A);
   obspower(pwClvl);
   hsdelay(d1);

   /* --- tau delay --- */
   status(B);
   rgpulse(pw, oph,rof1,0.0);
   txphase(zero);
   zgradpulse(gzlvl1,gt1);
   delay(d2-gt1);
   rgpulse(p1,v1,0.0,0.0);
   zgradpulse(gzlvl1,gt1);
   delay(d2-gt1);
  status(C);
}
示例#13
0
文件: C13gcosy.c 项目: timburrow/ovj3
pulsesequence()
{
	double	gzlvl1,pwClvl,
		gt1,
		gstab;

	gzlvl1 = getval("gzlvl1");
	gt1 = getval("gt1");
	gstab = getval("gstab");
        pwClvl = getval("pwClvl");

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

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

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

status(A);
        obspower(pwClvl);
        delay(d1); 

status(B);
	rgpulse(pw, v1, rof1, rof1);
	delay(d2); 
	zgradpulse(gzlvl1,gt1);
	delay(gstab);
	rgpulse(pw, v2, rof1, rof2);
	zgradpulse(gzlvl1,gt1);
	delay(gstab);

status(C);
}
示例#14
0
pulsesequence()
{
 char    
    f1180[MAXSTR],    
    f2180[MAXSTR],
    mag_flg[MAXSTR];  /* y for magic angle, n for z-gradient only  */

 int        
    icosel,
    t1_counter,   
    t2_counter;   

 double      
    ni2,  
    ratio,        /* used to adjust t1 semi-constant time increment */
    tau1,       
    tau2,       
    taua,         /*  ~ 1/4JCH =  1.5 ms - 1.7 ms]        */
    taub,         /*  ~ 3.3 ms          */
    bigTC,        /*  ~ 8 ms            */
    bigTCO,       /*  ~ 6 ms           */
    bigTN,        /*  ~ 12 ms           */
    tauc,         /*  ~ 5.4 ms          */
    taud,         /*  ~ 2.3 ms          */
    gstab,         /*  ~0.2 ms, gradient recovery time     */

    pwClvl,   /* High power level for carbon on channel 2 */
    pwC,      /* C13 90 degree pulse length at pwClvl     */

    compH,     /* Compression factor for H1 on channel 1  */
    compC,     /* Compression factor for C13 on channel 2  */
    pwNlvl,   /* Power level for Nitrogen on channel 3    */
    pwN,      /* N15 90 degree pulse lenght at pwNlvl     */
    maxpwCN,
    bw, ofs, ppm, /* bandwidth, offset, ppm - temporary Pbox parameters */
    pwCa90,   /*90 "offC13" pulse at Ca(56ppm) xmtr at CO(174ppm) */
    pwCa180,  /*180 "offC17" pulse at Ca(56ppm) xmtr at CO(174ppm) */
    pwCO90,   /* 90 "offC6" pulse at CO(174ppm) xmtr at CO(174ppm)*/
    pwCO180,  /* 180 "offC8" pulse at CO(174ppm) xmtr at CO(174ppm)*/
    pwCab180, /* 180 "offC27" pulse at Cab(46ppm) xmtr at CO(174ppm)*/

    tpwrHd,   /* Power level for proton decoupling on channel 1  */
    pwHd,     /* H1 90 degree pulse lenth at tpwrHd.             */
    waltzB1 = getval("waltzB1"),  /* waltz16 field strength (in Hz)     */

    phi_CO,   /* phase correction for Bloch-Siegert effect on CO */
    phi_Ca,   /* phase correction for Bloch-Siegert effect on Ca */

    gt1,
    gt2,
    gt3,
    gt4, 
    gt5,
    gt6,
    gt7,
    gt0,

    gzlvl1,  
    gzlvl2,   
    gzlvl3,
    gzlvl4, 
    gzlvl5,
    gzlvl6,   /* N15 selection gradient level in DAC units */
    gzlvl7,
    gzlvl0,   /* H1 gradient level in DAC units            */
    gzcal,    /* gradient calibration (gcal)               */
    dfCa180,
    dfCab180,
    dfC90,
    dfCa90,
    dfCO180;
 
         
/* LOAD VARIABLES */

    getstr("f1180",f1180);
    getstr("f2180",f2180);
    getstr("mag_flg", mag_flg);

    gzcal  = getval("gzcal");
      ni2  = getval("ni2");
    taua   = getval("taua"); 
    taub   = getval("taub");
    tauc = getval("tauc");
    bigTC = getval("bigTC");
    bigTCO = getval("bigTCO");
    bigTN = getval("bigTN");
    taud = getval("taud");
    gstab = getval("gstab");
  
    pwClvl = getval("pwClvl");
    pwC = getval("pwC");
    compH = getval("compH");
    compC = getval("compC");

    pwNlvl = getval("pwNlvl");
    pwN = getval("pwN");

    phi_CO = getval("phi_CO");
    phi_Ca = getval("phi_Ca");

    gt1 = getval("gt1");
    gt2 = getval("gt2");
    gt3 = getval("gt3");
    gt4 = getval("gt4");
    gt5 = getval("gt5");
    gt6 = getval("gt6");
    gt7 = getval("gt7");
    gt0 = getval("gt0");
 
    gzlvl1 = getval("gzlvl1");
    gzlvl2 = getval("gzlvl2");
    gzlvl3 = getval("gzlvl3");
    gzlvl4 = getval("gzlvl4");
    gzlvl5 = getval("gzlvl5");
    gzlvl6 = getval("gzlvl6");
    gzlvl7 = getval("gzlvl7");
    gzlvl0 = getval("gzlvl0");

    setautocal();                        /* activate auto-calibration flags */ 
        
    if (autocal[0] == 'n') 
    { 
      pwCa90 = getval("pwCa90");
      pwCa180 = getval("pwCa180");
      pwCab180 = getval("pwCab180");
      pwCO90 = getval("pwCO90");
      pwCO180 = getval("pwCO180");

      dfCa180 = (compC*4095.0*pwC*2.0*1.69)/pwCa180;           /*power for "offC17" pulse*/
      dfCab180 = (compC*4095.0*pwC*2.0*1.69)/pwCab180;       /*power for "offC27" pulse*/
      dfC90  = (compC*4095.0*pwC*1.69)/pwCO90;                  /*power for "offC6" pulse */
      dfCa90  = (compC*4095.0*pwC)/pwCa90;                     /*power for "offC13" pulse*/
      dfCO180  = (compC*4095.0*pwC*2.0*1.65)/pwCO180;          /*power for "offC8" pulse */

      dfCa90 = (int) (dfCa90 + 0.5);
      dfCa180 = (int) (dfCa180 + 0.5);
      dfC90 = (int) (dfC90 + 0.5);
      dfCO180 = (int) (dfCO180 + 0.5);	
      dfCab180 = (int) (dfCab180 +0.5);

    /* power level and pulse time for WALTZ 1H decoupling */
	pwHd = 1/(4.0 * waltzB1) ;                          
	tpwrHd = tpwr - 20.0*log10(pwHd/(compH*pw));
	tpwrHd = (int) (tpwrHd + 0.5);
    }
    else
    {
      if(FIRST_FID)                                            /* call Pbox */
      {
        ppm = getval("dfrq"); bw = 118.0*ppm; ofs = -118.0*ppm;
        offC6 = pbox_make("offC6", "sinc90n", bw, 0.0, compC*pwC, pwClvl);
        offC8 = pbox_make("offC8", "sinc180n", bw, 0.0, compC*pwC, pwClvl);
        offC17 = pbox_make("offC17", "sinc180n", bw, ofs, compC*pwC, pwClvl);
        bw = 128.0*ppm;
        offC13 = pbox_make("offC13", "square90n", bw, ofs, compC*pwC, pwClvl);
        ofs = -128.0*ppm;
        offC27 = pbox_make("offC27", "sinc180n", bw, ofs, compC*pwC, pwClvl);
        bw = 2.8*7500.0;
        wz16 = pbox_Dcal("WALTZ16", 2.8*waltzB1, 0.0, compH*pw, tpwr);

        ofs_check(H1ofs, C13ofs, N15ofs, H2ofs);
      } 
      dfC90 = offC6.pwrf;      pwCO90 = offC6.pw;
      dfCO180 = offC8.pwrf;    pwCO180 = offC8.pw;
      dfCa90 = offC13.pwrf;    pwCa90 = offC13.pw;
      dfCa180 = offC17.pwrf;   pwCa180 = offC17.pw;
      dfCab180 = offC27.pwrf;  pwCab180 = offC27.pw;
      tpwrHd = wz16.pwr;       pwHd = 1.0/wz16.dmf;
    }

    maxpwCN = 2.0*pwN;
    if (pwCab180 > pwN) maxpwCN = pwCab180;

/* LOAD PHASE TABLE */

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

/* CHECK VALIDITY OF PARAMETER RANGES */
   
    if(ni > 64)
    {
       printf("ni is out of range. Should be: 14 to 64 ! \n");
       psg_abort(1);
    }
/*
    if(ni/sw1 > 2.0*(bigTCO))
    {
       printf("ni is too big, should be < %f\n", sw1*2.0*(bigTCO));
       psg_abort(1);
    }
*/

    if(ni2/sw2 > 2.0*(bigTN - pwCO180))
    {
       printf("ni2 is too big, should be < %f\n",2.0*sw2*(bigTN-pwCO180));
       psg_abort(1);
    }

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

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


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

/*  Phase incrementation for hypercomplex 2D data */

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

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

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

    ratio = 2.0*bigTCO*sw1/((double) ni);
    ratio = (double)((int)(ratio*100.0))/100.0;
    if (ratio > 1.0) ratio = 1.0;
    if((dps_flag) && (ni > 1)) 
        printf("ratio = %f => %f\n",2.0*bigTCO*sw1/((double) ni), ratio);

/*  Set up f2180  tau2 = t2               */
    tau2 = d3;
    if ((f2180[A] == 'y') && (ni2 > 1))
      { tau2 += (1.0/(2.0*sw2)); }
    if(tau2 < 0.2e-6) tau2 = 0.0;
    tau2 = tau2/4.0;
 

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

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

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

    decstepsize(1.0);
    initval(phi_CO, v1);
    initval(phi_Ca, v2);

/* BEGIN ACTUAL PULSE SEQUENCE */

status(A);
   	delay(d1-1.0e-3);
    obsoffset(tof);
    decoffset(dof);
    obspower(tpwr);        
    decpower(pwClvl);
    decpwrf(4095.0);
    dec2power(pwNlvl);
    txphase(zero);
    decphase(zero);
    dec2phase(zero);
    rcvroff();

    if(gt6 > 0.2e-6)
    {
       delay(10.0e-6);
       decrgpulse(pwC, zero, 1.0e-6, 1.0e-6);
       delay(0.2e-6);
       zgradpulse(gzlvl6, gt6);
    }  
    decpwrf(dfCa180); 
    delay(1.0e-3);

    rgpulse(pw,zero,1.0e-6,1.0e-6);            
    delay(2.0e-6);
    zgradpulse(gzlvl0,gt0);  
    delay(taua - gt0 - 2.0e-6 - WFG_START_DELAY);

    simshaped_pulse("","offC17",2.0*pw,pwCa180,zero,zero,1.0e-6,1.0e-6);
      /* c13 offset on CO, slp 180 on Ca */
    delay(taua - gt0 - 500.0e-6 - WFG_STOP_DELAY);
    zgradpulse(gzlvl0,gt0); 
    txphase(one);
    delay(500.0e-6);
    rgpulse(pw, one, 1.0e-6, 1.0e-6);
    decphase(zero);
  
    delay(2.0e-6);
    zgradpulse(gzlvl3,gt3);

    obspower(tpwrHd);
    decpwrf(dfCa90);
    delay(200.0e-6);
   

/* c13 offset on CO, slp 90 on Ca */
    decshaped_pulse("offC13", pwCa90, zero, 0.0, 0.0);
    delay(taub -PRG_START_DELAY);

    obsprgon("waltz16", pwHd, 180.0);
    xmtron();

    decpwrf(dfC90);
    decphase(t1);
    delay(bigTC -taub -SAPS_DELAY -PWRF_DELAY);

/* c13 offset on CO, on-res 90 on CO */
    decshaped_pulse("offC6", pwCO90, t1, 0.0, 0.0);
/* CO EVOLUTION BEGINS */

    decpwrf(dfCO180);
    decphase(zero);
    delay(bigTCO/2.0 +maxpwCN/2.0 +WFG_STOP_DELAY -2.0*pwCO90/PI -ratio*tau1);

/* c13 offset on CO, on-res 180 on CO */
    decshaped_pulse("offC8", pwCO180, zero, 0.0, 0.0);

    decpwrf(dfCab180);
    delay(bigTCO/2.0 +(2.0 -ratio)*tau1 -PRG_STOP_DELAY);
    xmtroff();
    obsprgoff();

/* c13 offset on CO, slp 180 at Cab */
    sim3shaped_pulse("","offC27","",0.0,pwCab180,2.0*pwN,zero,zero,zero,0.0,0.0); 

    obsprgon("waltz16", pwHd, 180.0);
    xmtron();
    decpwrf(dfCO180);
    delay(bigTCO/2.0 +(2.0 -ratio)*tau1 -PRG_START_DELAY);

/* c13 offset on CO, on-res 180 on CO */
    decshaped_pulse("offC8", pwCO180, zero, 0.0, 0.0);

    decpwrf(dfC90);
    dcplrphase(v1);  
    delay(bigTCO/2.0 +maxpwCN/2.0 +WFG_STOP_DELAY -2.0*pwCO90/PI -ratio*tau1 -SAPS_DELAY);

/* CO EVOLUTION ENDS */
    decshaped_pulse("offC6", pwCO90, zero, 0.0, 0.0);
/* c13 offset on CO, on-res 90 on CO */

    decpwrf(dfCa90);
    decphase(t3); dcplrphase(v2);
    delay(bigTC -2.0*SAPS_DELAY -PWRF_DELAY);

/* c13 offset on CO, slp 90 at Ca */
    decshaped_pulse("offC13", pwCa90, t3, 0.0, 0.0);

    xmtroff();

    decpwrf(dfCO180);
    decphase(zero); dcplrphase(zero);
    dec2phase(t2);   

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

    obsprgon("waltz16", pwHd, 180.0);
    xmtron();
    txphase(zero);
    delay(150.0e-6);

    dec2rgpulse(pwN, t2, 0.0, 0.0);
/* N15 EVOLUTION BEGINS HERE */

    delay(bigTN/2.0 -tau2);

    decshaped_pulse("offC8", pwCO180, zero, 0.0, 0.0); /* c13 offset on CO, on-res 180 on CO */

    decpwrf(dfCa180);
    dec2phase(t4);
    delay(bigTN/2.0 -tau2);
 
    dec2rgpulse(2.0*pwN, t4, 0.0, 0.0);
    decshaped_pulse("offC17", pwCa180, zero, 0.0, 0.0); /* c13 offset on CO, slp 180 at Ca */

    decpwrf(dfCO180);
    delay(bigTN/2.0 +tau2 -pwCa180 -WFG_START_DELAY -WFG_STOP_DELAY);

    decshaped_pulse("offC8", pwCO180, zero, 0.0, 0.0);
       /* c13 offset on CO, on-res 180 on CO */

    delay(bigTN/2.0 +tau2 -tauc -PRG_STOP_DELAY);
    dec2phase(t5);
    xmtroff();
    obsprgoff();
    obspower(tpwr);

    if (mag_flg[A] == 'y') magradpulse(gzcal*gzlvl1, gt1);
      else zgradpulse(gzlvl1, gt1);

    delay(tauc -gt1 -2.0*GRADIENT_DELAY);
  
/* N15 EVOLUTION ENDS HERE */
    sim3pulse(pw,0.0, pwN, zero,zero, t5, 0.0, 0.0);

    dec2phase(zero);
    delay(2.0e-6);
    zgradpulse(0.8*gzlvl5, gt5);
    delay(taud - gt5 - 2.0e-6);

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

    delay(taud - gt5 - 500.0e-6);
    zgradpulse(0.8*gzlvl5, gt5);
    txphase(one);
    decphase(one);
    delay(500.0e-6);

    sim3pulse(pw,0.0, pwN, one,zero, one, 0.0, 0.0);
    
    delay(2.0e-6);
    txphase(zero);
    decphase(zero);
    zgradpulse(gzlvl5, gt5);
    delay(taud - gt5 - 2.0e-6);
    sim3pulse(2.0*pw,0.0, 2.0*pwN, zero,zero, zero, 0.0, 0.0);
  
    delay(taud - gt5 - 2.0*POWER_DELAY - 500.0e-6);
    zgradpulse(gzlvl5, gt5);
    decpower(dpwr);
    dec2power(dpwr2);
    delay(500.0e-6);

    rgpulse(pw, zero, 0.0, 0.0);

    delay(gstab +gt2 +2.0*GRADIENT_DELAY);

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

    if (mag_flg[A] == 'y') magradpulse(icosel*gzcal*gzlvl2, gt2);
      else zgradpulse(icosel*gzlvl2, gt2);  

    delay(0.5*gstab);    

    rcvron();
statusdelay(C, 0.5*gstab);
    setreceiver(t16);
}
示例#15
0
void pulsesequence()
{
/* DECLARE VARIABLES */

 char        shape_ss[MAXSTR];
             
 int	     t1_counter;

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

/* LOAD VARIABLES */

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


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


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

    /* selective H20 watergate pulse */
        waterpwr = tpwr - 20.0*log10(waterdly/(compH*pw));  
	waterpwr = (int) (waterpwr);        

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




/* check validity of parameter range */

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

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

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

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

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

    if(gt1 > 15.0e-3 || gt2 > 15.0e-3 || gt3 > 15.0e-3 || gt4 > 15.0e-3)
    {
        printf("gti must be less than 15 ms \n");
        psg_abort(1);
    }


/* LOAD VARIABLES */

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

  settable(t14, 8, rec);
  
  

/* Phase incrementation for hypercomplex data */

   if ( phase1 == 2 )     /* Hypercomplex in t1 */
   {     ttadd(t14,t10,4);
         tsadd(t3,2,4); 
    }

       
/* calculate modification to phases based on current t1 values
   to achieve States-TPPI acquisition */
 
 
   if(ix == 1)
      d2_init = d2;
      t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5);

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

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

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

 delay(d1);

status(B);
  rcvroff();

/*destroy N15  magnetization*/	

   	dec2rgpulse(pwN, zero, 0.0, 0.0);

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

/*  1H-15N INEPT  */

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

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

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

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

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


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

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

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

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

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

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

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


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

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

  
/* ST2   */

  rgpulse(pw,t3,0.0,0.0);

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

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

  obspower(tpwr); 
  txphase(zero); 

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

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

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

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

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

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

/*  watergate   */

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

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

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

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

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

  dec2rgpulse(pwN,zero,0.0,0.0);

  
/* acquire data */

status(C);
     setreceiver(t14);
}
示例#16
0
pulsesequence()
{

/* DECLARE AND LOAD VARIABLES */

char    	 
        CA90_in_str[MAXSTR],     
  	CA180_in_str[MAXSTR],  CA180n_in_str[MAXSTR],       
        CO180offCA_in_str[MAXSTR],   
        RFpars[MAXSTR],       
        exp_mode[MAXSTR],         /* flag to run 3D, or 2D time-shared 15N TROSY /13C HSQC-SE*/   

	f1180[MAXSTR],   		                     /* Flag to start t1 @ halfdwell */
	f2180[MAXSTR],
	f3180[MAXSTR];			                           /* do TROSY on N15 and H1 */
 
int     icosel=1.0;      			                 /* used to get n and p type */
     

double  x,y,z, t2max, t1max, tpwrs,

        tpwrsf_d = getval("tpwrsf_d"), /* fine power adustment for first soft pulse(down)*/
        tpwrsf_u = getval("tpwrsf_u"), /* fine power adustment for second soft pulse(up) */
        pwHs = getval("pwHs"),                     /* H1 90 degree pulse length at tpwrs */
        compH =getval("compH"),

        tau1, tau2,                                 /*evolution times in indirect dimensions */
        ni2=getval("ni2"),

        tauNH=getval("tauNH"),                                     /* 1/(4Jhn), INEPTs, 2.4ms*/
        tauNH1=getval("tauNH1"),                           /* 1/(4Jhn), TROSY in CN CT, 2.7ms*/
        timeTN1=getval("timeTN1"),                   /* CT time for (first) N->CA*N transfer */
        timeTN=getval("timeTN"),                                /* CT time for last SE TROSY */ 
        timeCN=getval("timeCN"),                     /* CT time for CA -> N transfer, middle */
 
	pwClvl = getval("pwClvl"), 	       	               /* coarse power for C13 pulse */
	pwC = getval("pwC"),     	             /* C13 90 degree pulse length at pwClvl */
        compC = getval("compC"),
        dfrq = getval("dfrq"),
   	              
	pwNlvl = getval("pwNlvl"),	                            /* power for N15 pulses */
        pwN = getval("pwN"),                        /* N15 90 degree pulse length at pwNlvl */
        
	gstab = getval("gstab"),
	g6bal= getval("g6bal"),  
	                         /* balance of the decoding gradient around last 180 pulse on 1H
			        g6bal=1.0 : full g6 is on the right side of the last pw180 on 1H
			        g6bal=0.0:  full g6 is on the left side*/

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

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

    getstr("f1180",f1180);
    getstr("f2180",f2180);
    getstr("exp_mode",exp_mode);
        
    tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69));          /*needs 1.69 times more*/
    tpwrs = (int) (tpwrs);                               /*power than a square pulse */
    if (tpwrsf_d<4095.0)
        tpwrs=tpwrs+6.0;  /* add 6dB to let tpwrsf_d control fine power ~2048*/

/*   LOAD PHASE TABLE    */
	
        
        settable(t1,1,phi1);

        settable(t2,4,phi2);                                        /* default double trosy */
	  if (exp_mode[A] == 'h') {settable(t2,4,phi2h);};      /*option for regular hNcaNH */
                
        settable(t3,4,phi3);
        settable(t4,8,phi4);
        settable(t5,2,phi5);
        settable(t6,4,phi6);
        settable(t7,4,phi7);
        settable(t8,4,phi8);
	settable(t21,1,psi1);                          /*trosy and SE hsqc in reverse INPET */
	settable(t22,1,psi2);
        settable(t23,1,psi2c);  
        settable(t31,8,rec); 

/* some checks */

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

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

    if ( (dm3[B] == 'y' )  && (timeCN*2.0 > 60.0e-3) )
       { printf("too lond time for 2H decoupling, SOL ");psg_abort(1);}


/*   INITIALIZE VARIABLES   */
  if(FIRST_FID)                                                          /* call Pbox */
    {
     getstr("CA180_in_str",CA180_in_str);  getstr("CA180n_in_str",CA180n_in_str);
     getstr("CA90_in_str",CA90_in_str);    getstr("CO180offCA_in_str",CO180offCA_in_str);

     strcpy(RFpars,             "-stepsize 0.5 -attn i");

     CA180 =  pbox("et_CA180_auto", CA180_in_str, RFpars, dfrq, compC*pwC, pwClvl);
     CA180n = pbox("et_CA180n_auto", CA180n_in_str, RFpars, dfrq, compC*pwC, pwClvl);
     CA90  =  pbox("et_CA90_auto", CA90_in_str, RFpars, dfrq, compC*pwC, pwClvl);
     CO180offCA = pbox("et_CO180offCA_auto", CO180offCA_in_str, RFpars, dfrq, compC*pwC, pwClvl);
    };


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

   /* t1 , N15 */
    if (phase1 == 2)  {tsadd(t2 ,1,4);}
    if(d2_index % 2)  {tsadd(t2,2,4); tsadd(t31,2,4); }  
   
   
/* setting up semi-CT on t1 (ni) dimension */
    tau1  = d2; 
    t1max=(ni-1.0)/sw1;
  
    if((f1180[A] == 'y') && (ni > 0.0)) 
          {tau1 +=  0.5/sw1 ; t1max+= 0.5/sw1; }  

    if( t1max < timeTN1*2.0) {t1max=2.0*timeTN1;}; 
                            /* if not enough  ni increments, then just regular CT in t1/ni CN */
   /* t2, CA  */

      if  (phase2 == 2)    { tsadd(t3,1,4); }	 
      if (d3_index % 2)    { tsadd(t3,2,4);  tsadd(t31,2,4); }   

/* setup  constant time in t2 (ni2) */
    tau2 = d3;  
    t2max=2.0*(timeCN - CO180offCA.pw);

    if((f2180[A] == 'y') && (ni2 > 0.0)) 
          {tau2 +=  0.5/sw2 ; t2max +=  0.5/sw2 ;}

    if(tau2 < 0.2e-6) {tau2 = 0.0;}


    if ( (ni2-1.0)/sw2 > t2max) 
       { text_error("too  many ni2 increments in t2 !  "); psg_abort(1); }
     
  if(FIRST_FID)                                            
        {
             printf("t1max is %f\n",t1max);
	     printf("t2max is %f\n",t2max);
        };
   

/* BEGIN PULSE SEQUENCE */

status(A);

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

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

        delay(d1);
        zgradpulse(gzlvl2, gt2);
	delay(gstab*3.0);

 if (exp_mode[B]=='n') dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);     /* test for steady-state 15N */
		
       /* Hz -> HzXz INEPT */

   	rgpulse(pw,zero,rof1,rof1);                              /* 1H pulse excitation */
 
        zgradpulse(gzlvl0, gt0);
	delay(tauNH -gt0);

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

   	delay(tauNH - gt0 -gstab);
	zgradpulse(gzlvl0, gt0);
	delay(gstab);

 	rgpulse(pw, t6, rof1, rof1);

       /* on HzNz now */
      /* water flipback*/

        obspower(tpwrs); obspwrf(tpwrsf_u);
 	shaped_pulse("H2Osinc",pwHs,zero,rof1,rof1);
	obspower(tpwr); obspwrf(4095.0);

       /* purge */
       
	zgradpulse(gzlvl3, gt3);
        dec2phase(t2);
	
	delay(gstab*2.0);
        
/*  HzNz -> NzCAz  +t1 evolution*/

	dec2rgpulse(pwN, t2, 0.0, 0.0);

      /* double-trosy hNcaNH */
	
	delay(tauNH1  -pwHs-4.0*rof1 -pw  
               -2.0*POWER_DELAY -WFG_STOP_DELAY-WFG_START_DELAY);            
        obspower(tpwrs); obspwrf(tpwrsf_d);
 	shaped_pulse("H2Osinc",pwHs,two,rof1,rof1);
	obspower(tpwr); obspwrf(4095.0); 
        rgpulse(pw, zero, rof1, rof1);   
        rgpulse(pw, t7, rof1, rof1);
        obspower(tpwrs); obspwrf(tpwrsf_u);
 	shaped_pulse("H2Osinc",pwHs,t8,rof1,rof1);
	obspower(tpwr);  obspwrf(4095.0);         		
        dec_c13_shpulse(CO180offCA,zero);  
        delay(tau1*0.5);
	dec_c13_shpulse(CO180offCA,zero); dec2phase(zero);

       	delay( timeTN1 -tauNH1 -pwHs  -4.0*rof1 -pw  -2.0*POWER_DELAY
               -WFG_STOP_DELAY -WFG_START_DELAY -CA180.pw -2.0*CO180offCA.pw 
               -3.0*(2.0*POWER_DELAY +WFG_STOP_DELAY +WFG_START_DELAY)); 
                       
	dec_c13_shpulse(CA180,zero);
	delay(tau1*0.5 -timeTN1*tau1/t1max); 
        dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);      
	delay( timeTN1 -tau1*timeTN1/t1max);
       	dec2rgpulse(pwN, zero, 0.0, 0.0);

/*   on CAzNz now */

/* purge */
       zgradpulse(gzlvl7, gt7);
       delay(gstab);	

       if(dm3[B] == 'y')
        {  dec3unblank();
           if(1.0/dmf3>900.0e-6)
            {
	     dec3power(dpwr3+6.0);
	     dec3rgpulse(0.5/dmf3, one, 1.0e-6, 0.0e-6);
	     dec3power(dpwr3);
	    }
           else 
            dec3rgpulse(1.0/dmf3, one, 1.0e-6,0.0e-6);
  	    dec3phase(zero);      
            setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
        }	

	/* dec_c13_shpulse(CA90,t3);*/
        
        /* t2 time, CA evolution */
	decrgpulse(pwC,t3,0.0,0.0);
	decphase(zero);
        delay(0.5*(timeCN+tau2*0.5-CO180offCA.pw)  );
        dec_c13_shpulse(CO180offCA,zero);  
        delay(0.5*(timeCN+tau2*0.5-CO180offCA.pw)  -pwN*2.0 + WFG_STOP_DELAY);

        if (exp_mode[A]=='R')  /* test CA.N relaxation rate  */
           {
	    delay(2.0*pwN);
           } 
        else
           dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
	
	dec_c13_shpulse(CA180n,zero);
        delay(0.5*(timeCN-tau2*0.5-CO180offCA.pw)  );
        dec_c13_shpulse(CO180offCA,zero);  
        delay(0.5*(timeCN-tau2*0.5-CO180offCA.pw) + WFG_START_DELAY);

	/*dec_c13_shpulse(CA90,zero);*/

	decrgpulse(pwC,zero,0.0,0.0);
 

 	if(dm3[B] == 'y') 
         {                     
	  setstatus(DEC3ch, FALSE, 'w', FALSE, dmf3);                  
	  if(1.0/dmf3>900.0e-6)
           {
	    dec3power(dpwr3+6.0);
	    dec3rgpulse(0.5/dmf3, three, 1.0e-6, 0.0e-6);
	    dec3power(dpwr3);
	   }
	  else 
           dec3rgpulse(1.0/dmf3, three, 1.0e-6, 0.0e-6);
           dec3blank();
           delay(PRG_START_DELAY);
         }

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

       /*    CaN->N + back to NH */

   	dec2rgpulse(pwN, t4, 0.0, 0.0);
        dec2phase(zero);
        delay(timeTN);
	dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);     
        dec_c13_shpulse(CA180,zero);
        delay(timeTN - CA180.pw   -gt4-gstab -pwHs-3.0*rof1
             -4.0*POWER_DELAY -2.0*WFG_STOP_DELAY-2.0*WFG_START_DELAY
             -2.0*GRADIENT_DELAY
             +4.0*pwN/3.1415-pw);
       zgradpulse(gzlvl4, gt4);
       delay(gstab);	  
    
       /*Water flipback (flipdown actually ) */
        obspower(tpwrs); obspwrf(tpwrsf_d);                         
 	shaped_pulse("H2Osinc",pwHs,three,rof1,rof1);
	obspower(tpwr); obspwrf(4095.0);  
 
/* reverse double INEPT */


/* 90 */  
   rgpulse(pw, t21, rof1, rof1);  
   zgradpulse(gzlvl11, gt1);		       
   delay(tauNH  -gt1 -rof1 
        -CA180.pw -2.0*POWER_DELAY - WFG_STOP_DELAY- WFG_START_DELAY );        
   dec_c13_shpulse(CA180,zero);
   sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
   delay(tauNH  - gt1 -gstab);
   zgradpulse(gzlvl11, gt1);		 
   delay(gstab);

 /* 90 */ 

   sim3pulse(pw, 0.0, pwN, one, zero, zero, 0.0, 0.0);
   zgradpulse(gzlvl1, gt1);		 
   delay(tauNH  -gt1);
   sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
   delay(tauNH -POWER_DELAY  -gt1- gstab);
   zgradpulse(gzlvl1, gt1);
   dec2phase(t22);		 
   delay(gstab);      
   sim3pulse(0.0,0.0, pwN, one, zero, t22, 0.0, 0.0);  
   zgradpulse(-(1.0-g6bal)*gzlvl6*icosel, gt6);                 /* 2.0*GRADIENT_DELAY */
   delay( gstab   -pwN*0.5 +pw*(2.0/3.1415-0.5) );
   rgpulse(2.0*pw, zero, rof1, rof1);
   dec2power(dpwr2); decpower(dpwr);			      
   zgradpulse(g6bal*gzlvl6*icosel, gt6);		        /* 2.0*GRADIENT_DELAY */
   delay(gstab +2.0*POWER_DELAY );
   status(C);
	setreceiver(t31);
}	 
示例#17
0
pulsesequence()
{
   double          phase = getval("phase"),
                   mix = getval("mix"),
                   wrefpwr = getval("wrefpwr"),
                   wrefpw = getval("wrefpw"),
                   wrefpwrf = getval("wrefpwrf"),
                   gt1 = getval("gt1"),
                   gzlvl1 = getval("gzlvl1"),
                   gt2 = getval("gt2"),
                   gzlvl2 = getval("gzlvl2"),
                   gstab = getval("gstab"),
                   trimpwr = getval("trimpwr"),
                   trim = getval("trim"),
                   compH = getval("compH"),
                   strength = getval("strength"), /* spinlock field strength in Hz */
                   cycles, d2corr, corfact, slpw90, slpwr, slpwra;
   int             iphase;
   char            sspul[MAXSTR],T_flg[MAXSTR], trim_flg[MAXSTR],
                   wrefshape[MAXSTR],alt_grd[MAXSTR];


/* LOAD AND INITIALIZE PARAMETERS */
   iphase = (int) (phase + 0.5);
   satdly = getval("satdly");
   satpwr = getval("satpwr");
   satfrq = getval("satfrq");
   getstr("sspul", sspul);
   getstr("satmode", satmode);
   getstr("T_flg", T_flg);
   getstr("wrefshape", wrefshape);
   getstr("alt_grd",alt_grd);
   getstr("trim_flg", trim_flg);
   rof1 = getval("rof1"); if(rof1 > 2.0e-6) rof1=2.0e-6;

/* CALCULATE PHASES AND INITIALIZE LOOP COUNTER FOR MIXING TIME */
   settable(t1,8,phi1);
   settable(t2,8,phi2);
   settable(t3,8,phi3);
   settable(t4,8,phi4);
   settable(t5,8,phi5);
   settable(t6,8,phi6);
   settable(t7,8,phi7);
   getelem(t1,ct,v1);
   getelem(t7,ct,v7);
   assign(v1,oph);	
   if (iphase == 2)
    {
      incr(v7);
      incr(v1);			/* BC2D hypercomplex method */
    }

/* FOR HYPERCOMPLEX, USE REDFIED TRICK TO MOVE AXIALS TO EDGE */  
   initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v9); /* moves axials */
   if ((iphase==2)||(iphase==1)) {add(v1,v9,v1); add(v7,v9,v7); add(oph,v9,oph);}

   if (alt_grd[0] == 'y') mod2(ct,v6);
               /* alternate gradient sign on every 2nd transient */

    /* CALCULATE SPIN>LOCK POWER AND PULSE WIDTHS        */

    slpw90 = 1/(4.0 * strength) ;     /* spinlock field strength  */
  /*  slpw1 = slpw90/90.0; */
    slpwra = tpwr - 20.0*log10(slpw90/(compH*pw));
    slpwr = (int) (slpwra + 0.5);
    corfact = exp((slpwr-slpwra)*2.302585/20);
    if (corfact < 1.00) { slpwr=slpwr+1; corfact=corfact*1.12202; }

   cycles = mix / (16.0 * (4e-6 + 2.0*slpw90));
   initval(cycles, v10);	/* mixing time cycles */

/* BEGIN ACTUAL PULSE SEQUENCE */
   status(C);
   obspower(tpwr); obspwrf(4095.0);
   if (sspul[A] == 'y')
   {
     zgradpulse(gzlvl1,gt1);
     delay(5.0e-5);
     rgpulse(pw,zero,rof1,rof1);
     zgradpulse(gzlvl1,gt1); 
     delay(5.0e-5);
   }
   status(A);
   if (satmode[A] == 'y') 
    {
    if (d1 > satdly) delay(d1-satdly);
    if (tof != satfrq) obsoffset(satfrq);
    obspower(satpwr);
    rgpulse(satdly,zero,rof1,rof1);
    obspower(tpwr);
    if (tof != satfrq) obsoffset(tof);
    }
    else delay(d1);
   status(B);
   obsstepsize(45.0);
   initval(7.0,v4);  
   xmtrphase(v4);
   rgpulse(pw,v1,rof1,1.0e-6);
   if (trim_flg[0] == 'y')
        { obspower(trimpwr);
          rgpulse(trim,v7,rof1,rof1);
          obspower(tpwr);
        }
   xmtrphase(zero);   
   if (T_flg[0] == 'n')
        d2corr = rof1 + 1.0e-6 + (2*pw/3.1416) + SAPS_DELAY;
   else
        d2corr = rof1 + 1.0e-6 + (4*pw/3.1416) + SAPS_DELAY;
   if (d2 > d2corr) delay(d2 - d2corr); else delay(0.0);
   if ((T_flg[0] == 'y')&&(cycles > 1.5))
    {
      rgpulse(pw,t4,rof1,rof1);
      obspower(slpwr); obspwrf(4095.0/corfact);
      {
         starthardloop(v10);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
            rgpulse(2.0*slpw90,t2,4e-6,0.0);
            rgpulse(2.0*slpw90,t3,4e-6,0.0);
         endhardloop();
      }
      obspower(tpwr); obspwrf(4095.0);
      rgpulse(pw,t5,rof1,rof1); 
    }  
/* The ROESY spin-lock unit is executed sixteen times within the
   hardware loop so that it is of sufficient duration to allow
   the acquisition hardware loop to be loaded in behind it on
   the last pass through the spin-lock loop. */

   else
    {
      obspower(slpwr); obspwrf(4095.0/corfact);
      rgpulse(mix,t2,rof1,rof1);        /* cw spin lock  */
      obspower(tpwr); obspwrf(4095.0);
    }
/* DPFGSE solvent suppression  */
         ifzero(v6); zgradpulse(gzlvl2,gt2);
              elsenz(v6); zgradpulse(-1.0*gzlvl2,gt2); endif(v6);
     obspower(wrefpwr+6); obspwrf(wrefpwrf);
     delay(gstab);
     shaped_pulse(wrefshape,wrefpw,t5,rof1,rof1);
     obspower(tpwr); obspwrf(4095.0);
     rgpulse(2.0*pw,t6,rof1,rof1);
         ifzero(v6); zgradpulse(gzlvl2,gt2);
              elsenz(v6); zgradpulse(-1.0*gzlvl2,gt2); endif(v6);
     obspower(wrefpwr+6); obspwrf(wrefpwrf);
     delay(gstab);
         ifzero(v6); zgradpulse(1.2*gzlvl2,gt2);
              elsenz(v6); zgradpulse(-1.2*gzlvl2,gt2); endif(v6);
     delay(gstab);
     shaped_pulse(wrefshape,wrefpw,t5,rof1,rof1);
     obspower(tpwr); obspwrf(4095.0);
     rgpulse(2.0*pw,t6,rof1,rof2);
         ifzero(v6); zgradpulse(1.2*gzlvl2,gt2);
              elsenz(v6); zgradpulse(-1.2*gzlvl2,gt2); endif(v6);
     delay(gstab);
   status(C);
}
示例#18
0
void pulsesequence()
{
/* DECLARE VARIABLES */

 char      
 	     f1180[MAXSTR],f2180[MAXSTR],satmode[MAXSTR];

 int	     icosel,t1_counter,t2_counter,first_FID;

 double      /* DELAYS */
             tau1,                                 /* t1/2 */
             tau2,                                 /* t2/2 */

             /* COUPLINGS */
             jhn = getval("jhn"), tauhn,
             jnco = getval("jnco"), taunco,
             jcoca = getval("jcoca"), taucoca,
             jnca = getval("jnca"), taunca,
             jhaca = getval("jhaca"), tauhaca,
             jcaha = getval("jcaha"), taucaha,
             jcacb = getval("jcacb"), taucacb,
   
             /* PULSES */
             pwN = getval("pwN"),               /* PW90 for N-nuc */
             pwC = getval("pwC"),               /* PW90 for C-nuc */
             pwHs = getval("pwHs"),           /* pw for water selective pulse at twprsl */

             /* POWER LEVELS */
             satpwr = getval("satpwr"),       /* low power level for presat */
             tpwrsf_d = getval("tpwrsf_d"),   /* fine power level "down" flipback pulse*/
             tpwrsf_u = getval("tpwrsf_u"),   /* fine power level "up" flipback pulse*/
	     tpwrs,                          /* power level for selective pulse for water */
             tpwrd,pwHd,                     /* power/pulse width for decoupling */
             pwClvl = getval("pwClvl"),         /* power level for C hard pulses */ 
             compH = getval("compH"),           /* compression factor   */
             compC = getval("compC"),           /* compression factor   */
             pwNlvl = getval("pwNlvl"),         /* power level for N hard pulses */
             rf90onco, pw90onco,          /* power level/width for CO 90 pulses */ 
             rf180onco, pw180onco,        /* power level/width for CO 180 pulses */
             rf180offca, pw180offca,      /* power level/width for off-res Ca 180 pulses */

             /* CONSTANTS */
             lambda = getval("lambda"),     /* J scaling factor */
             kappa,                         /* semi constant-time factor */
             ni2=getval("ni2"),
             waltzB1 = getval("waltzB1"),  /* waltz16 field strength (in Hz)     */

             /* GRADIENT DELAYS AND LEVES */
             gt0 = getval("gt0"),       /* gradient time */
             gt1 = getval("gt1"),       /* gradient time */
             gt3 = getval("gt3"),       /* gradient time */
             gt5 = getval("gt5"),
             gstab = getval("gstab"),
             gzlvl0 = getval("gzlvl0"), /* level of gradient */
             gzlvl1 = getval("gzlvl1"),
             gzlvl2 = getval("gzlvl2"),
             gzlvl3 = getval("gzlvl3"),
             gzlvl5 = getval("gzlvl5");

    /* power level and pulse time for WALTZ 1H decoupling */
	pwHd = 1/(4.0 * waltzB1);                          
	tpwrd = tpwr - 20.0*log10(pwHd/(compH*pw));
	tpwrd = (int) (tpwrd + 0.5);
 

/* LOAD VARIABLES */

  getstr("satmode",satmode); 
  getstr("f1180",f1180);
  getstr("f2180",f2180);

/* check validity of parameter range */

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

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

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

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

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

/* LOAD VARIABLES */

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

/* INITIALIZE VARIABLES */

  tauhn   = ((jhn != 0.0)  ? 1/(4*(jhn)) : 2.75e-3);
  taunco  = ((jnco !=0.0)  ? 1/(4*(jnco)) : 16.6e-3);
  taucoca = ((jcoca !=0.0) ? 1/(4*(jcoca)) : 4.5e-3);
  taunca  = ((jnca  !=0.0) ? 1/(4*(jnca))  : 12e-3);
  tauhaca = ((jhaca !=0.0) ? 1/(4*(jhaca)) : 12e-3);
  taucaha = ((jcaha !=0.0) ? 1/(4*(jcaha)) : 12e-3);
  taucacb = ((jcacb !=0.0) ? 1/(4*(jcacb)) : 12e-3);


       if((getval("arraydim") < 1.5) || (ix==1))
         first_FID = 1;
       else
         first_FID = 0;

    /* 90 degree pulse on CO, null at Ca 118ppm away */

        pw90onco = sqrt(15.0)/(4.0*118.0*dfrq);
        rf90onco = (4095.0*pwC*compC)/pw90onco;
        rf90onco = (int) (rf90onco + 0.5);
        if(rf90onco > 4095.0)
        {
          if(first_FID)
            printf("insufficient power for pw90onco -> rf90onco (%.0f)\n", rf90onco);
          rf90onco = 4095.0;
          pw90onco = pwC;
        }

    /* 180 degree pulse on CO, null at Ca 118ppm away */

        pw180onco = sqrt(3.0)/(2.0*118.0*dfrq);
        rf180onco = (4095.0*pwC*compC*2.0)/pw180onco;
        rf180onco = (int) (rf180onco + 0.5);
        if(rf180onco > 4095.0)
        {
          if(first_FID)
            printf("insufficient power for pw180onco -> rf180onco (%.0f)\n", rf180onco);
          rf180onco = 4095.0;
          pw180onco = pwC*2.0;
        }
        pw180offca = pw180onco;        rf180offca = rf180onco;


/* Phase incrementation for hypercomplex data */

   if (phase1 == 2)     	/* Hypercomplex in t1 */
      {
        tsadd(t4, 1, 4);
      }  
   
  if (phase1 == 4)           /* Hypercomplex in t1 */
     {
        tsadd(t4, 1, 4);
     }
   
     kappa=(taunco - tauhn)/(0.5*ni2/sw2)-0.001;
         if (kappa > 1.0) 
     {  
	                      kappa=1.0-0.01;
     }   
   
          if (phase2 == 1) /* Hypercomplex in t2 */
     {
	                        icosel = -1;
	                        tsadd(t2, 2, 4);
	                        tsadd(t3, 2, 4);
     }  
         else icosel = 1;   
         
         if (ix == 1)
           printf("semi constant time factor %4.6f\n",kappa);
   
/* calculate modification to phases based on current t1 values
   to achieve States-TPPI acquisition */
 
 
   if (ix == 1)
      d2_init = d2;
      t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5);

      if (t1_counter %2)  /* STATES-TPPI */
      {
        tsadd(t4,2,4);
        tsadd(t7,2,4);
      }

    if(ix==1)
     d3_init = d3;
     t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5);
      
     if(t2_counter %2) 
     {
       tsadd(t1,2,4);
       tsadd(t7,2,4);
     }   
   
/* set up so that get (-90,180) phase corrects in F1 if f1180 flag is y */

   tau1 = d2;
   if (f1180[A] == 'y')  tau1 += ( 1.0/(2.0*sw1));
   tau1 = tau1/2.0;
   
/* set up so that get (-90,180) phase corrects in F2 if f2180 flag is y */
      
   tau2 = d3;
   if(f2180[A] == 'y')  tau2 += ( 1.0/(2.0*sw2) );
   tau2 = tau2/2.0;   
   
/* selective H20 one-lobe sinc pulse */
    tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69));   /*needs 1.69 times more*/
    tpwrs = (int) (tpwrs);                   	  /*power than a square pulse */
    if (tpwrsf_d<4095.0) tpwrs=tpwrs+6;   /* nominal tpwrsf_d ~ 2048 */
         /* tpwrsf_d,tpwrsf_u can be used to correct for radiation damping  */

/* BEGIN ACTUAL PULSE SEQUENCE */


status(A);
   obspower(satpwr);            /* Set power for presaturation    */
   decpower(pwClvl);             /* Set decoupler1 power to pwClvl  */
   decpwrf(rf90onco);
   dec2power(pwNlvl);            /* Set decoupler2 power to pwNlvl */

/* Presaturation Period */


  if (satmode[0] == 'y')
    {
      rgpulse(d1,zero,rof1,0.0);
      obspower(tpwr);                   /* Set power for hard pulses  */
    }
  else  
    {
      obspower(tpwr);                   /* Set power for hard pulses  */
      delay(d1);
    }

status(B);

   rcvroff();

   decpwrf(rf90onco);   /* Set decoupler1 power to rf90onco */
   sim3pulse(0.0,pw90onco,pwN,zero,zero,zero,rof1,rof1);  /* 90 for 15N and 13C' */

   zgradpulse(gzlvl0,gt0);
   delay(gstab);

  /* transfer from HN to N by INEPT */
   
  /* shaped pulse for water flip-back */
         obspower(tpwrs); obspwrf(tpwrsf_d);
         shaped_pulse("H2Osinc_d",pwHs,one,2.0e-6,0.0);
         obspower(tpwr); obspwrf(4095.0);
  /* shaped pulse */

  rgpulse(pw,zero,rof1,0.0);

  zgradpulse(gzlvl0*1.3,gt0);
  delay(gstab);
   
  delay(tauhn - gt0 - gstab);  					 /* 1/(4JHN) */
   
  sim3pulse(2.0*pw,0.0,2.0*pwN,zero,zero,zero,rof1,rof1);

  delay(tauhn - gt0 - gstab);  					 /* 1/(4JHN) */
   
  zgradpulse(gzlvl0*1.3,gt0);
  delay(gstab);

  rgpulse(pw,three,rof1,0.0);   /* 90 1H */
   
  zgradpulse(gzlvl3,gt3);
  delay(gstab);
   
  decpwrf(rf180onco);   /* Set decoupler power to rf180onco */
  dec2rgpulse(pwN,zero,0.0,0.0);   /* 90 15N */

/* start transfer from N to CO */

  delay(5.5e-3 - pwHd - POWER_DELAY - PRG_START_DELAY); /* 1/(2JHN) */
  
  obspower(tpwrd);
  rgpulse(pwHd,one,rof1,0.0);
  txphase(zero);
  obsprgon("waltz16", pwHd, 90.0);
  xmtron();

   
   delay(taunco - 5.5e-3 - 0.5*pw180onco);  /* 1/(4JNCO) - 1/(2JHN) */

   sim3pulse(0.0,pw180onco,2.0*pwN,zero,zero,zero,rof1,rof1);

   delay(taunco - 5.5e-3 - 0.5*pw180onco); /* 1/(4JNCO) - 1/(2JHN) */

 /* turn proton decoupling off */ 
      xmtroff();
      obsprgoff();
      rgpulse(pwHd,three,rof1,0.0);
      obspower(tpwr);
 /* turned proton decoupling off */
   
   delay(5.5e-3 - PRG_STOP_DELAY - pwHd - POWER_DELAY); /* 1/(2JHN) */
   
/* Start in-phase filter */

   if (( phase1 == 1 || phase1 == 2))
      {

       dec2rgpulse(pwN,one,0.0,0.0);   /* 90 15N */

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

        /* shaped pulse WATER-FLIP-back */
             obspower(tpwrs); obspwrf(tpwrsf_d);
             shaped_pulse("H2Osinc_d",pwHs,one,rof1,0.0);
             obspower(tpwr); obspwrf(4095.0);
        /* shaped pulse */

       rgpulse(pw,one,rof1,0.0);    /* 90 1H */

	
        zgradpulse(gzlvl0*1.1,gt0);
        delay(gstab);

	delay(0.5*tauhn - gt0 - gstab);  /* 1/(8JNH) */
        dec2rgpulse(2.0*pwN,zero,0.0,0.0); /* 180 15N */
	delay(0.5*tauhn - gt0 - gstab);  /* 1/(8JNH) */

        zgradpulse(gzlvl0*1.1,gt0);
        delay(gstab);
	
        rgpulse(2.0*pw,zero,rof1,rof1); /* 180 1H */

        zgradpulse(gzlvl0*1.1,gt0);
        delay(gstab);

	delay(0.5*tauhn - gt0 -gstab); /* 1/(8JNH) */
        dec2rgpulse(2.0*pwN,zero,0.0,0.0); /* 180 15N */
        delay(0.5*tauhn - gt0 -gstab); /* 1/(8JNH) */


        zgradpulse(gzlvl0*1.1,gt0);
        delay(gstab);

        rgpulse(pw,one,rof1,0.0);  /* 90 1H */

        /* shaped pulse WATER-FLIP-back */
             obspower(tpwrs); obspwrf(tpwrsf_u);
             shaped_pulse("H2Osinc_u",pwHs,three,rof1,0.0);
             obspower(tpwr); obspwrf(4095.0);
        /* shaped pulse */

      }

/* start antiphase filter */

    if (( phase1 == 3 || phase1 == 4 ))
      {

        dec2rgpulse(pwN,one,0.0,0.0);  /* 90 15N */

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

        /* shaped pulse WATER-FLIP-back */
             obspower(tpwrs); obspwrf(tpwrsf_d);
             shaped_pulse("H2Osinc_d",pwHs,zero,rof1,0.0);
             obspower(tpwr); obspwrf(4095.0);
        /* shaped pulse */

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


        zgradpulse(gzlvl0*0.9,gt0);
        delay(gstab);
	
	delay(tauhn - gt0 - gstab - 2.0*pwN); /* 1/(4JNH) */
        sim3pulse(2.0*pw,0.0,2.0*pwN,zero,zero,zero,rof1,rof1); /* 180 1H and 15N */
	delay(tauhn - gt0 - gstab - 2.0*pwN); /* 1/(4JNH) */
	

        zgradpulse(gzlvl0*0.9,gt0);
        delay(gstab);

        rgpulse(pw,one,rof1,0.0);  /* 90 1H */

        /* shaped pulse WATER-FLIP-back */
             obspower(tpwrs); obspwrf(tpwrsf_u);
             shaped_pulse("H2Osinc_u",pwHs,three,rof1,0.0);
             obspower(tpwr); obspwrf(4095.0);
        /* shaped pulse */
      }

/* End of filter section */

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

	rgpulse(2.0*pw,zero,rof1,0.0);
        decpwrf(rf90onco);      /* Set decoupler power to rf90onco */
        decrgpulse(pw90onco,t4,0.0,0.0);   /* 90 for 13C */

/* record 13C' frequences and 13C'-15N coupling */

      delay(tau1);
      decpwrf(rf180offca);      /* Set decoupler power to rf180offca */
      simshaped_pulse("","offC3",2.0*pw,pw180offca,zero,zero,rof1,rof1); /* 180 for 1H and 13CA */
      decphase(zero);
      decpwrf(rf180onco);   
      delay(tau1);
      if (lambda>0.0)
      {
       delay(lambda*tau1);
       sim3pulse(0.0,pw180onco,2.0*pwN,zero,t5,zero,0.0,0.0);
       delay(lambda*tau1);
      } 
      else decrgpulse(pw180onco,t5,0.0,0.0);
   
      decpwrf(rf180offca); /* Set decoupler power to rf180offca */
      simshaped_pulse("","offC3",0.0,pw180offca,zero,zero,0.0,0.0); /* 180 CA */  
      decphase(zero);
      decpwrf(rf90onco); 
   
/* start reverse transfer from CO to N by INEPT */

       decrgpulse(pw90onco,zero,0.0,0.0); /* 90 for 13C' */
   
       zgradpulse(gzlvl3*0.7,gt3);
       delay(gstab);
     
       dec2rgpulse(pwN,t1,0.0,0.0);  	  /* 90 for 15N */
   
       delay((taunco - tauhn) - kappa*tau2);  /* 1/4J(NCO) - 1/4J(NH) - kt2/2 */
         
       dec2rgpulse(2.0*pwN,zero,0.0,0.0);     /* 180 for 15N */
             
       delay((1-kappa)*tau2);        /* (1-k)t2/2 */
      
       decpwrf(rf180onco);
       decrgpulse(pw180onco,zero,0.0,0.0);     /* 180 for 13C' */
       decpwrf(rf180offca);
   
       delay(taunco - tauhn - gt1 - gstab - pw180onco - pw180offca - 3.0*POWER_DELAY);
         
       zgradpulse(gzlvl1,gt1);
       delay(gstab);
   
       decshaped_pulse("offC3",pw180offca,zero,0.0,0.0);
         
       delay(tau2);                            /* t2/2 */
   
      /* start TROSY transfer from N to HN */
         
        rgpulse(pw,t2,rof1,0.0); /* 180 for 1H */
             
        zgradpulse(gzlvl5,gt5);
        delay(gstab);
    
        delay(tauhn - gt5 - gstab );
   
        decpwrf(rf180onco);
        sim3pulse(2.0*pw,pw180onco,2.0*pwN,zero,zero,zero,rof1,rof1);
      
        delay(tauhn - gt5 - gstab );
               
        zgradpulse(gzlvl5,gt5);
        delay(gstab);
   
        decpwrf(rf90onco);
        sim3pulse(pw,pw90onco,pwN,one,t6,zero,rof1,0.0);
   
      /* shaped pulse for water flip-back */
         obspower(tpwrs); obspwrf(tpwrsf_u);
         shaped_pulse("H2Osinc_u",pwHs,t2,rof1,0.0);
         obspwrf(4095.0);
         obspower(tpwr);
      /* shaped pulse */
   
        zgradpulse(gzlvl5*0.9,gt5);
        delay(gstab);
         
        delay(tauhn - gt5 - gstab - POWER_DELAY - pwHs);
      
        sim3pulse(2.0*pw,0.0,2.0*pwN,zero,zero,zero,rof1,rof1);
   
        delay(tauhn - gt5 - gstab );
      
        decpower(dpwr);
         
        zgradpulse(gzlvl5*0.9,gt5);
        delay(gstab);
      
        dec2rgpulse(pwN,t3,0.0,0.0);  /* 90 for 15N */
         
        dec2power(dpwr2);
         
        delay((gt1/10.0) - pwN + gstab -POWER_DELAY);
         
        rgpulse(2.0*pw, zero, rof1, rof1);
         
        zgradpulse(gzlvl2*icosel,gt1/10.0);
        delay(gstab);
         
     /* acquire data */
         
      status(C);
        setreceiver(t7);
}
示例#19
0
pulsesequence() {

// Define Variables and Objects and Get Parameter Values

   double pw1Xstmas = getval("pw1Xstmas");
   double pw2Xstmas = getval("pw2Xstmas");

   double tXzfselinit = getval("tXzfsel");
   double tXzfsel = tXzfselinit - 3.0e-6;
   if (tXzfsel < 0.0) tXzfsel = 0.0;

   double d2init = getval("d2");
   double d2 = d2init - pw1Xstmas/2.0 - pw2Xstmas/2.0;
   if (d2 < 0.0) d2 = 0.0;

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

// Set Constant-time Period for d2. 

   if (d2_index == 0) d2_init = getval("d2");
   double d2_ = (ni - 1)/sw1 + d2_init;
   putCmd("d2acqret = %f\n",roundoff(d2_,12.5e-9));
   putCmd("d2dwret = %f\n",roundoff(1.0/sw1,12.5e-9));

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

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

// Dutycycle Protection
   DUTY d = init_dutycycle();
   d.dutyon = getval("pw1Xstmas") + getval("pw2Xstmas") + getval("pwXzfsel");
   d.dutyoff = d1 + 4.0e-6;
   d.c1 = d.c1 + (!strcmp(dec.seq,"tppm"));
   d.c1 = d.c1 + ((!strcmp(dec.seq,"tppm")) && (dec.t.a > 0.0));
   d.t1 = d2_ + tXzfsel + getval("rd") + getval("ad") + at;
   d.c2 = d.c2 + (!strcmp(dec.seq,"spinal"));
   d.c2 = d.c2 + ((!strcmp(dec.seq,"spinal")) && (dec.s.a > 0.0));
   d.t2 = d2_ + tXzfsel + getval("rd") + getval("ad") + at;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   settable(ph1Xstmas,4,table1);
   settable(ph2Xstmas,4,table2);
   settable(phXzfsel,8,table3);
   settable(phRec,8,table4);

   if (phase1 == 2) {
      tsadd(ph1Xstmas,1,4);
   }
   setreceiver(phRec);

// Begin Sequence

   txphase(ph1Xstmas); decphase(zero);
   obspower(getval("tpwr"));
   obspwrf(getval("aXstmas"));
   obsunblank(); decunblank(); _unblank34();
   delay(d1);
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// H Decoupler on Before STMAS

   _dseqon(dec);

// Two-Pulse STMAS

   rgpulse(getval("pw1Xstmas"),ph1Xstmas,0.0,0.0);
   txphase(ph2Xstmas);
   delay(d2);
   rgpulse(getval("pw2Xstmas"),ph2Xstmas,0.0,0.0);

// Z-filter Pulse

   txphase(phXzfsel);
   obsblank(); 
   obspower(getval("dbXzfsel"));
   obspwrf(getval("aXzfsel"));
   delay(3.0e-6);
   obsunblank();
   delay(tXzfsel);
   rgpulse(getval("pwXzfsel"),phXzfsel,0.0,0.0);

// Begin Acquisition

   obsblank(); _blank34();
   delay(getval("rd"));
   startacq(getval("ad"));
   acquire(np, 1/sw);
   endacq();
   _dseqoff(dec);
   obsunblank(); decunblank(); _unblank34();
}
示例#20
0
void pulsesequence()
{

/* DECLARE AND LOAD VARIABLES; parameters used in the last half of the */
/* sequence are declared and initialized as 0.0 in bionmr.h, and       */
/* reinitialized below  */

char        f2180[MAXSTR],   		      /* Flag to start t2 @ halfdwell */
            fil_flg1[MAXSTR],
            had_flg[MAXSTR],
            shname1[MAXSTR],
	    shname2[MAXSTR],
	    ala_flg[MAXSTR],	    
            ser_flg[MAXSTR],
	    SE_flg[MAXSTR],			    /* SE_flg */
  	    TROSY[MAXSTR];			    /* do TROSY on N15 and H1 */

int         t2_counter,  		        /* used for states tppi in t2 */
	    ni2 = getval("ni2");

double      d3_init=0.0,  		        /* used for states tppi in t2 */
            stCwidth = 80.0,
	    shpw1,shpw2,         				         /*  t1 delay */
	    tauCH = getval("tauCH"), 		         /* 1/4J delay for CH */
	    tauC1 = getval("tauC1"),
	    tauC2 = getval("tauC2"),
	    tauC3 = getval("tauC3"),
            had2,had3,
            timeTN = getval("timeTN"),     /* constant time for 15N evolution */
	    eta = 4.6e-3,
	    theta = 14.0e-3,
            
	pwClvl = getval("pwClvl"), 	        /* coarse power for C13 pulse */
        pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */

   pwS1, pwS2,	pwS3,	pwS4, pwS5,pwS6,pwS7,
   phi7cal = getval("phi7cal"),  /* phase in degrees of the last C13 90 pulse */

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

	sw2 = getval("sw2"),

	gt3 = getval("gt3"),
	gt5 = getval("gt5"),
	gstab = getval("gstab"),
	gzlvl0 = getval("gzlvl0"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl5 = getval("gzlvl5"),
	flip_angle=120.0,had1=0.0,
	epsilon = getval("epsilon");
    fil_flg1[0]='n'; 
    ser_flg[0]='n';   /*initialize*/

    getstr("f2180",f2180);
    getstr("had_flg",had_flg);
    getstr("shname1",shname1);
    getstr("shname2",shname2);    
    getstr("TROSY",TROSY);
    getstr("SE_flg",SE_flg);


/*   LOAD PHASE TABLE    */

	settable(t1,4,phi1);
	settable(t3,4,phi3);
	settable(t4,1,phx);
	settable(t5,2,phi5);
	settable(t6,2,phi6);
        settable(t8,1,phx);
	settable(t9,8,phi9);
	settable(t10,1,phx);
	settable(t11,1,phy);

	settable(t12,8,phi12);
	settable(t13,8,rec2);




/*   INITIALIZE VARIABLES   */

        shpw1 = pw*8.0;
        shpw2 = pwC*8.0;
 	kappa = 5.4e-3;
	lambda = 2.4e-3;
        had2=0.5/135.0;
        had3=0.5/135.0;

        ala_flg[0]='n';

        if (had_flg[0] == '1')
          { fil_flg1[0]='n';ser_flg[0]='n';flip_angle=120.0;had1=0.0;} 
        if (had_flg[0] == '2')
          { fil_flg1[0]='y';ser_flg[0]='n';flip_angle=120.0;had1=0.0;} 
        if (had_flg[0] == '3')
          { fil_flg1[0]='n';ser_flg[0]='y';flip_angle=120.0;had1=0.0;} 
        if (had_flg[0] == '4')
          { fil_flg1[0]='y';ser_flg[0]='y';flip_angle=120.0;had1=0.0;} 
        if (had_flg[0] == '5')
          { fil_flg1[0]='n';ser_flg[0]='n';flip_angle=60.0;had1=0.5/140.0;} 
        if (had_flg[0] == '6')
          { fil_flg1[0]='y';ser_flg[0]='n';flip_angle=60.0;had1=0.5/140.0;} 
        if (had_flg[0] == '7')
          { fil_flg1[0]='n';ser_flg[0]='y';flip_angle=60.0;had1=0.5/140.0;} 
        if (had_flg[0] == '8')
          { fil_flg1[0]='y';ser_flg[0]='y';flip_angle=60.0;had1=0.5/140.0;} 
	


    if( pwC > 20.0*600.0/sfrq )
	{ printf("increase pwClvl so that pwC < 20*600/sfrq");
	  psg_abort(1); }

    /* get calculated pulse lengths of shaped C13 pulses */
	pwS1 = c13pulsepw("cab", "co", "square", 90.0); 
	pwS2 = c13pulsepw("ca", "co", "square", 180.0); 
	pwS3 = c13pulsepw("co", "ca", "sinc", 180.0); 
        pwS4 = c_shapedpw("isnob5",80.0,0.0,zero, 2.0e-6, 2.0e-6);

        pwS6 = c_shapedpw("reburp",80.0,0.0,zero, 2.0e-6, 2.0e-6); /* attention, y a aussi des 180 CaCb après les filtres*/

        pwS7 = c_shapedpw(shname2,80.0,150.0,zero, 2.0e-6, 2.0e-6);
        pwS5 = c_shapedpw("isnob5",30.0,0.0,zero, 2.0e-6, 2.0e-6);

/* CHECK VALIDITY OF PARAMETER RANGES */


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

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

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

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

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



/* PHASES AND INCREMENTED TIMES */

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

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



/*  Set up f2180  */

    tau2 = d3;    /* run 2D exp for NH correlation, but must use tau2 instead of tau1
                     because bionmr.h is written for nh_evol* to do tau2 evolution*/

    if((f2180[A] == 'y') && (ni2 > 1.0))  /* use f2180 to control tau2 */
	{ tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; }
    tau2 = tau2/2.0;



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

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




/* BEGIN PULSE SEQUENCE */

status(A);
   	delay(d1);
      if (dm3[B]=='y') lk_hold();

	rcvroff();
        set_c13offset("cab");
	obsoffset(tof);
	obspower(tpwr);
 	obspwrf(4095.0);
	decpower(pwClvl);
	decpwrf(4095.0);
 	dec2power(pwNlvl);
	txphase(one);
	delay(1.0e-5);
        if (TROSY[A] == 'n')
	dec2rgpulse(pwN, zero, 0.0, 0.0);  /*destroy N15 and C13 magnetization*/
	decrgpulse(pwC, zero, 0.0, 0.0);
	zgradpulse(gzlvl0, 0.5e-3);
	delay(gstab);
      if (TROSY[A] == 'n')
	dec2rgpulse(pwN, one, 0.0, 0.0);
	decrgpulse(pwC, zero, 0.0, 0.0);
	zgradpulse(0.7*gzlvl0, 0.5e-3);
	delay(gstab);

      if(dm3[B] == 'y')			  /*optional 2H decoupling on */
         {dec3unblank(); dec3rgpulse(1/dmf3, one, 0.0, 0.0); 
          dec3unblank(); setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);} 
        rgpulse(pw, zero, 2.0e-6, 0.0);
        zgradpulse(gzlvl5, gt5);
        delay(tauCH - gt5 - WFG2_START_DELAY - 0.5e-3 + 68.0e-6 );

        sim_c13adiab_inv_pulse("", "aliph", stCwidth, "sech1", 2.0*pw, 1.0e-3,
                                                  zero, zero, 2.0e-6, 2.0e-6);

        zgradpulse(gzlvl5, gt5);
        delay(tauCH - gt5 - 0.5e-3 + 68.0e-6);
        rgpulse(pw, one, 0.0, 0.0);

      if (ser_flg[0] == 'n' )
         delay(pwS5);
      if (ser_flg[0] == 'y' )
        c_shapedpulse("isnob5",30.0,24.0,zero, 2.0e-6, 2.0e-6);  

/*********************************** transfer  CB->CA + DEPT CBH **************/
	zgradpulse(gzlvl3, gt3*1.2);
	delay(gstab);

        decrgpulse(pwC, t3, 0.0, 0.0);

        rgpulse(pw, three, 0.0, 0.0);
      if (flip_angle > 90.0) delay(pw*(flip_angle/90.0-1));

      if (fil_flg1[0] == 'y') 
        {
         /* JCOCA & JCOCB is turned on*/
          zgradpulse(gzlvl3, gt3);
	  delay(had2*0.5-pwS4*0.5-pwS7-gt3);
          c_simshapedpulse(shname2,80.0,150.0,0.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);	
          c_simshapedpulse("isnob5",80.0,0.0,pw*2.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);
          zgradpulse(gzlvl3, gt3);        
          delay(had2*0.5-pwS4*0.5-gt3);
          rgpulse(pw*flip_angle/90.0, t1, 0.0, 0.0);
	if (flip_angle < 90.0) delay(pw*(1-flip_angle/90.0));
          zgradpulse(gzlvl3, 1.1*gt3);		
          delay(had3*0.5-shpw1*0.5-1.1*gt3);		
          shaped_pulse(shname1,shpw1,two,0.0,0.0);
          delay((tauC3-(had2+pw*120/90*2))*0.5-pwS4*0.5-had3*0.5-shpw1*0.5-pwS7);
          c_simshapedpulse(shname2,80.0,150.0,0.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);			
          c_shapedpulse("isnob5",80.0,0.0,two, 2.0e-6, 2.0e-6);  
          zgradpulse(gzlvl3, 1.1*gt3);	
          delay((tauC3-(had2+pw*120/90*2))*0.5-pwS4*0.5-1.1*gt3);
       }

     if (fil_flg1[0] == 'n') 
       {
         /* JCOCA & JCOCB is turned off*/
          zgradpulse(gzlvl3, gt3);
          delay(epsilon/4.0-pwS7*0.5-gt3);
	  c_simshapedpulse(shname2,80.0,150.0,0.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);	
          delay(had2*0.5-pwS4*0.5-epsilon/4.0-pwS7*0.5);
          c_simshapedpulse("isnob5",80.0,0.0,pw*2.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);
          zgradpulse(gzlvl3, gt3);
          delay(had2*0.5-pwS4*0.5-gt3);
          rgpulse(pw*flip_angle/90.0, t1, 0.0, 0.0);
	if (flip_angle < 90.0) delay(pw*(1-flip_angle/90.0));
        if (had3*0.5-shpw1*0.5-epsilon/4.0-pwS7*0.5>0.0)		
          {
            zgradpulse(gzlvl3, 1.1*gt3);		
	    delay(epsilon/4.0-pwS7*0.5-1.1*gt3);
	    c_simshapedpulse(shname2,80.0,150.0,0.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);		
	    delay(had3*0.5-shpw1*0.5-epsilon/4.0-pwS7*0.5);		
	    shaped_pulse(shname1,shpw1,two,0.0,0.0);
	    delay((tauC3-(had2+pw*120/90*2))*0.5-pwS4*0.5-had3*0.5-shpw1*0.5);
          }
        else 
          {
            zgradpulse(gzlvl3, 1.1*gt3);		
	    delay(had3*0.5-shpw1*0.5-1.1*gt3);		
	    shaped_pulse(shname1,shpw1,two,0.0,0.0);
	    delay(epsilon/4.0-pwS7*0.5-had3*0.5-shpw1*0.5);
	    c_simshapedpulse(shname2,80.0,150.0,0.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);		
	    delay((tauC3-(had2+pw*120/90*2))*0.5-pwS4*0.5-epsilon/4.0-pwS7*0.5);
          }
	
	  c_shapedpulse("isnob5",80.0,0.0,two, 2.0e-6, 2.0e-6);  
          zgradpulse(gzlvl3, 1.1*gt3);		
	  delay((tauC3-(had2+pw*120/90*2))*0.5-pwS4*0.5-1.1*gt3);
       }

     if (fil_flg1[0] == 'c') 
       {
        /* JCOCA & JCOCB is turned off*/
          zgradpulse(gzlvl3, gt3);
	  delay(had2*0.5-pwS4*0.5-gt3);
	  c_simshapedpulse("isnob5",80.0,0.0,pw*2.0,0.0,zero,zero,zero, 2.0e-6, 2.0e-6);
          zgradpulse(gzlvl3, gt3);
	  delay(had2*0.5-pwS4*0.5-gt3);
          rgpulse(pw*flip_angle/90.0, t1, 0.0, 0.0);
	if (flip_angle < 90.0) delay(pw*(1-flip_angle/90.0));
          zgradpulse(gzlvl3, 1.1*gt3);
	  delay(had3*0.5-shpw1*0.5-1.1*gt3);		
	  shaped_pulse(shname1,shpw1,two,0.0,0.0);
	  delay((tauC3-(had2+pw*120.0/90.0*2.0))*0.5-pwS4*0.5-had3*0.5-shpw1*0.5);
	  c_shapedpulse("isnob5",80.0,0.0,two, 2.0e-6, 2.0e-6);  
          zgradpulse(gzlvl3, 1.1*gt3);
       	  delay((tauC3-(had2+pw*120.0/90.0*2.0))*0.5-pwS4*0.5-1.1*gt3);
       }

/*********************************** 2nd transfer  CB->CA +DEPT CAH ***********/
          decrgpulse(pwC, zero, 0.0, 0.0);
	  c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);  
          delay(tauC1-pwS3-pwS4*0.5);
          c_shapedpulse("reburp",80.0,0.0,zero, 2.0e-6, 2.0e-6);  
          delay(tauC1-tauC2-pwS3-pwS4*0.5);
	  c13pulse("co", "ca", "sinc", 180.0, zero, 0.0, 0.0);  
          delay(tauC2-pw*8.0-had1);
          shaped_pulse(shname1,shpw1,two,0.0,0.0);
          delay(had1);
	  c13pulse("cab", "co", "square", 90.0, zero, 0.0, 0.0);  
/******************************************************************************/
        if(dm3[B] == 'y')		         /*optional 2H decoupling off */
           {dec3rgpulse(1/dmf3, three, 0.0, 0.0); dec3blank();
            setstatus(DEC3ch, FALSE, 'w', FALSE, dmf3); dec3blank();}
  	  zgradpulse(gzlvl3, gt3);
	  delay(2.0e-4);
	  h1decon("DIPSI2", 27.0, 0.0);/*POWER_DELAY+PWRF_DELAY+PRG_START_DELAY */
	  c13pulse("co", "ca", "sinc", 90.0, t5, 2.0e-6, 0.0);          /* point e */
 	  decphase(zero);
	  delay(eta - 2.0*POWER_DELAY - 2.0*PWRF_DELAY);
					        /* 2*POWER_DELAY+2*PWRF_DELAY */
	  c13pulse("ca", "co", "square", 180.0, zero, 2.0e-6, 0.0);     /* pwS2 */
	  dec2phase(zero);
	  delay(theta - eta - pwS2 - WFG3_START_DELAY);
							  /* WFG3_START_DELAY */
	  sim3_c13pulse("", "co", "ca", "sinc", "", 0.0, 180.0, 2.0*pwN,
					     zero, zero, zero, 2.0e-6, 2.0e-6);
  	  initval(phi7cal, v7);
	  decstepsize(1.0);
	  dcplrphase(v7);					        /* SAPS_DELAY */
	  dec2phase(t8);
	  delay(theta - SAPS_DELAY);
      if (SE_flg[0]=='y')                                               /* point f */
	{
 	  nh_evol_se_train("co", "ca"); /* common part of sequence in bionmr.h  */
          if (dm3[B]=='y') lk_sample();
	}
	else
	{
	  nh_evol_train("co", "ca"); /* common part of sequence in bionmr.h  */
          if (dm3[B]=='y') lk_sample();
	}
}		 
示例#21
0
void pulsesequence()
{

/* DECLARE AND LOAD VARIABLES */

char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
            mag_flg[MAXSTR],                            /*magic angle gradient*/
            f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
	    stCdec[MAXSTR],	       /* calls STUD+ waveforms from shapelib */
	    STUD[MAXSTR];   /* apply automatically calculated STUD decoupling */
 
int         icosel1,          			  /* used to get n and p type */
	    icosel2,
            t1_counter,  		        /* used for states tppi in t1 */
            t2_counter,  	 	        /* used for states tppi in t2 */
	    ni2 = getval("ni2");

double      tau1,         				         /*  t1 delay */
            tau2,        				         /*  t2 delay */
	    del = getval("del"),     /* time delays for CH coupling evolution */
         BPdpwrspinlock,        /*  user-defined upper limit for spinlock(Hz) */
         BPpwrlimits,           /*  =0 for no limit, =1 for limit             */

	    del1 = getval("del1"),
	    del2 = getval("del2"),
/* STUD+ waveforms automatically calculated by macro "biocal"  	      */
/* and string parameter stCdec calls them from your shapelib. 	              */
   stdmf,                                /* dmf for STUD decoupling           */
   studlvl,	                         /* coarse power for STUD+ decoupling */
   rf80 = getval("rf80"), 			  /* rf in Hz for 80ppm STUD+ */
   bw, ofs, ppm,                            /* temporary Pbox parameters */
	pwClvl = getval("pwClvl"), 	        /* coarse power for C13 pulse */
        pwC = getval("pwC"),          /* C13 90 degree pulse length at pwClvl */
	rf0,            	  /* maximum fine power when using pwC pulses */

/* p_d is used to calculate the isotropic mixing on the Cab region            */
        spinlock = getval("spinlock"), /* DIPSI-3 spinlock field strength in Hz */
        p_d,                  	       /* 50 degree pulse for DIPSI-2 at rfd  */
        rfd,                    /* fine power for 7 kHz rf for 500MHz magnet  */
	ncyc = getval("ncyc"), 			  /* no. of cycles of DIPSI-3 */

/* the following pulse lengths for SLP pulses are automatically calculated    */
/* by the macro "ghcch_tocsy" .  SLP pulse shapes, "offC10" etc are called   */
/* directly from your shapelib.                    			      */
   pwC10,                       /* 180 degree selective sinc pulse on CO(174ppm) */
   pwZ,					  /* the largest of pwC10 and 2.0*pwN */
   rf10,	                 /* fine power for the pwC10 ("offC10") pulse */

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

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

	sw1 = getval("sw1"),
	sw2 = getval("sw2"),

	gt1 = getval("gt1"),  		       /* coherence pathway gradients */
	gzcal = getval("gzcal"),               /* G/cm to DAC coversion factor*/
        gzlvl1 = getval("gzlvl1"),
	gzlvl2 = getval("gzlvl2"),

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

    getstr("STUD",STUD);
    getstr("mag_flg",mag_flg);
    getstr("f1180",f1180);
    getstr("f2180",f2180);
   strcpy(stCdec, "stCdec80");
   stdmf = getval("dmf80");
   studlvl = pwClvl + 20.0*log10(compC*pwC*4.0*rf80);
   studlvl = (int) (studlvl + 0.5);
  P_getreal(GLOBAL,"BPpwrlimits",&BPpwrlimits,1);
  P_getreal(GLOBAL,"BPdpwrspinlock",&BPdpwrspinlock,1);


/*   LOAD PHASE TABLE    */

	settable(t3,2,phi3);
	settable(t6,1,phi6);
	settable(t5,4,phi5);
	settable(t10,1,phi10);
	settable(t11,4,rec);

        

/*   INITIALIZE VARIABLES   */


  if (BPpwrlimits > 0.5)
  {
   if (spinlock > BPdpwrspinlock)
    {
     spinlock = BPdpwrspinlock;  
     printf("spinlock too large, reset to user-defined limit (BPdpwrspinlock)");
     psg_abort(1);
    }
  }
    if( dpwrf < 4095 )
	{ printf("reset dpwrf=4095 and recalibrate C13 90 degree pulse");
	  psg_abort(1); }

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

      setautocal();                        /* activate auto-calibration flags */ 
        
      if (autocal[0] == 'n') 
      {
        /* "offC10": 180 degree one-lobe sinc pulse on CO, null at Ca 139ppm away */
        pwC10 = getval("pwC10");
	  rf10 = (compC*4095.0*pwC*2.0*1.65)/pwC10;     /* needs 1.65 times more     */
	  rf10 = (int) (rf10 + 0.5);		           /* power than a square pulse */

        if( pwC > (24.0e-6*600.0/sfrq) )
	  { printf("Increase pwClvl so that pwC < 24*600/sfrq");
	    psg_abort(1); 
        }
      }
      else        /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
      {
        if(FIRST_FID)                                            /* call Pbox */
        {
          ppm = getval("dfrq"); 
          bw = 118.0*ppm; ofs = 139.0*ppm;
          offC10 = pbox_make("offC10", "sinc180n", bw, ofs, compC*pwC, pwClvl);
          if(dm3[B] == 'y') H2ofs = 3.2;    
          ofs_check(H1ofs, C13ofs, N15ofs, H2ofs);
        }
        rf10 = offC10.pwrf;  pwC10 = offC10.pw;
      }
				
   /* dipsi-3 decoupling on CbCa */	
 	p_d = (5.0)/(9.0*4.0*spinlock);      /*  DIPSI-3 Field Strength */
 	rfd = (compC*4095.0*pwC*5.0)/(p_d*9.0);
	rfd = (int) (rfd + 0.5);
  	ncyc = (int) (ncyc + 0.5);


/* CHECK VALIDITY OF PARAMETER RANGES */

    if( gt1 > 0.5*del - 1.0e-4)
    {
        printf(" gt1 is too big. Make gt1 less than %f.\n", (0.5*del - 1.0e-4));
        psg_abort(1);
    }

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

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

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

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

/* PHASES AND INCREMENTED TIMES */

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

    icosel1 = -1;  icosel2 = -1;
    if (phase1 == 2) 
	{ tsadd(t6,2,4); icosel1 = -1*icosel1; }
    if (phase2 == 2) 
	{ tsadd(t10,2,4); icosel2 = -1*icosel2; tsadd(t6,2,4); }


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


/*  Set up f2180  */

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



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

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

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



/*   BEGIN PULSE SEQUENCE   */

status(A);
        if ( dm3[B] == 'y' )
          lk_sample();  
        if ((ni/sw1-d2)>0) 
         delay(ni/sw1-d2);       /*decreases as t1 increases for const.heating*/
        if ((ni2/sw2-d3)>0) 
         delay(ni2/sw2-d3);      /*decreases as t2 increases for const.heating*/
   	delay(d1);
        if ( dm3[B] == 'y' )
          { lk_hold(); lk_sampling_off();}  /*freezes z0 correction, stops lock pulsing*/

	rcvroff();
	obspower(tpwr);
	decpower(pwClvl);
 	dec2power(pwNlvl);
	decpwrf(rf0);
	obsoffset(tof);
	txphase(t3);
	delay(1.0e-5);

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

      if ( dm3[B] == 'y' )     /* begins optional 2H decoupling */
        {
          dec3rgpulse(1/dmf3,one,10.0e-6,2.0e-6);
          dec3unblank();
          dec3phase(zero);
          delay(2.0e-6);
          setstatus(DEC3ch, TRUE, 'w', FALSE, dmf3);
        }
	rgpulse(pw, t3, 0.0, 0.0);                    /* 1H pulse excitation */

        decphase(zero);
	delay(0.5*del + tau1 - 2.0*pwC);

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

        txphase(zero);
	delay(tau1);

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

                if (mag_flg[A] == 'y')
                {
                   magradpulse(icosel1*gzcal*gzlvl1,0.1*gt1);
                }
                else
                {
                   zgradpulse(icosel1*gzlvl1, 0.1*gt1);
                }
        decphase(t5);
	delay(0.5*del - 0.1*gt1);

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

	zgradpulse(gzlvl3, gt3);
        decphase(zero);
	delay(0.5*del2 - gt3);

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

	zgradpulse(gzlvl3, gt3);
        txphase(t6);
        decphase(one);
	delay(0.5*del2 - gt3);

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

	zgradpulse(gzlvl4, gt3);
        txphase(zero);
        decphase(zero);
	delay(0.5*del1 - gt3);

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

	zgradpulse(gzlvl4, gt3);
	delay(0.5*del1 - gt3);

	decrgpulse(pwC, zero, 0.0, 0.0);
	decpwrf(rfd);
	delay(2.0e-6);
	initval(ncyc, v2);
	starthardloop(v2);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
     decrgpulse(5.0*p_d,zero,0.0,0.0);
     decrgpulse(5.5*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.6*p_d,two,0.0,0.0);
     decrgpulse(7.2*p_d,zero,0.0,0.0);
     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.4*p_d,zero,0.0,0.0);
     decrgpulse(6.8*p_d,two,0.0,0.0);
     decrgpulse(7.0*p_d,zero,0.0,0.0);
     decrgpulse(5.2*p_d,two,0.0,0.0);
     decrgpulse(5.4*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.5*p_d,zero,0.0,0.0);
     decrgpulse(7.3*p_d,two,0.0,0.0);
     decrgpulse(5.1*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);

     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);
     decrgpulse(5.0*p_d,two,0.0,0.0);
     decrgpulse(5.5*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.6*p_d,zero,0.0,0.0);
     decrgpulse(7.2*p_d,two,0.0,0.0);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.4*p_d,two,0.0,0.0);
     decrgpulse(6.8*p_d,zero,0.0,0.0);
     decrgpulse(7.0*p_d,two,0.0,0.0);
     decrgpulse(5.2*p_d,zero,0.0,0.0);
     decrgpulse(5.4*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.5*p_d,two,0.0,0.0);
     decrgpulse(7.3*p_d,zero,0.0,0.0);
     decrgpulse(5.1*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);

     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);
     decrgpulse(5.0*p_d,two,0.0,0.0);
     decrgpulse(5.5*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.6*p_d,zero,0.0,0.0);
     decrgpulse(7.2*p_d,two,0.0,0.0);
     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.4*p_d,two,0.0,0.0);
     decrgpulse(6.8*p_d,zero,0.0,0.0);
     decrgpulse(7.0*p_d,two,0.0,0.0);
     decrgpulse(5.2*p_d,zero,0.0,0.0);
     decrgpulse(5.4*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.5*p_d,two,0.0,0.0);
     decrgpulse(7.3*p_d,zero,0.0,0.0);
     decrgpulse(5.1*p_d,two,0.0,0.0);
     decrgpulse(7.9*p_d,zero,0.0,0.0);

     decrgpulse(4.9*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
     decrgpulse(5.0*p_d,zero,0.0,0.0);
     decrgpulse(5.5*p_d,two,0.0,0.0);
     decrgpulse(0.6*p_d,zero,0.0,0.0);
     decrgpulse(4.6*p_d,two,0.0,0.0);
     decrgpulse(7.2*p_d,zero,0.0,0.0);
     decrgpulse(4.9*p_d,two,0.0,0.0);
     decrgpulse(7.4*p_d,zero,0.0,0.0);
     decrgpulse(6.8*p_d,two,0.0,0.0);
     decrgpulse(7.0*p_d,zero,0.0,0.0);
     decrgpulse(5.2*p_d,two,0.0,0.0);
     decrgpulse(5.4*p_d,zero,0.0,0.0);
     decrgpulse(0.6*p_d,two,0.0,0.0);
     decrgpulse(4.5*p_d,zero,0.0,0.0);
     decrgpulse(7.3*p_d,two,0.0,0.0);
     decrgpulse(5.1*p_d,zero,0.0,0.0);
     decrgpulse(7.9*p_d,two,0.0,0.0);
	endhardloop();

        dec2phase(zero);
        decphase(zero);
        txphase(zero);
	decpwrf(rf10);
	delay(tau2);
							  /* WFG3_START_DELAY */
	sim3shaped_pulse("", "offC10", "", 2.0*pw, pwC10, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
        if(pwC10>2.0*pwN) pwZ=0.0; else pwZ=2.0*pwN - pwC10;

	delay(tau2);
	decpwrf(rf0);
                if (mag_flg[A] == 'y')
                {
                   magradpulse(-icosel2*gzcal*gzlvl2, 1.8*gt1);
                }
                else
                {
                   zgradpulse(-icosel2*gzlvl2, 1.8*gt1);
                }
	delay(2.02e-4);

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

	decpwrf(rf10);
                if (mag_flg[A] == 'y')
                {
                   magradpulse(icosel2*gzcal*gzlvl2, 1.8*gt1);
                }
                else
                {
                   zgradpulse(icosel2*gzlvl2, 1.8*gt1);
                }
	delay(2.0e-4 + WFG3_START_DELAY + pwZ);

	decshaped_pulse("offC10", pwC10, zero, 0.0, 0.0);
	decpwrf(rf0);
	decrgpulse(pwC, zero, 2.0e-6, 0.0);

	zgradpulse(gzlvl5, gt5);
	delay(0.5*del1 - gt5);

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

	zgradpulse(gzlvl5, gt5);
	txphase(one);
	decphase(t10);
	delay(0.5*del1 - gt5);

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

	zgradpulse(gzlvl6, gt5);
	txphase(zero);
	decphase(zero);
	delay(0.5*del2 - gt5);

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

	zgradpulse(gzlvl6, gt5);
	delay(0.5*del2 - gt5);

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

	delay(0.5*del - 0.5*pwC);

	simpulse(2.0*pw,2.0*pwC, zero, zero, 0.0, 0.0);
        if (mag_flg[A] == 'y')
            magradpulse(gzcal*gzlvl1, gt1);
        else
            zgradpulse(gzlvl1, gt1);
        rcvron();
   if ((STUD[A]=='n') && (dm[C] == 'y'))
        decpower(dpwr);
        if ( dm3[B] == 'y' )   /* turns off 2H decoupling  */
        {
           delay(0.5*del-40.0e-6 -gt1 -1/dmf3);
           setstatus(DEC3ch, FALSE, 'c', FALSE, dmf3);
           dec3rgpulse(1/dmf3,three,2.0e-6,2.0e-6);
           dec3blank();
           lk_autotrig();   /* resumes lock pulsing */
           lk_sample();
           if (mag_flg[A] == 'y')
            statusdelay(C,40.0e-6  - 2.0*VAGRADIENT_DELAY - POWER_DELAY);
           else
            statusdelay(C,40.0e-6  - 2.0*GRADIENT_DELAY - POWER_DELAY);
        }
      else
        {
         delay(0.5*del-40.0e-6 -gt1);
        if (mag_flg[A] == 'y')
         statusdelay(C,40.0e-6  - 2.0*VAGRADIENT_DELAY - POWER_DELAY);
        else
         statusdelay(C,40.0e-6  - 2.0*GRADIENT_DELAY - POWER_DELAY);
        }
  if ((STUD[A]=='y') && (dm[C] == 'y'))
        {decpower(studlvl);
         decunblank();
         decon();
         decprgon(stCdec,1/stdmf, 1.0);
         startacq(alfa);
         acquire(np, 1.0/sw);
         decprgoff();
         decoff();
         decblank();
        }
 setreceiver(t11);
}		 
示例#22
0
pulsesequence()
{
   double	   slpwrR = getval("slpwrR"),
		   slpwR = getval("slpwR"),
		   mixR = getval("mixR"),
                   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"),
		   selfrq = getval("selfrq"),
                   gzlvl1 = getval("gzlvl1"),
                   gt1 = getval("gt1"),
                   gzlvl2 = getval("gzlvl2"),
                   gt2 = getval("gt2"),
                   zqfpw1 = getval("zqfpw1"),
                   zqfpwr1 = getval("zqfpwr1"),
                   gzlvlzq1 = getval("gzlvlzq1"),
                   phincr1 = getval("phincr1");
   char            selshapeA[MAXSTR],selshapeB[MAXSTR], slpatR[MAXSTR],
                   zqfpat1[MAXSTR], alt_grd[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("slpatR",slpatR);
   getstr("selshapeA",selshapeA);
   getstr("selshapeB",selshapeB);
   getstr("zqfpat1",zqfpat1);
   getstr("alt_grd",alt_grd);

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

/* STEADY-STATE PHASECYCLING */
/* This section determines if the phase calculations trigger off of (SS - SSCTR) or off of CT */

  assign(ct,v17);
   ifzero(ssctr);
      assign(v17,v13);
   elsenz(ssctr);
                /* purge option does not adjust v13 during steady state */
      sub(ssval, ssctr, v13);
   endif(ssctr);

/* Beginning phase cycling */

   dbl(v13,v1);		/* v1 = 0 2 */
   hlv(v13,v13);
   dbl(v13,v20);		/* v20 = 00 22 */
   hlv(v13,v13);
   dbl(v13,v6);		/* v6 = 0000 2222 */
   hlv(v13,v13);
   dbl(v13,v7);		/* v7 = 00000000 22222222 */

   assign(v1,oph);

   if (getflag("Gzqfilt"))
      add(v7,oph,oph);

/* CYCLOPS */

   assign(v13,v14);	/* v14 = 8x0 8x1 8x2 8x3 */
   
   if (getflag("Gzqfilt"))
      hlv(v13,v14);	/* v14 = 16x0 16x1 16x2 16x3 */

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

/*  add(oph,v18,oph);
  add(oph,v19,oph); */
  assign(zero,v9);

   mod2(ct,v2);    /* 01 01 */
   hlv(ct,v11); hlv(v11,v11); mod2(v11,v11); dbl(v11,v11); /* 0000 2222 */
   add(v11,v2,v11); mod4(v11,v11); /* 0101 2323  first echo in Excitation Sculpting */
   hlv(ct,v4); mod2(v4,v4);    /* 0011 */
   hlv(ct,v12); hlv(v12,v12); hlv(v12,v12); dbl(v12,v12); add(v12,v4,v12);
   mod4(v12,v12);   /* 0011 0011 2233 2233 second echo in Excitation Sculpting */

   dbl(v2,v2);    /* 0202 */
   dbl(v4,v4);    /* 0022 */
   add(v2,v4,v4); /* 0220 correct oph for Excitation Sculpting */
   add(oph,v4,oph); mod4(oph,oph);

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

   if (alt_grd[0] == 'y') mod2(ct,v8); /* alternate gradient sign on even scans */

/* The following is for flipback pulse */
   if (phincr1 < 0.0) phincr1=360+phincr1;
   initval(phincr1,v5);

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

   if (getflag("lkgate_flg"))  lk_sample(); /* turn lock sampling on */

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

   delay(d1);

   if (getflag("lkgate_flg"))  lk_hold(); /* turn lock sampling off */

   status(B);
      rgpulse(pw, v1, rof1, rof1);
      if (selfrq != tof)
	obsoffset(selfrq);

        ifzero(v8); zgradpulse(gzlvlA,gtA);
        elsenz(v8); zgradpulse(-gzlvlA,gtA); endif(v8);
        delay(gstab);
        obspower(selpwrA);
        shaped_pulse(selshapeA,selpwA,v14,rof1,rof1);
        obspower(tpwr);
        ifzero(v8); zgradpulse(gzlvlA,gtA);
        elsenz(v8); zgradpulse(-gzlvlA,gtA); endif(v8);
        delay(gstab);

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

        ifzero(v8); zgradpulse(gzlvlB,gtB);
        elsenz(v8); zgradpulse(-gzlvlB,gtB); endif(v8);
        delay(gstab);
        obspower(selpwrB);
        shaped_pulse(selshapeB,selpwB,v6,rof1,rof1);
        obspower(slpwrR);
        ifzero(v8); zgradpulse(gzlvlB,gtB);
        elsenz(v8); zgradpulse(-gzlvlB,gtB); endif(v8);
        delay(gstab);

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

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

    if (getflag("Gzqfilt"))
    {
     obspower(tpwr);
     rgpulse(pw,v7,rof1,rof1);

     ifzero(v8); zgradpulse(gzlvl1,gt1);
     elsenz(v8); zgradpulse(-gzlvl1,gt1); endif(v8);
     delay(gstab);

     obspower(zqfpwr1);
     ifzero(v8); rgradient('z',gzlvlzq1);
     elsenz(v8); rgradient('z',-gzlvlzq1); endif(v8);
     delay(100.0e-6);
     shaped_pulse(zqfpat1,zqfpw1,zero,rof1,rof1);
     delay(100.0e-6);
     rgradient('z',0.0);
     delay(gstab);
    
     ifzero(v8); zgradpulse(-gzlvl2,gt2);
     elsenz(v8); zgradpulse(gzlvl2,gt2); endif(v8);
     obspower(tpwr);
     delay(gstab);

     if (getflag("flipback"))
           FlipBack(v14,v5);
     rgpulse(pw,v14,rof1,2.0e-6);
    }

    ExcitationSculpting(v11,v12,v8);
    delay(rof2);
   
   status(C);
}
示例#23
0
void pulsesequence()
{
/* DECLARE AND LOAD VARIABLES */
char
	ch90shape[MAXSTR],
	ch180shape[MAXSTR],
        exp_mode[MAXSTR],   /* flag to run 3D, or 2D time-shared 15N TROSY /13C HSQC-SE*/    
        decCACO[MAXSTR],    
        caco180shape[MAXSTR],
	f1180[MAXSTR],   		              /* Flag to start t1 @ halfdwell */
	f2180[MAXSTR],
	f3180[MAXSTR],
	f4180[MAXSTR];			                    /* do TROSY on N15 and H1 */
 
int         icosel, max_pcyc;      			  /* used to get n and p type */
     
double  
        tpwrs,
        ni2=getval("ni2"),
        ni3=getval("ni3"),
        tau1, tau1p,tau2,tau3,tau3p,         /*evolution times in indirect dimensions */
        tauNH=getval("tauNH"),                                             /* 1/(4Jhn)*/
        tauCH=getval("tauCH"),                                            /* 1/(4Jch) */
        tauCH1= getval("tauCH1"),     /* tauCH/2.0+tauNH/2.0,*/ /* 1/(8Jch) +1/(8Jnh) */
        tauCH2= getval("tauCH2"),
        swC = getval("swC"),                        /* spectral widths in 13C methyls */
	pwClvl = getval("pwClvl"), 	  	        /* coarse power for C13 pulse */
	pwC = getval("pwC"),     	      /* C13 90 degree pulse length at pwClvl */
        swN = getval("swN"),                                /* spectral widths in 15N */  	              
	pwNlvl = getval("pwNlvl"),	                      /* power for N15 pulses */
        pwN = getval("pwN"),                  /* N15 90 degree pulse length at pwNlvl */   
        ch90pwr=getval("ch90pwr"),
        ch90pw=getval("ch90pw"),
	ch90corr=getval("ch90corr"),
        ch90dres=getval("ch90dres"),
        ch90dmf=getval("ch90dmf"),
 	ch180pw=getval("ch180pw"),
	ch180pwr=getval("ch180pwr"),
        caco180pw=getval("caco180pw"),
        caco180pwr=getval("caco180pwr"),
        mix=getval("mix"),
        tpwrsf_d = getval("tpwrsf_d"), /* fine power adustment for first soft pulse(down)*/
        tpwrsf_u = getval("tpwrsf_u"), /* fine power adustment for second soft pulse(up) */
        pwHs = getval("pwHs"),                     /* H1 90 degree pulse length at tpwrs */
        compH =getval("compH"),

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

	gzlvl0 = getval("gzlvl0"),
	gzlvl1 = getval("gzlvl1"),
	gzlvl2 = getval("gzlvl2"),
	gzlvl3 = getval("gzlvl3"),
	gzlvl4 = getval("gzlvl4"),
	gzlvl5 = getval("gzlvl5"),	
        gzlvl6 = getval("gzlvl6"),
	gzlvl7 = getval("gzlvl7"),
	gzlvl8 = getval("gzlvl8"),
	gzlvl9 = getval("gzlvl9"),
	gzlvl10 = getval("gzlvl10"),
        gzlvl11 = getval("gzlvl11");

        getstr("f1180",f1180);
        getstr("f2180",f2180);
        getstr("ch180shape",ch180shape);
        getstr("ch90shape",ch90shape);
        getstr("decCACO",decCACO);
        getstr("caco180shape",caco180shape);
        getstr("exp_mode",exp_mode);

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

        if (tpwrsf_d<4095.0)
         tpwrs=tpwrs+6.0;  /* add 6dB to let tpwrsf_d control fine power ~2048*/

      if( (exp_mode[A]!='2') && (exp_mode[A]!='3') && (exp_mode[A]!='4') )
          {text_error("invalid exp_mode, Should be either 2D or 3D or 4D\n "); psg_abort(1); }

/*   LOAD PHASE TABLE    */
	
        
        settable(t1,1,phi1);
        settable(t2,4,phi2);
	settable(t12,4,phi2); {tsadd(t12,2,4);}

        settable(t3,1,phi3);
        settable(t4,2,phi4);
        settable(t5,2,phi5);
        settable(t6,4,phi6);
        
        settable(t7,8,phi7);
        settable(t8,8,phi8);
 
        /* changing sign */

         if( (exp_mode[A]=='4') && (exp_mode[C]=='a') )
              {tsadd(t7,2,4); tsadd(t5,2,4); }
      

	settable(t21,1,psi1);                          /*trosy and SE hsqc in reverse INPET */
	settable(t22,1,psi2);
        settable(t23,1,psi2c);

        if(exp_mode[A]=='2') {settable(t31,2,rec);}
        if(exp_mode[A]=='3') {settable(t31,4,rec);}
	if(exp_mode[A]=='4') {settable(t31,8,rec);}

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


/* special case for  swapping t2 and t3 for test purposes */

if( (exp_mode[A]=='4') && (exp_mode[B]=='x') && (ni3=1) )
	{	
	 text_error("Acquiring t3 axis in ni2 dimension (instead of t2), set nt to 8! "); 
         tau3  = 0.5*(d3_index/swC+0.5/swC)-pw-rof1 -pwC*2.0/M_PI ;  /* increment corresponds to 13C increment */
	 tau3p = 0.5*(d3_index/swN+0.5/swN) -pw-rof1  -pwC -pwN*2.0/M_PI -tau3; 
         if(d3_index % 2)    { tsadd(t7,2,4); tsadd(t8,2,4); tsadd(t31,2,4); }
    	 if (phase2 == 2)  {tsadd(t7 ,1,4); tsadd(t8 ,1,4);}
         tau2=0.0;
        }
else    {    
         if (phase2 == 2)  {tsadd(t2 ,1,4); tsadd(t12,1,4);}
         if (phase3 == 2)  {tsadd(t7 ,1,4); tsadd(t8 ,1,4);}
         if(d3_index % 2)    { tsadd(t2,2,4);  tsadd(t12,2,4); tsadd(t31,2,4); }    
         tau3  = 0.5*(d4_index/swC+0.5/swC)-pw -rof1 -pwC*2.0/M_PI ;  /* increment corresponds to 13C increment */
         tau3p = 0.5*(d4_index/swN+0.5/swN) -pw -rof1 -pwC -pwN*2.0/M_PI -tau3; 
         if(d4_index % 2)    { tsadd(t7,2,4); tsadd(t8,2,4); tsadd(t31,2,4); }
         tau2 = d3;
         tau2 += 0.0*(-pw*4.0/M_PI-rof1*2.0);
         if((f2180[A] == 'y') && (ni2 > 0.0)) {tau2 += ( 1.0 / (2.0*sw2) );  }
         if(tau2 < 0.2e-6) {tau2 = 0.0;}
         tau2 = tau2/2.0;
        }

 
/* simultaneous Ntrosy-ChsqcSE, last part */
/*  Phase incrementation for hypercomplex 2D data, States-Haberkorn element */

       if (phase1 == 1)    {icosel =  1;  }
            else 	  {  tsadd(t21,2,4);  tsadd(t22,2,4); tsadd(t23,2,4); icosel = -1;  }

       if(d2_index % 2)   { tsadd(t4,2,4); tsadd(t5,2,4); tsadd(t31,2,4); }  
          /* ECHO-ANTIECHO + STATES-TPPI t1, t1' in TROSY/HSQC last step */

       tau1  = 1.0*d2_index/swC;  /* increment corresponds to 13C increment */
       tau1p = 1.0*d2_index*(1.0/swN-1.0/swC); 
    
/* BEGIN PULSE SEQUENCE */

status(A);

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

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

        delay(d1); 

  
/* Destroy 13C magnetization*/

       decrgpulse(pwC*1.0, zero, 0.0, 0.0); 
       zgradpulse(-gzlvl0, gt0);
       delay(gstab);

       /* NOESY */

if(exp_mode[A]!='2')
{  /* 3-4D */

     if(exp_mode[A]=='4')
	{ /* full 4D */
          /* t3 evolution, the very first HSQC */

 	      /* Hz -> HzXz INEPT */

	   	rgpulse(pw,two,rof1,rof1);                         /* 1H pulse excitation */
 	        zgradpulse(gzlvl7, gt0);      delay(tauCH-gt0);
	        decrgpulse(pwC*2.0, zero, 0.0, 0.0); delay(tauNH -tauCH -pwC*2.0 );
	   	sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
 	  	delay(tauNH - gt0 -gstab); zgradpulse(gzlvl7, gt0); delay(gstab);
 		rgpulse(pw, one, rof1, rof1);

             /* water defoc-refoc */
               delay(gstab); zgradpulse(gzlvl8, gt8); delay(gstab);

              /* t3 time */

               if((ni3==0))
                {
		 dec2rgpulse(pwN,t7,0.0,0.0);
     		 dec2rgpulse(pwN,two,0.0,0.0);   
		 decrgpulse(pwC, t8, 0.0, 0.0);
		 decrgpulse(pwC, two, 0.0, 0.0);
		 rgpulse(pw*2.0, zero, rof1, rof1);
                 delay(pwN*2.0+pwC*2.0);
                }
               else
                {
	      	 dec2rgpulse(pwN,t7,0.0,0.0);
                 delay(tau3p);
		 decrgpulse(pwC, t8, 0.0, 0.0);
                 delay(tau3);
		 rgpulse(pw*2.0, zero, rof1, rof1);
                 delay(tau3);
		 decrgpulse(pwC, two, 0.0, 0.0);
		 delay(tau3p);
		 dec2rgpulse(pwN,two,0.0,0.0);
                }

		/* water defoc-refoc */
               delay(gstab); zgradpulse(gzlvl8, gt8); delay(gstab);

	   	/* back inept, water to +Z */
 
		rgpulse(pw,one,rof1,rof1);                  
 	        zgradpulse(gzlvl9, gt0);      delay(tauCH-gt0);
	        decrgpulse(pwC*2.0, zero, 0.0, 0.0); delay(tauNH -tauCH -pwC*2.0 );
	   	sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
 	  	delay(tauNH - gt0 -gstab); zgradpulse(gzlvl9, gt0); delay(gstab);
 		rgpulse(pw,  two, rof1, rof1);

              /* purge */

		zgradpulse(gzlvl10, gt10); delay(2.0*gstab);


        }     /*end of full 4D */


  /************************* t2 evolution, 1H and NOE****************************** */
		/* for the case of no flipbacks in NOE part of the experiment, shift first pulse
                   in t2 time by 45 deg and let water bring itself back at the end
                   of mixing time by radiation dumping */

 		if(   (exp_mode[D]=='t') ) 
                 { initval(1.0, v10);
	           obsstepsize(45.0);
	           xmtrphase(v10);       
 		 } 
                else 
                 {
		   xmtrphase(zero);
		   obspower(tpwrs); obspwrf(tpwrsf_d);                         
		   shaped_pulse("H2Osinc",pwHs,t12,rof1,rof1);
		   obspower(tpwr); obspwrf(4095.0);
	         }
             
	        rgpulse(pw,t2,rof1,rof1);    
	        xmtrphase(zero);   /* SAPS_DELAY */
	        delay(tau2);

 	        decrgpulse(2.0*pwC,zero,0.0,0.0);  dec2rgpulse(2.0*pwN,zero,0.0,0.0);
	         
	        delay(tau2);

	        rgpulse(pw*2.0,zero,rof1,rof1);
	        delay(pwN*2.0+pwC*2.0 + SAPS_DELAY);
	        rgpulse(pw,zero,rof1,rof1);
               
		if(   (exp_mode[D]!='t') )
		{
		  obspower(tpwrs); obspwrf(tpwrsf_u);                         
		  shaped_pulse("H2Osinc",pwHs,zero,rof1,rof1);
		  obspower(tpwr);  obspwrf(4095.0);
 		}

	      /* NOESY period */

 	        delay(mix-gt2-4.0*gstab );     
		zgradpulse(gzlvl2, gt2);
		delay(4.0*gstab);
              
} /* end 3-4 D acquisition */


/* N-TROSY/C-HSQCse   */

       /* Hz -> HzXz INEPT */

   	rgpulse(pw,two,rof1,rof1);                 /* 1H pulse excitation */
        zgradpulse(gzlvl0, gt0);
        delay(tauCH-gt0);
        decrgpulse(pwC*2.0, zero, 0.0, 0.0); 	
	delay(tauNH -tauCH -pwC*2.0 );
   	sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
   	delay(tauNH - gt0 -gstab);
	zgradpulse(gzlvl0, gt0);
	delay(gstab);
 	rgpulse(pw, one, rof1, rof1);

       /* on HzXz now */
      /* water flipback*/
        obspower(tpwrs); obspwrf(tpwrsf_u);
 	shaped_pulse("H2Osinc",pwHs,two,rof1,rof1);
	obspower(tpwr); obspwrf(4095.0);

       /* purge */
	zgradpulse(gzlvl3, gt3);
	dec2phase(t4);
	delay(gstab*2.0);

       /* t1 (C) and  t1+t1'(N) evolution */

   	dec2rgpulse(pwN, t4, 0.0, 0.0);
        delay(gt4+gstab  + gt4+gstab + pwC*3.0 
			+2.0*(pwHs +2.0*rof1));
	if(decCACO[A]=='y'){ delay(2.0*caco180pw);}
	dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);  
 	delay(tau1p);   /* t1 */        
        decrgpulse(pwC,t5,0.0,0.0);
        delay(tau1*0.5);
	if(decCACO[A]=='y')
	 {
          decpower(caco180pwr);
          decshaped_pulse(caco180shape,caco180pw,zero, 0.0, 0.0);
          decpower(pwClvl);
         }
	obspower(ch180pwr);                           /*180 on methyls*/
        shaped_pulse(ch180shape,ch180pw,zero,rof1,rof1);
	obspower(tpwr);
        delay(tau1*0.5);             
       	zgradpulse(gzlvl4, gt4);        /*coding */
	delay(gstab + pwHs -ch180pw -2.0*GRADIENT_DELAY -2.0*POWER_DELAY -WFG_START_DELAY- WFG_STOP_DELAY);
        decrgpulse(2.0*pwC,zero,0.0,0.0);
	if(decCACO[A]=='y')
	 {
          decpower(caco180pwr);
          decshaped_pulse(caco180shape,caco180pw,zero, 0.0, 0.0);
          decpower(pwClvl);
         }
        /* delay(ch180pw+2.0*rof1);*/
       	zgradpulse(gzlvl5, gt4);
        delay(gstab - rof1 -2.0*GRADIENT_DELAY -2.0*POWER_DELAY -WFG_START_DELAY- WFG_STOP_DELAY);
       
       /*Water flipback (flipdown actually ) */
         obspower(tpwrs); obspwrf(tpwrsf_d);                         
 	shaped_pulse("H2Osinc",pwHs,three,rof1,rof1);
	obspower(tpwr);  obspwrf(4095.0); 
     
/* reverse double INEPT */


        sim3pulse(pw, pwC, 0.0, t21, t23, zero, rof1, rof1);
        /* rgpulse(pw, t21, rof1, rof1); */
        zgradpulse(gzlvl11, gt1);		 
        delay(gstab);
        delay(tauCH1 -gt1 -gstab -2.0*pwC 
	+     (-2.0/M_PI*pwC-0.5*(pwN-pwC) +pwN)); 
        decrgpulse(2.0*pwC,zero,0.0,0.0);
        delay(tauNH -tauCH1 - 0.65*(pw + pwN)-rof1 -(pwC-pw) 
	-(-2.0/M_PI*pwC-0.5*(pwN-pwC) +pwN) );
        sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
        zgradpulse(gzlvl11, gt1);		 
        delay(gstab);
        delay(tauCH1-gt1 -gstab-2.0*pwC); 
        decrgpulse(2.0*pwC,zero,0.0,0.0);
        delay(tauNH -1.3*pwN -tauCH1);    
        sim3pulse(pw, pwC, pwN, one, zero, zero, 0.0, 0.0);
        zgradpulse(gzlvl1, gt1);		 
        delay(gstab);
        delay(tauCH2-2.0*pwC-gt1-gstab); 
        decrgpulse(2.0*pwC,zero,0.0,0.0);
        delay(tauNH -1.3*pwN-tauCH2);
        sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0); 
        zgradpulse(gzlvl1, gt1);		 
        delay(gstab);
        delay(tauNH-1.6*pwN -POWER_DELAY -ch90pw*ch90corr -gt1-gstab +pwN*0.5 -PRG_START_DELAY);
  
        /* delay(ch90pw*0.5);
           sim3pulse(0.0,0.0, pwN, one, zero, t22, 0.0, 0.0);  
           delay(ch90pw*0.5);*/
        /* sim3shaped_pulse(ch90shape,"hard","hard",ch90pw,0.0, pwN, zero,zero, t22,0.0,0.0);*/

        /*  ch90corr is a fraction of ch90pw to correct for a 1H phase rollcaused by shaped 90 on
            CH3 protons for a sinc pulse ch90corr=0.41 seems to be good. */ 

        obspower(ch90pwr);
        txphase(one);
        obsunblank();    xmtron();
        obsprgon(ch90shape,1.0/ch90dmf,ch90dres);                          /*PRG_START_DELAY */
        delay(ch90pw*ch90corr-pwN*0.5);
        dec2rgpulse(pwN, t22, 0.0, 0.0);
        delay(ch90pw*(1.0-ch90corr)-pwN*0.5);
        obsprgoff();  xmtroff();    obsblank();                             /*PRG_STOP_DELAY */
        obspower(tpwr);                                                        /*POWER_DEALY */	 
        delay( gstab +gt6 +2.0*GRADIENT_DELAY 
               +2.0*POWER_DELAY -0.65*pw -POWER_DELAY
		+pwN*0.5 -ch90pw*(1.0-ch90corr) 
                -PRG_STOP_DELAY);
        rgpulse(2.0*pw, zero, rof1, rof1);
	dec2power(dpwr2); decpower(dpwr);	                            /* 2.0*POWER_DELAY */

        zgradpulse(gzlvl6*icosel, gt6);		                         /* 2.0*GRADIENT_DELAY */
        delay(gstab);
   status(C);

	setreceiver(t31);
}		 
示例#24
0
pulsesequence()
{



    /* DECLARE AND LOAD VARIABLES */

    char        f1180[MAXSTR],   		      /* Flag to start t1 @ halfdwell */
                mag_flg[MAXSTR],       /*magic-angle coherence transfer gradients */
                f2180[MAXSTR],    		      /* Flag to start t2 @ halfdwell */
                C13refoc[MAXSTR],		/* C13 sech/tanh pulse in middle of t1*/
                NH2only[MAXSTR];		       /* spectrum of only NH2 groups */


    int         icosel,          			  /* used to get n and p type */
                t1_counter,  		        /* used for states tppi in t1 */
                t2_counter,  	 	        /* used for states tppi in t2 */
                PRexp,                          /* projection-reconstruction flag */
                ni2 = getval("ni2");

    double      tau1,         				         /*  t1 delay */
                mix = getval("mix"),		 	    /* NOESY mix time */
                tau2,        				         /*  t2 delay */
                lambda = 0.94/(4.0*getval("JNH")),	    /* 1/4J H1 evolution delay */
                tNH = 1.0/(4.0*getval("JNH")),	  /* 1/4J N15 evolution delay */
                csa, sna,
                pra = M_PI*getval("pra")/180.0,
                /* temporary Pbox parameters */
                bw, pws, ofs, ppm, nst,  /* bandwidth, pulsewidth, offset, ppm, # steps */
                /* the sech/tanh pulse is automatically calculated by the macro "biocal", */
                /* and is called directly from your shapelib.                  		      */
                pwClvl = getval("pwClvl"), 	  	        /* coarse power for C13 pulse */
                pwC = getval("pwC"),     	      /* C13 90 degree pulse length at pwClvl */
                rf0,            	          /* maximum fine power when using pwC pulses */
                rfst,	                           /* fine power for the stCall pulse */
                compH = getval("compH"),         /* adjustment for H1 amplifier compression */
                compC = getval("compC"),         /* adjustment for C13 amplifier compression */
                dof100,	      /* C13 frequency at 100ppm for both aliphatic & aromatic*/

                tpwrsf = getval("tpwrsf"),   /* fine power adjustment for flipback pulse*/
                pwHs = getval("pwHs"),	        /* H1 90 degree pulse length at tpwrs */
                tpwrs,	  	              /* power for the pwHs ("H2Osinc") pulse */

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

                sw1 = getval("sw1"),
                sw2 = getval("sw2"),

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

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

    getstr("f1180",f1180);
    getstr("mag_flg",mag_flg);
    getstr("f2180",f2180);
    getstr("C13refoc",C13refoc);
    getstr("NH2only",NH2only);

    csa = cos(pra);
    sna = sin(pra);


    /*   LOAD PHASE TABLE    */

    settable(t1,2,phi1);
    settable(t3,4,phi3);

    settable(t9,16,phi9);
    settable(t10,1,phi10);
    settable(t11,8,rec);




    /*   INITIALIZE VARIABLES   */

    /* maximum fine power for pwC pulses (and initialize rfst) */
    rf0 = 4095.0;
    rfst=0.0;

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

    if (autocal[0] == 'n')
    {
        /* 180 degree adiabatic C13 pulse from 0 to 200 ppm */
        if (C13refoc[A]=='y')
        {
            rfst = (compC*4095.0*pwC*4000.0*sqrt((30.0*sfrq/600.0+7.0)/0.35));
            rfst = (int) (rfst + 0.5);
            if ( 1.0/(4000.0*sqrt((30.0*sfrq/600.0+7.0)/0.35)) < pwC )
            {   text_error( " Not enough C13 RF. pwC must be %f usec or less.\n",
                            (1.0e6/(4000.0*sqrt((30.0*sfrq/600.0+7.0)/0.35))) );
                psg_abort(1);
            }
        }
    }
    else        /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */
    {
        if(FIRST_FID)                                            /* call Pbox */
        {
            if (C13refoc[A]=='y')
            {
                ppm = getval("dfrq");
                ofs = 0.0;
                pws = 0.001;  /* 1 ms long pulse */
                bw = 200.0*ppm;
                nst = 1000;          /* nst - number of steps */
                stC200 = pbox_makeA("stC200", "sech", bw, pws, ofs, compC*pwC, pwClvl, nst);
            }
            ofs_check(H1ofs, C13ofs, N15ofs, H2ofs);
        }
        if (C13refoc[A]=='y') rfst = stC200.pwrf;
    }

    /* 180 degree adiabatic C13 pulse from 0 to 200 ppm */
    dof100 = dof + 65.0*dfrq;

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




    /* CHECK VALIDITY OF PARAMETER RANGES */

    if ( (mix - gt4 - gt5) < 0.0 )
    {   text_error("mix is too small. Make mix equal to %f or more.\n",(gt4 + gt5));
        psg_abort(1);
    }

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

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

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

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

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



    /* PHASES AND INCREMENTED TIMES */

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

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


    /*  Set up f1180  */

    PRexp = 0;
    if((pra > 0.0) && (pra < 90.0)) PRexp = 1;

    if(PRexp)                /* set up Projection-Reconstruction experiment */
        tau1 = d2*csa;
    else
        tau1 = d2;
    if((f1180[A] == 'y') && (ni > 1.0))
    {
        tau1 += ( 1.0 / (2.0*sw1) );
        if(tau1 < 0.2e-6) tau1 = 0.0;
    }
    tau1 = tau1/2.0;


    /*  Set up f2180  */

    if(PRexp)
        tau2 = d2*sna;
    else
    {
        tau2 = d3;
        if((f2180[A] == 'y') && (ni2 > 1.0))
        {
            tau2 += ( 1.0 / (2.0*sw2) );
            if(tau2 < 0.2e-6) tau2 = 0.0;
        }
    }
    tau2 = tau2/2.0;


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

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

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



    /*  Correct inverted signals for NH2 only spectra  */

    if (NH2only[A]=='y')
    {
        tsadd(t3,2,4);
    }



    /* BEGIN PULSE SEQUENCE */

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

    delay(d1);

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

    txphase(t1);
    decphase(zero);
    dec2phase(zero);
    initval(135.0,v1);
    obsstepsize(1.0);
    xmtrphase(v1);
    delay(5.0e-4);
    rcvroff();


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

    xmtrphase(zero);					/* SAPS_DELAY */
    txphase(zero);


    if (tau1 > (2.0*GRADIENT_DELAY + pwN + 0.64*pw + 5.0*SAPS_DELAY))
    {
        if (tau1>0.002)
        {
            zgradpulse(gzlvl6, 0.8*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
            delay(0.2*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw) - SAPS_DELAY);
        }
        else
        {
            delay(tau1-pwN-0.64*pw);
        }
        if (C13refoc[A]=='y')
            sim3pulse(0.0, 2.0*pwC, 2.0*pwN, zero, zero, zero, 0.0, 0.0);
        else
            dec2rgpulse(2.0*pwN, zero, 0.0, 0.0);
        if (tau1>0.002)
        {
            zgradpulse(-1.0*gzlvl6, 0.8*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw));
            delay(0.2*(tau1 - 2.0*GRADIENT_DELAY - pwN - 0.64*pw) - SAPS_DELAY);
        }
        else
        {
            delay(tau1-pwN-0.64*pw);
        }
    }
    else if (tau1 > (0.64*pw + 0.5*SAPS_DELAY))
        delay(2.0*tau1 - 2.0*0.64*pw - SAPS_DELAY );

    rgpulse(pw, zero, 0.0, 0.0);

    delay(mix - gt4 - gt5 -gstab -200.0e-6);
    dec2rgpulse(pwN, zero, 0.0, 0.0);
    zgradpulse(gzlvl4, gt4);
    delay(gstab);

    rgpulse(pw, zero, 200.0e-6,0.0);			       /* HSQC begins */

    dec2phase(zero);
    zgradpulse(gzlvl0, gt0);
    delay(lambda - gt0);

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

    txphase(one);
    zgradpulse(gzlvl0, gt0);
    delay(lambda - gt0);

    rgpulse(pw, one, 0.0, 0.0);
    txphase(two);
    if (tpwrsf<4095.0)
    {
        obspower(tpwrs+6.0);
        obspwrf(tpwrsf);
        shaped_pulse("H2Osinc", pwHs, two, 5.0e-4, 0.0);
        obspower(tpwr);
        obspwrf(4095.0);
    }
    else
    {
        obspower(tpwrs);
        shaped_pulse("H2Osinc", pwHs, two, 5.0e-4, 0.0);
        obspower(tpwr);
    }
    zgradpulse(gzlvl3, gt3);
    dec2phase(t3);
    decpwrf(rfst);
    decoffset(dof100);
    delay(2.0e-4);
    dec2rgpulse(pwN, t3, 0.0, 0.0);
    decphase(zero);


    /*  xxxxxxxxxxxxxxxxxx    OPTIONS FOR N15 EVOLUTION    xxxxxxxxxxxxxxxxxxxxx  */

    txphase(zero);
    dec2phase(t9);

    if (NH2only[A]=='y')
    {
        delay(tau2);
        /* optional sech/tanh pulse in middle of t2 */
        if (C13refoc[A]=='y') 				   /* WFG_START_DELAY */
        {   decshaped_pulse("stC200", 1.0e-3, zero, 0.0, 0.0);
            delay(tNH - 1.0e-3 - WFG_START_DELAY - 2.0*pw);
        }
        else
        {
            delay(tNH - 2.0*pw);
        }
        rgpulse(2.0*pw, zero, 0.0, 0.0);
        if (tNH < gt1 + 1.99e-4)  delay(gt1 + 1.99e-4 - tNH);

        delay(tau2);

        dec2rgpulse(2.0*pwN, t9, 0.0, 0.0);
        if (mag_flg[A] == 'y')
        {
            magradpulse(gzcal*gzlvl1, gt1);
        }
        else
        {
            zgradpulse(gzlvl1, gt1);
        }
        dec2phase(t10);
        if (tNH > gt1 + 1.99e-4)  delay(tNH - gt1 - 2.0*GRADIENT_DELAY);
        else   delay(1.99e-4 - 2.0*GRADIENT_DELAY);
    }

    else
    {
        if ( (C13refoc[A]=='y') && (tau2 > 0.5e-3 + WFG2_START_DELAY) )
        {   delay(tau2 - 0.5e-3 - WFG2_START_DELAY); /* WFG2_START_DELAY */
            simshaped_pulse("", "stC200", 2.0*pw, 1.0e-3, zero, zero, 0.0, 0.0);
            delay(tau2 - 0.5e-3);
            delay(gt1 + 2.0e-4);
        }
        else
        {   delay(tau2);
            rgpulse(2.0*pw, zero, 0.0, 0.0);
            delay(gt1 + 2.0e-4 - 2.0*pw);
            delay(tau2);
        }

        dec2rgpulse(2.0*pwN, t9, 0.0, 0.0);

        if (mag_flg[A] == 'y')
        {
            magradpulse(gzcal*gzlvl1, gt1);
        }
        else
        {
            zgradpulse(gzlvl1, gt1);
        }
        dec2phase(t10);
        delay(2.0e-4 - 2.0*GRADIENT_DELAY);
    }

    /*  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  */

    sim3pulse(pw, 0.0, pwN, zero, zero, t10, 0.0, 0.0);

    dec2phase(zero);
    zgradpulse(gzlvl5, gt5);
    delay(lambda - 1.5*pwN - gt5);

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

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

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

    txphase(zero);
    dec2phase(zero);
    zgradpulse(1.5*gzlvl5, gt5);
    delay(lambda - 1.5*pwN - gt5);

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

    zgradpulse(1.5*gzlvl5, gt5);
    delay(lambda - pwN - 0.5*pw - gt5);

    rgpulse(pw, zero, 0.0, 0.0);

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

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

    setreceiver(t11);
}
示例#25
0
pulsesequence()
{
   double	   slpwrT = getval("slpwrT"),
		   slpwT = getval("slpwT"),
		   mixT = getval("mixT"),
		   trim = getval("trim"),
		   tauz1 = getval("tauz1"), 
		   tauz2 = getval("tauz2"), 
		   tauz3 = getval("tauz3"), 
		   tauz4 = getval("tauz4"),
                   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"),
		   selfrq = getval("selfrq");
   char            selshapeA[MAXSTR], selshapeB[MAXSTR], slpatT[MAXSTR],
                   alt_grd[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("slpatT",slpatT);
   getstr("selshapeA",selshapeA);
   getstr("selshapeB",selshapeB);
   getstr("alt_grd",alt_grd);
                     /* alternate gradient sign on every 2nd transient */

   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(v17,v6);
   if (getflag("zqfilt")) 
     {  hlv(v6,v6); hlv(v6,v6); }

   settable(t1,4,ph1);   getelem(t1,v6,v1);
   settable(t3,8,ph3);   getelem(t3,v6,v11);
   settable(t4,8,ph4);  
   settable(t5,4,ph5);   getelem(t5,v6,v5); 
   settable(t2,4,ph2);   getelem(t2,v6,v2);
   settable(t7,8,ph7);   getelem(t7,v6,v7);
   settable(t8,4,ph8);   getelem(t8,v6,v8);
   settable(t11,16,phs8); getelem(t11,v6,v3);   /* 1st echo in ES */
   settable(t12,16,phs9); getelem(t12,v6,v4);   /* 2nd exho in ES */
   
   if (getflag("zqfilt"))
     getelem(t4,v6,oph);
   else
     assign(v1,oph);

   add(oph,v5,oph); mod4(oph,oph);

   sub(v2,one,v21);
   add(v21,two,v23);

   mod4(ct,v10);
   if (alt_grd[0] == 'y') mod2(ct,v12); /* alternate gradient sign on every 2nd transient */

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

   if (getflag("lkgate_flg"))  lk_sample(); /* turn lock sampling on */

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

   delay(d1);

   if (getflag("lkgate_flg"))  lk_hold(); /* turn lock sampling off */

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

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

        ifzero(v12); zgradpulse(gzlvlA,gtA);
        elsenz(v12); zgradpulse(-gzlvlA,gtA); endif(v12);
        delay(gstab);
        obspower(selpwrA);
        shaped_pulse(selshapeA,selpwA,v1,rof1,rof1);
        obspower(tpwr);
        ifzero(v12); zgradpulse(gzlvlA,gtA);
        elsenz(v12); zgradpulse(-gzlvlA,gtA); endif(v12);
        delay(gstab);

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

        ifzero(v12); zgradpulse(gzlvlB,gtB);
        elsenz(v12); zgradpulse(-gzlvlB,gtB); endif(v12);
        delay(gstab);
        obspower(selpwrB);
        shaped_pulse(selshapeB,selpwB,v2,rof1,rof1);
        obspower(slpwrT);
        ifzero(v12); zgradpulse(gzlvlB,gtB);
        elsenz(v12); zgradpulse(-gzlvlB,gtB); endif(v12);
        delay(gstab);

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

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

      if (getflag("zqfilt"))
      {
	obspower(tpwr);
	rgpulse(pw,v7,1.0e-6,rof1);
	ifzero(v10); delay(tauz1); endif(v10);
	decr(v10);
	ifzero(v10); delay(tauz2); endif(v10);
	decr(v10);
	ifzero(v10); delay(tauz3); endif(v10);
	decr(v10);
	ifzero(v10); delay(tauz4); endif(v10);
	rgpulse(pw,v8,rof1,2.0e-6);
      }
      ExcitationSculpting(v3,v4,v12);
      delay(rof2);

   status(C);
}
示例#26
0
pulsesequence() {

// Define Variables and Objects and Get Parameter Values

   double aXfam2 = getval("aXfam2");
   double pw1Xfam2 = getval("pw1Xfam2");
   double pw2Xfam2 = getval("pw2Xfam2"); 
   double pw3Xfam2 = getval("pw3Xfam2");
   double pw4Xfam2 = getval("pw4Xfam2");
   double nXfam2 = getval("nXfam2");
   initval(nXfam2,v4);

   putCmd("pw2Xmqmas=pwXfam1");    // Sequence uses pwXfam1 and sets pw2Xmqmas

   double d2init = getval("d2");   // Define the Split d2 in the Pulse Sequence
   double ival = getval("ival");

   double d20 = 1.0;
   double d21 = 0.0;
   double d22 = 0.0;
   if (ival == 1.5) {
      d20 = 9.0*d2init/16.0;
      d21 = 7.0*d2init/16.0;
      d22 = 0.0;
   }
   else if (ival == 2.5) {
      d20 = 12.0*d2init/31.0;
      d21 = 0.0*d2init/31.0;
      d22 = 19.0*d2init/31.0;
   }
   else { 
      d20 = 1.0*d2init;
      d21 = 0.0*d2init;
      d22 = 0.0*d2init;
   } 

   double tXechselinit = getval("tXechsel"); // Adjust the selective echo delay for the
   double tXechsel = tXechselinit - 3.0e-6;  // attenuator switch time.
   if (tXechsel < 0.0) tXechsel = 0.0;

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

// Set Constant-time Period for d2. 

   if (d2_index == 0) d2_init = getval("d2");
   double d2_ = (ni - 1)/sw1 + d2_init;
   putCmd("d2acqret = %f\n",roundoff(d2_,12.5e-9));
   putCmd("d2dwret = %f\n",roundoff(1.0/sw1,12.5e-9));

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

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

// Dutycycle Protection

   DUTY d = init_dutycycle();
   d.dutyon = getval("pw1Xmqmas") + nXfam2*(pw1Xfam2 + pw2Xfam2 + pw3Xfam2 +pw4Xfam2) + 
              getval("pwXechsel");
   d.dutyoff = d1 + 4.0e-6;
   d.c1 = d.c1 + (!strcmp(dec.seq,"tppm"));
   d.c1 = d.c1 + ((!strcmp(dec.seq,"tppm")) && (dec.t.a > 0.0));
   d.t1 = d2_ + tXechselinit + getval("rd") + getval("ad") + at;
   d.c2 = d.c2 + (!strcmp(dec.seq,"spinal"));
   d.c2 = d.c2 + ((!strcmp(dec.seq,"spinal")) && (dec.s.a > 0.0));
   d.t2 = d2_ + tXechselinit + getval("rd") + getval("ad") + at;
   d = update_dutycycle(d);
   abort_dutycycle(d,10.0);

// Set Phase Tables

   if (phase1 == 0) {
      settable(phf1Xmqmas,12,table1);
      settable(ph1Xfam2,6,table2);
      settable(ph2Xfam2,6,table3);
      settable(phfXechsel,96,table4);
      settable(phRec,48,table5);
   }
   else {
      settable(phf1Xmqmas,6,table6);
      settable(ph1Xfam2,6,table7);
      settable(ph2Xfam2,6,table8);
      settable(phfXechsel,48,table9);
      settable(phRec,24,table10);
      if (phase1 == 2) {
         tsadd(phf1Xmqmas,30,360);
      }
   } 

   setreceiver(phRec);
   obsstepsize(1.0);

// Begin Sequence

   xmtrphase(phf1Xmqmas); decphase(zero);
   obspower(getval("tpwr"));
   obspwrf(getval("aXmqmas"));
   obsunblank(); decunblank(); _unblank34();
   delay(d1);
   sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);

// H Decoupler on Before MQMAS

   _dseqon(dec);

// Two-Pulse MQMAS with DFS Conversion 

   rgpulse(getval("pw1Xmqmas"),zero,0.0,0.0);
   xmtrphase(zero); txphase(ph1Xfam2);
   obspwrf(aXfam2); 
   delay(d20);

// X FAM2 Pulse

   loop(v4,v5);
      xmtron();
      delay(pw1Xfam2);
      xmtroff();
      txphase(ph2Xfam2);
      delay(pw2Xfam2);
      xmtron();
      delay(pw3Xfam2);
      xmtroff();
      txphase(ph2Xfam2);
      delay(pw4Xfam2);
   endloop(v5);

// Tau Delay and Second Selective Echo Pulse

   xmtrphase(phfXechsel);
   obsblank();
   obspower(getval("dbXechsel"));
   obspwrf(getval("aXechsel"));
   delay(3.0e-6);
   obsunblank();
   delay(d21 + tXechsel);
   rgpulse(getval("pwXechsel"),zero,0.0,0.0);
   delay(d22);
 
// Begin Acquisition
 
   obsblank(); _blank34();
   delay(getval("rd"));
   startacq(getval("ad"));
   acquire(np, 1/sw);
   endacq();
   _dseqoff(dec);
   obsunblank(); decunblank(); _unblank34();
}
示例#27
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);
}
示例#28
0
文件: TOCSY1D.c 项目: timburrow/ovj3
pulsesequence()
{
   double	   slpwrT = getval("slpwrT"),
		   slpwT = getval("slpwT"),
		   mixT = getval("mixT"),
		   trim = getval("trim"),
		   tauz1 = getval("tauz1"), 
		   tauz2 = getval("tauz2"), 
		   tauz3 = getval("tauz3"), 
		   tauz4 = getval("tauz4"),
                   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"),
		   selfrq = getval("selfrq");
   char            selshapeA[MAXSTR],
                   selshapeB[MAXSTR],
   		   slpatT[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("slpatT",slpatT);
   getstr("selshapeA",selshapeA);
   getstr("selshapeB",selshapeB);

   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,v6);
   if (getflag("zqfilt")) 
     {  hlv(v6,v6); hlv(v6,v6); }

   settable(t1,4,ph1);   getelem(t1,v6,v1);
   settable(t3,8,ph3);   getelem(t3,v6,v11);
   settable(t4,8,ph4);   
   settable(t2,4,ph2);   getelem(t2,v6,v2);
   settable(t7,8,ph7);   getelem(t7,v6,v7);
   settable(t8,4,ph8);   getelem(t8,v6,v8);
   
   if (getflag("zqfilt"))
     getelem(t4,v6,oph);
   else
     assign(v1,oph);

   sub(v2,one,v3);
   add(v2,two,v4);
   add(v3,two,v5);

   mod4(ct,v10);

/* 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);
        satpulse(satdly,v6,rof1,rof1);
     }
   else
        delay(d1);

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

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

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

        zgradpulse(gzlvlA,gtA);
        delay(gstab);
        obspower(selpwrA);
        shaped_pulse(selshapeA,selpwA,v1,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,v2,rof1,rof1);
        obspower(slpwrT);
        zgradpulse(gzlvlB,gtB);
        delay(gstab);

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

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

      if (getflag("zqfilt"))
      {
	obspower(tpwr);
	rgpulse(pw,v7,1.0e-6,rof1);
	ifzero(v10); delay(tauz1); endif(v10);
	decr(v10);
	ifzero(v10); delay(tauz2); endif(v10);
	decr(v10);
	ifzero(v10); delay(tauz3); endif(v10);
	decr(v10);
	ifzero(v10); delay(tauz4); endif(v10);
	rgpulse(pw,v8,rof1,rof2);
      }
      else
	 delay(rof2);

   status(C);
}
示例#29
0
pulsesequence()

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

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

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

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

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

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

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

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

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

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

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

   status(A);
   obspower(tpwr);

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

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

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

   decpower(pwxlvl);

    status(B);

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

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

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

     decrgpulse(pwx,v4,2.0e-6,rof1);
     if (getflag("PFGflg"))
     {
	zgradpulse(ZZgsign*0.6*hsglvl,1.2*hsgt);
	delay(1e-3);
     }
     rgpulse(pw,v3,rof1,rof1);
     delay(tau - (2*pw/PI) - 2*rof1);
     simpulse(2*pw,2*pwx,zero,zero,rof1, rof2);
     decpower(dpwr);
     delay(tau - POWER_DELAY);
   status(C);
}
示例#30
0
pulsesequence()
{
/* DECLARE VARIABLES */

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

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


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


/* LOAD VARIABLES */


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

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

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

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

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

/* LOAD PHASE TABLE */

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

/* CHECK VALIDITY OF PARAMETER RANGES */

    if( 0.5*ni*1/(sw1) > TCb - 2*POWER_DELAY 
        - WFG_START_DELAY - pwar180a  - WFG_STOP_DELAY)
    {
        printf(" ni is too big\n");
        psg_abort(1);
    }

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

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

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

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

    if( tpwrmess > 56 )
    {
        printf("tpwrmess too large !!!  ");
        psg_abort(1);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

    


/*  Phase incrementation for hypercomplex 2D data */

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

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

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

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

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

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


/* BEGIN ACTUAL PULSE SEQUENCE */

/* Receiver off time */

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

/* Presaturation Period */

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

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

  }

   if (fsat[0] == 'y')
   {
	delay(2.0e-5);
        rgpulse(d1,zero,20.0e-6,20.0e-6);
   	obspower(tpwr);      /* Set transmitter power for hard 1H pulses */
	delay(2.0e-5);
	if(fscuba[0] == 'y')
	{
		delay(2.2e-2);
		rgpulse(pw,zero,2.0e-6,0.0);
		rgpulse(2*pw,one,2.0e-6,0.0);
		rgpulse(pw,zero,2.0e-6,0.0);
		delay(2.2e-2);
	}
   }
   else
   {
    delay(d1);
   }

   obspower(tpwr);           /* Set transmitter power for hard 1H pulses */
   txphase(zero);
   dec2phase(zero);
   decphase(zero);
   delay(1.0e-5);

/* Begin Pulses */

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

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

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

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


/* this is the real start */

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

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

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

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

   txphase(t1);

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

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

   rgpulse(pw,t1,0.0,0.0);

   txphase(zero);

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

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

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

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

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

   decphase(t3);

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

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

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

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

   decoffset(dofar);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

   delay(taud 
     - gt7 - 4.0e-6
     - 2*POWER_DELAY);

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

   rgpulse(pw,zero,0.0,0.0);  
    
/*   rcvron();  */          /* Turn on receiver to warm up before acq */ 

/* BEGIN ACQUISITION */

status(C);
setreceiver(t6);

}