# 1 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
;tdTROSY.BIP			;td 23/09/2015

;### AVANCE version adapted for TopSpin 3.x and cryo-probe ###
;with revised phase cycle and gradient switching, F1 phase error, TROSY/semiTROSY scroll

;@@@@ TO DO @@@@ 
;- check E/A imbalance in bsfb mode
;- check why water suppression (on cryo) fails regularly for wfb-only!!!
;- check F1 phase error for trp/arg (15N offset-dependent?)
;- check F2 doublet structure (JHN) for NH2, arg-NHe, Lys-NHw (but NOT trp!)
;- check water suppression with cycles on ph11+12!!!
;- revise phase cycle to eliminate NH2 COSY artefacts:
;  must invert ph20 without ph31, but compensate anti/TROSY flip:
;  Try cocylcing of ph20+10+ph7+ph17
;  NOTE: triple gradient scheme already largely suppresses COSY anti-phase effect!
# 17 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
;15N,1H-TROSY with various options:
;OPTION (zgoptn) -DHreadout: to measure extent of flip-back 
;OPTION 'l0': type of water suppression scheme
;	0 = by gradient coherence selection
;	1 = by water-selective pulses (WATERGATE)
;  NOTE: while water suppression is more stable with WATERGATE, 
;        echo/antiecho selection is better with gs, yielding purest phases
;OPTION 'l1': extent of flip-back
;       0 = ON-RESONANT water-only flip-back
;       1 = band-selective flip-back between [5 - (-1)] ppm
;  NOTE: option 0 (without selective pulses) causes t1 modulation of the 
;        extent of Hu flip-back by cos(vH*t1) | vH = offset for specific Hu
;        Through coupling with T1(HN), this causes F1 sidebands UNLESS the protein
;        is 100% deuterated. The option is therefore deactivated (l1=1 fixed)
;OPTION 'l2': 
;       0 = incremental t1 time
;       1 = constant t1 time = d2
;OPTION 'l9': inversion of F1-folded signals (NOT for constant time)
;OPTION 'l7': WATERGATE using W5 composite pulse, or shaped pulse
;  NOTE: W5 pulse affords better water suppression, but is less selective 
;        (sensitivity losses close to water) and has 2nd suppression at 1/(2*d19)

;- optional as CLEAN TROSY to reduce cross-talk semi-TROSY artefacts:
;  tune d14 (<< d4) for 15N semi-TROSY suppression in F1:
;  - if F1 anti-TROSY signals appear POSITIVE, INCREASE d14 (d14 too short)
;  - if F1 anti-TROSY signals appear NEGATIVE, DECREASE d14 (d14 too long)
;  tune phcor10 for 1H semi-TROSY suppression in F2:
;Lit: T.Schulte-Herbrueggen & O.W.Sorensen in JMR 144, 123-128 (2000)
;- using ST2-PT back-transfer module and triple-gradient selection scheme
;- with BIP inversion pulses for optimal B1 tolerance
;- intensity enhanced by exploiting the natural 15N magnetization 
;- with 13C-decoupling in F1
;###########################################################################
;This program allows to select for each of the 4 transitions separately.
;It can therefore be used for 1JHN-measurements!
;Indexing of the NH-multiplets:
;
;	NaHa=anti-TROSY			NaHb=semi(F1:anti)-TROSY
;
;	NbHa=semi(F2:anti)-TROSY	NbHb=TROSY
;
;For 1JHN experiments, acquire TROSY- and semi-TROSY transitions
;and use TD >= 2K (= high resolution in 1H)

;############################ IMPORTANT NOTES ###############################
;*) ## FnMODE(15N) = echo/antiecho ##
;*) ## DIGMOD = baseopt ##
;*) Water need only be on-resonant for l1=0 (no band-selective flip-back) 
;*) For optimal bsfb, tune phcor20 (ca. 0 to -10 deg) and cnst11 (<= 1)
;*) JHN/2 are automatically added/subtracted to SFO3 and SFO1 to ensure 
;   that the selected S3E signals superimpose directly with their HSQC
;   counterparts. In this way, the (folded) spectral widths obtained for the
;   HSQC can be directly used here as well - but see processing info!!!
;*) As no 15N decoupling is needed during aq, sample heating is not limiting
;   and long aq >= 1.25*T2(HN) should be used for enhanced resolution
# 73 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
;####################### Processing Info #####################
;FnMODE: echo-antiecho
;REVERSE(15N):	For TROSY	=> FALSE
;		For anti-TROSY	=> TRUE
;Referencing (with respect to HSQC):
;1. If the SAME shifts as for HSQC are desired, you must set:
;   SR1(15N) = SR2 (HN) = 0Hz
;   SR(1H) = -45Hz(for l11=0) or +45Hz(for l11=1)
;2. If true TROSY shifts (for 1JHN determination) are desired, set:
;   SR(15N) = -45Hz(for l12=0) or +45Hz(for l12=1)
;   SR(1H)  = +45Hz(for l11=0) or -45Hz(for l11=1) 
;Phasing:
;- default in F1: Phc0~90, Phc1=0, FCOR=0.5
;- when fold-inverting (l9=1), F1: Phc0=90, Phc1=-180, FCOR=1.0

;##################### Parameter Set-up ("ased") #################################
;ns = ## multiple of 4 (or 2) ##
;ds >= 32 (for temperature equilibration)
;sfo1 = H2O on-resonant suggested
;sfo2 ~ 110 ppm (center of CACO)
;sfo3 ~ 110 ppm (center of 15N)
;---------- OPTIONS ----------
;zgoptns = -DHreadout
;vdlist = for Hreadout option
;l0 = 0(grad.sel.), 1(WATERGATE)  
;l1 = 0: wfb only, 1: bsfb
;l2 = constant 15N-time(=d2): 0(no),1(yes)
;l7 = WATERGATE type: 0=W5,1=selective
;l9 = invert F1 folded signals:0(no),1(yes)
;l11 = 0(TROSY),1(semi-TROSY) in F2(1H)
;l12 = 0(TROSY),1(anti-TROSY) in F1(15N)
;---------- 1H pulses ----------
;p1 = 90deg high power pulse @ pl1 (reference)
;pl1 = for p1=90deg on 1H (high power)
;p2 <= 200us*600/BF1 (power check on sp2!)
;spnam2 = ### BIP_720_(50 or 75).. ###
;spoal2 = 0.5
;p11 = 1.2m*600/BF1 90deg EBurp2
;sp11 = for p11=90deg EBurp2 
;cnst11 ~ 1 (power scaling factor for p11)
;spnam11 = ### EBurp2 ###
;spoal11 = ### 1.0 ###
;spoffs11 = ### shift to ca. 2ppm ###
;spnam1 = ### EBurp2.tr (time-reversed!) ###
;spoal1 = ### 0.0 ### 
;p12 = 1.5m (check d4d > 0.3m!)
;sp12 = for p12=180deg
;spnam12 = ### GAUSS_25% ###
;spoal12 = 0.5
;p19 ~ 3m*[600/BF1] selective 90deg on H2O
;spnam19 = ### Gauss5.1000 ###
;spoal19 = 0.5
;sp19 = set automatically
;spoffs19 = set automatically (H2O on-resonant)
;---------- 13C pulses ----------
;p3 = high-power 90deg on C @ pl2 (reference)
;pl2 = for p3=90deg on C (high power)
;p4 <= 300us*600/BF2 (power check on sp4!)
;spnam4 = ### BIP_900_120_20 ###
;spoal4 = 0.5
;---------- 15N pulses ----------
;p7 = 90deg high power pulse @ pl3 (reference)
;pl3 = for p7=90deg on 15N (high power)
;p8 <= 450us*600/BF1 (power check on sp8!)
;spnam8 = ### BIP_540_75_15 ###
;spoal8 = 0.5
;---------- DELAYS ----------
;d1 < 1s (optimum: 1.25*T1)
;d2 > d14*4 (constant t1 time)
;d4 ~ 2.4ms (<= 1/4JHN, evolution on 1H)
;d14 ~ 1.6m (tune for F1 semi-TROSY suppression)
;d16 >= 50u field recovery delay (after p16)
;d19 ~ 1-1.5*DW (echo delay in W5)
;NOTE: zero intensity reoccurs at offsets=n/(2*d19)!!! 
;d0 = irrelevant (set automatically)
;d20 = irrelevant (set automatically)
;d29 = irrelevant (set automatically)
;d31 = optional pre-experiment waiting time
;---------- gradients ----------
;p16 >= 250us coherence-sel. gradient pulse
;gpz1 ~ 70  (strong coh.sel. gradient)
;gpx1 ~ gpz1/0.77
;gpy1 ~ gpz1/0.77
;gpnam1 = ### SMSQ10.50 ###
;gpz2 < 10 !! (SMALL rad.damp.suppr.grad)
;gpx2 = 0 !!
;gpy2 = 0 !!
;gpz3 > 30 (MEDIUM WATERGATE gradient)
;gpx3 = 0 !!
;gpy3 = 0 !!
;gpnam4 = SINE.50
;gpz4 ~ 55 (medium z-spoil gradient)
;gpx4 = 0
;gpy4 = 0
;gpz5 ~ 2 (s.r.d. during t1)
;gpx5 = 0
;gpy5 = 0

;### Calculated Parameters ###
;$OWNER=nmr
;$CLASS=HighRes
;$DIM=2D
;$TYPE=TROSY
;$SUBTYPE=
;$COMMENT=
# 1 "/opt/topspin3.2/exp/stan/nmr/lists/pp/Grad.incl" 1
;Grad2.incl  -  include file for Gradient Spectroscopy
;   for TCU3
;
;avance-version (07/01/17)
;
;$CLASS=HighRes Incl
;$COMMENT=
# 27 "/opt/topspin3.2/exp/stan/nmr/lists/pp/Grad.incl"
define list<gradient> EA=<EA>


# 31 "/opt/topspin3.2/exp/stan/nmr/lists/pp/Grad.incl"
;$Id: Grad2.incl,v 1.13.8.1 2012/01/31 17:56:17 ber Exp $
# 178 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP" 2

# 1 "/opt/topspin3.2/exp/stan/nmr/lists/pp/Avance.incl" 1
;Avance3.incl
;   for AV III
;
;avance-version (13/06/17)
;
;$CLASS=HighRes Incl
;$COMMENT=

# 169 "/opt/topspin3.2/exp/stan/nmr/lists/pp/Avance.incl"
;$Id: Avance3.incl,v 1.9.8.3 2013/08/30 09:44:49 ber Exp $
# 179 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP" 2

# 1 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdWG.incl" 1
;tdWG.incl		;td 18/07/2013
;definitions for WATERGATE pulses in td* sequences

;-------------------------------------------
;*** DELAYS ***
define delay dWG		;duration of 3-9-19 WATERGATE 180deg pulse
define delay dW4		;duration of W4 180deg pulse
define delay dW5		;duration of W5 WATERGATE 180deg pulse
# 10 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdWG.incl"
;-------------------------------------------
;*** COMPOSITE 180 DEGREE PULSES ***
;****** composite 180degree with on-resonant suppression ******
;WG = composite 3-9-19 pulse with zero inversion at offsets = n/(d19*2), J-evolution during 3.77*(2*d19)
;dWG=p1*4.77+d19*10	;(duration of 3-9-19 inversion pulse)
;dW3j=d19*6.74         ;(net J evolution time during W3)


# 20 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdWG.incl"
;W4 = extended W4 pulse with zero inversion at offsets = n/(d19*2), J-evolution during 5.31*(2*d19)
;dW4=p1*5.18+d19*14	;(duration of W4 inversion pulse)
;dW4j=d19*10.61         ;(net J evolution time during W4)


# 26 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdWG.incl"
;W5 = extended W5 pulse with zero inversion at offsets = n/(d19*2), J-evolution during 7.17*(2*d19)
;dW5=p1*5.9578+d19*18	;(duration of W5 inversion pulse)
;dW5j=d19*14.34         ;(net J evolution time during W5)


# 33 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdWG.incl"
;****** shifted composite 180degree with off-resonant suppression ******
;WGs = shifted composite 3-9-19 pulse with zero inversion at offsets = n/(d19*4), J-evolution during 3.77*(2*d19)
;dW3s=p1*4.77+d19*10	;(duration of 3-9-19 inversion pulse)


;W4s = extended p1*0.1156 ph0 d19*2 p1*0.3267 ph0 d19*2 p1*0.6722 ph0 d19*2 p1*1.4755 ph0 d19*2 p1*1.4755 ph2 d19*2 p1*0.6722 ph2 d19*2 p1*0.3267 ph2 d19*2 p1*0.1156 ph2 pulse with zero inversion at offsets = n/(d19*4), J-evolution during 5.31*(2*d19)
;dW4s=p1*5.18+d19*14	;(duration of W4s inversion pulse)
# 41 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdWG.incl"
;W5s = extended p1*0.0867 ph0 d19*2 p1*0.2056 ph0 d19*2 p1*0.4133 ph0 d19*2 p1*0.7822 ph0 d19*2 p1*1.4911 ph0 d19*2 p1*1.4911 ph2 d19*2 p1*0.7822 ph2 d19*2 p1*0.4133 ph2 d19*2 p1*0.2056 ph2 d19*2 p1*0.0867 ph2 pulse with zero inversion at offsets = n/(d19*4), J-evolution during 7.17*(2*d19)
;dW5s=p1*5.9578+d19*18	;(duration of p1*0.0867 ph0 d19*2 p1*0.2056 ph0 d19*2 p1*0.4133 ph0 d19*2 p1*0.7822 ph0 d19*2 p1*1.4911 ph0 d19*2 p1*1.4911 ph2 d19*2 p1*0.7822 ph2 d19*2 p1*0.4133 ph2 d19*2 p1*0.2056 ph2 d19*2 p1*0.0867 ph2 inversion pulse)

# 180 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP" 2

"l1=1"	;fix option = band-selective flip-back to avoid F1 sidebands
;--- 1H pulses ---
# 184 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
"p2=200u*600/trunc(bf1)"
"spoal2 = 0.5"
"spoffs2=0"
"spw2=plw1*pow(p1*8/p2,2)"                ;for p2 = BIP_720_...
"p11=1200u*600/trunc(bf1)"
"spoal11 = 1"
"spoffs11=(2.0*bf1)/1000000-o1"           ;shift bsfb pulse to 2 ppm
"spw11 = cnst11*plw1*pow(p1*16.3854/p11,2)"      ;for p11 = EBurp2
"spoal1 = 0"
"spoffs1=spoffs11"
"spw1=spw11"

"spoal12 = 0.5"
"spoffs12=(4.7*bf1)/1000000-o1"           ;shift to H2O
"spw12 = plw1*pow(p1*2.9407/p12,2)"       ;for p12 = 180deg Gauss 25%

# 212 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
;--- 13C pulses ---

"p4=300u*600/trunc(bf1)"
"spoal4 = 0.5"
"spoffs4=(bf2*110/1000000)-o2"            ;for BIP on CO&Caliph
"spw4 = plw2*pow(p3*10/p4,2)"             ;for p4 = BIP_900_120(125)
;--- 15N pulses ---

"p8=450u*600/trunc(bf1)"
"spoal8 = 0.5"
"spoffs8=0"
"spw8 = plw3*pow(p7*6/p8,2)"              ;for p8 = BIP_540_75_15
;--- delays ---
"cnst16=-2/(3-sfo1/sfo3)"	;= -2/(3+gamma_H/gamma_N) ~ 0.291215
define delay comp1
define delay comp2
define delay comp3
define delay comp4
define delay comp5
"comp1=p1*4/PI"
"comp2=p7*4/PI"
"comp3=p8+d12*2-comp1/2"
"comp4=p7*2+comp1/2"
"comp5=d12+l1*(p11+d12)+l0*(d12*2+p2)"
"d11=30m"			;short delay for phase incrementation
"d12=4u"			;short delay to separate shaped pulses
define delay d2a
define delay d2b
define delay d4a
define delay d4b
define delay d4c
define delay d4d
define delay d14c
define delay d0c
define delay d20c
define delay prompt
"d2a=d2/2+p8"
"d2b=d2/2"
"d4a=d4-d16"
"d4c=d4/2-d16-d19*7.17"	;1/4 JHN delay compensated for p1*0.0867 ph0 d19*2 p1*0.2056 ph0 d19*2 p1*0.4133 ph0 d19*2 p1*0.7822 ph0 d19*2 p1*1.4911 ph0 d19*2 p1*1.4911 ph2 d19*2 p1*0.7822 ph2 d19*2 p1*0.4133 ph2 d19*2 p1*0.2056 ph2 d19*2 p1*0.0867 ph2 pulse
"d4d=d4/2-d16-p12/2"	;1/4 JHN delay compensated for selective p12
"d14c=d14-d16"
"d29=5u"
"l10=l11+l12"
;--- parameters for t1 ---
# 258 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
"d4b=d4/2-d16"
"in0=inf1/2"
;"d0=d12+l9*in0/2"
;"d0c=p4+d12*2"
"d0=30u+in0*l9/2"
"d0c=80u+p4"
"d20=d2/4-p4/2"
"d20c=p4"
"in20=in0/2"

if (l12==1)
{; ###  for NHb anti-TROSY selected in F1 ###
"l13=1"
}
else
{
"l13=0"
}
"prompt=1u*l11+1u*l12+1u*l0+1u*l1+1u*l2+l7*1u+5u"
"acqt0 = -d12"

# 1 "mc_line 279 file /opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP exp. def. part of mc cmd. before ze"
define delay MCWRK
define delay MCREST
define delay d0orig
"d0orig=d0"
define delay d20orig
"d20orig=d20"
define loopcounter l13orig
"l13orig=l13"
define loopcounter t1loop
"t1loop=0"
define loopcounter ph1loop
"ph1loop=0"
define loopcounter ST1CNT
"ST1CNT = td1 / 2"
"MCREST = d11 - d11"
"MCWRK = 0.066667*d11"

    dccorr
# 279 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
  ze
# 1 "mc_line 279 file /opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP exp. def. of mc cmd. after ze"
      "d0=d0orig + t1loop * in0 "
      "d20=d20orig - t1loop * in20 "
      "phval10 = (ph1loop % 2) * 180"
      MCWRK ip10 + phval10
      "phval20 = (ph1loop % 2) * 180"
      MCWRK ip20 + phval20
      "phval11 = (ph1loop % 2) * 180"
      MCWRK ip11 + phval11
      "phval7 = (t1loop * 180)%360"
      MCWRK ip7 + phval7
      "phval17 = (t1loop * 180)%360"
      MCWRK ip17 + phval17
      "phval31 = (t1loop * 180)%360"
      MCWRK ip31 + phval31
      "l13 = l13orig + ph1loop * 1"

# 280 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
  d31
  prompt
  d11 pl1:f1 pl2:f2 pl3:f3
  (p3 ph0):f2			;dummy pulse to prompt for p3
  d11 fq=45:f3
  if (l12==1)
 {; ###  for NHb anti-TROSY selected in F1 ###
  d11 fq=-45:f3
 }
# 1 "mc_line 289 file /opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP exp. start label for mc cmd."
2 MCWRK  * 7
LBLF1, MCWRK  * 7
LBLST1, MCWRK
  MCREST
# 290 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
3 d1
  d12 setnmr3|0 setnmr0|34|32|33 ctrlgrad 0
  2mp:gp4					;essential z-spoil to prevent 
  1m						;H2O break-through between scans  
    if(l1==1)
    {;## with band-selective flip-back for L-TROSY 
     (p11:sp11 ph1):f1
    }
  d12 pl1:f1 
  (p1 ph11):f1	
  d4b gron2
  d16 groff 
  (center (p2:sp2 ph0):f1 (p8:sp8 ph0):f3)
  d4b gron2
  d16 groff
  comp1
  d4b gron2
  d16 groff 
  (center (p2:sp2 ph0):f1 (p8:sp8 ph0):f3)
  d4b gron2
  d16 groff pl1:f1 pl3:f3
  (p1 ph11+90):f1	;must follow ph11 to maintain gN addition
    if(l1==1)
    {;## with band-selective flip-back for L-TROSY  
     (p11:sp1 ph2):f1				;Hbs in +z
    }
;### end of f1->f3 INEPT, term = 2NzHz, Hu in +z ###
   d12
   if(l0==0)
   {;### with gradient coherence selection ###  
    p16:gp1			;z-spoil & compensating water rephasing
    d16         ;compensates for coherence-selective grad in t1
   }
   d12
;### t1 on 15N ###
 if "l13 %2 == 0"
 {
   (p7 ph7):f3		;echo scan
 }
 else
 {
   (p7 ph17):f3		;antiecho scan
 }
 comp5
  if(l2==1)
  { ;### constant-time with 13C-decoupling ###
   (d2a) (d20 p4:sp4 ph0):f2 (d20*2 d20c p8:sp8 ph8):f3
   (d2b) (d20 p4:sp4 ph0):f2
  }
  else
  { ;### conventional non-constant time with 13C-decoupling ###
   d0c
   (p8:sp8 ph8):f3				;phase compensating BIP  
   d0 gron5
   10u groff
   (p4:sp4 ph0):f2
   d0 gron5*-1
   10u groff
  }
  comp2
    if(l0==0)
   {;### with gradient coherence selection ###  
     p16:gp1*-1					;coherence on f3	=> +/- gN
     d16
   }
 ;### ST2-PT, first half ###
  d12
    if(l1==1)
    {;## with band-selective flip-back for L-TROSY  
     (p11:sp11 ph20:r):f1			;Hbs in -x
     d12 pl1:f1
    }
  (p1 ph19):f1					;phase inversion exchanges Ha and Hb 
  d12						;Hbs in -x
  (p2:sp2 ph0):f1				;phase compensating BIP
  d12
  d14c gron2
  d16 groff
  (center (comp1 p2:sp2 ph0):f1 (p8:sp8 ph18):f3)	
  d14c gron2
  d16 groff pl1:f1 pl3:f3
  (p1 ph20+180):f1					;Hbs z
;### center of ST2-PT: MQC ####
 if (l0==0)
{;### with gradient coherence selection ###  
    d12
    (p2:sp2 ph2):f1			;phase compensating BIP, H2O in -z
    d12
    p16:gp1*cnst16*1.5				;MQC on f3+f1 => -(gH+/-gN)
    d16
   ;---- ST2-PT, second half ----
    (p7 ph9):f3					;inversion exchanges Na and Nb
    d12
    (p8:sp8 ph2):f3			;phase compensating BIP
    d12
    d4a gron2			
    d16 groff
    (center (p2:sp2 ph2):f1 (comp2 p8:sp8 ph2):f3)
    d4a gron2					;H2O in +z
    d16 groff pl3:f3
    (p7 ph10:r):f3					;invert for semi-TROSY!
 if "l13 %2 == 0"
  {
    p16:gp1*cnst16      ;echo scan
    d16
  }
 else
  {
    p16:gp1*cnst16*2      ;anti-echo scan
    d16
  }
   comp3
   d12 setnmr3^0 setnmr0^34^32^33 ctrlgrad 7
}
 else
{;### without gradient coherence selection ###  
  ;---- ST2-PT, second half ----
   (p7 ph9):f3					;echo scan
  if(l7==1)
  {;### with excitation sculpting using selective pulses ###
   d4d gron3*0.7		
   d16 groff
   (p12:sp12 ph0):f1
   d12
   (center (p2:sp2 ph2):f1 (p8:sp8 ph1):f3)
   d4d gron3			
   d16 groff
   d4d gron3*0.7			
   d16 groff
   (p12:sp12 ph2):f1
   d12
   (center (comp4 p2:sp2 ph0):f1 (p8:sp8 ph3):f3)
   d4d gron3			
  }
  else
  {;### with p1*0.0867 ph0 d19*2 p1*0.2056 ph0 d19*2 p1*0.4133 ph0 d19*2 p1*0.7822 ph0 d19*2 p1*1.4911 ph0 d19*2 p1*1.4911 ph2 d19*2 p1*0.7822 ph2 d19*2 p1*0.4133 ph2 d19*2 p1*0.2056 ph2 d19*2 p1*0.0867 ph2 composite pulses (more robust) ###
   d4c gron3*0.7		
   d16 groff pl1:f1
   (center (p1*0.0867 ph0 d19*2 p1*0.2056 ph0 d19*2 p1*0.4133 ph0 d19*2 p1*0.7822 ph0 d19*2 p1*1.4911 ph0 d19*2 p1*1.4911 ph2 d19*2 p1*0.7822 ph2 d19*2 p1*0.4133 ph2 d19*2 p1*0.2056 ph2 d19*2 p1*0.0867 ph2):f1 (p8:sp8 ph1):f3)
   d4c gron3			
   d16 groff
   d4c gron3*0.7			
   d16 groff
   (center (comp4 p1*0.0867 ph0 d19*2 p1*0.2056 ph0 d19*2 p1*0.4133 ph0 d19*2 p1*0.7822 ph0 d19*2 p1*1.4911 ph0 d19*2 p1*1.4911 ph2 d19*2 p1*0.7822 ph2 d19*2 p1*0.4133 ph2 d19*2 p1*0.2056 ph2 d19*2 p1*0.0867 ph2):f1 (p8:sp8 ph1):f3)
   d4c gron3			
  }
   d16 groff pl3:f3
   (p7 ph10:r):f3					;invert for semi-TROSY
   d12 setnmr3^0 setnmr0^34^32^33 ctrlgrad 7
 }
# 464 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
# 465 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"


# 478 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"
;### default option: full 2D ###
  go=2 ph31
# 1 "mc_line 480 file /opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP exp. mc cmd. in line"
  MCWRK  wr #0 if #0 zd 

  "ph1loop+=1"
      "d0=d0orig + t1loop * in0 "
      "d20=d20orig - t1loop * in20 "
      "phval10 = (ph1loop % 2) * 180"
      MCWRK ip10 + phval10
      "phval20 = (ph1loop % 2) * 180"
      MCWRK ip20 + phval20
      "phval11 = (ph1loop % 2) * 180"
      MCWRK ip11 + phval11
      "phval7 = (t1loop * 180)%360"
      MCWRK ip7 + phval7
      "phval17 = (t1loop * 180)%360"
      MCWRK ip17 + phval17
      "phval31 = (t1loop * 180)%360"
      MCWRK ip31 + phval31
      "l13 = l13orig + ph1loop * 1"

  lo to LBLF1 times 2
  MCWRK 

  "t1loop+=1"
      "d0=d0orig + t1loop * in0 "
      "d20=d20orig - t1loop * in20 "
      "phval10 = (ph1loop % 2) * 180"
      MCWRK ip10 + phval10
      "phval20 = (ph1loop % 2) * 180"
      MCWRK ip20 + phval20
      "phval11 = (ph1loop % 2) * 180"
      MCWRK ip11 + phval11
      "phval7 = (t1loop * 180)%360"
      MCWRK ip7 + phval7
      "phval17 = (t1loop * 180)%360"
      MCWRK ip17 + phval17
      "phval31 = (t1loop * 180)%360"
      MCWRK ip31 + phval31
      "l13 = l13orig + ph1loop * 1"

  lo to LBLST1 times ST1CNT
  MCWRK 
  "t1loop=0"
  "ph1loop=0"
  MCWRK
# 482 "/opt/NMRtools/TopSpin/lists/pp/tdpp/tdTROSY.BIP"

exit
   
ph0 = 0
ph1 = 1
ph2 = 2
ph3 = 3
ph7 = {{1 2}*4}^2     ;(f3) States and TROSY selection phase (echo scan)
ph17= {{3 2}*4}^2     ;(f3) States and TROSY selection phase (anti-echo scan)
ph9 = {{0}*2}^2       ;(f3) first ST2PT pulse, inversion exchanges Na/Nb
 if (l10==1)
 {; ### for HNb anti-TROSY selected in F2 ### 
ph10= {{1}*2}^2       ;(f3) second ST2PT pulse, inversion exchanges Na/Nb
 }
 else
 {
ph10= {{3}*2}^2       ;(f3) second ST2PT pulse, inversion exchanges Na/Nb
 }
ph8 = {{0}*16}^1      ;(f3) rephasing in t1
ph18= {{0}*32}^1      ;(f3) rephasing in first ST2-PT
ph19= {{0}*4}^2       ;(f1) first ST2PT pulse, inversion exchanges Ha&Hb and f3+&f3-
ph20= {{3}*4}^2       ;(f1) second ST2PT pulse, inversion exchanges Ha&Hb and f3+&f3-
ph11= {{3}*16}^2      ;(f1) excitation and INEPT transfer pulse (to maintain gN)
ph31={{{{1 2 3 0}^2}^2}^2}^2
