; single scan GEMSTONE experiment with 1D TOCSY
; P. Kiraly, M Nilsson, G.A. Morris and R.W.Adams
; 04/02/2021
; Chem. Commun., 2021, DOI: 10.1039/D0CC08033K.
; Wavemaker compatible, use wvm -a to set up the GEMSTONE pulses.

; Based on ...
;seldigpzs
;avance-version (18/11/22)
;1D homonuclear Hartman-Hahn transfer using 
;   DIPSI2 sequence for mixing
;   using selective refocussing with a shaped pulse
;with zero quantum suppression
;
;H. Kessler, H. Oschkinat, C. Griesinger & W. Bermel,
;   J. Magn. Reson. 70, 106 (1986)
;J. Stonehouse, P. Adell, J. Keeler & A.J. Shaka, J. Am. Chem. Soc 116,
;   6037 (1994)
;K. Stott, J. Stonehouse, J. Keeler, T.L. Hwang & A.J. Shaka,
;   J. Am. Chem. Soc 117, 4199-4200 (1995)
;M.J. Thrippleton & J. Keeler,
;   Angew. Chem. Int. Ed. 42, 3938-3941 (2003)
;
;$CLASS=HighRes
;$DIM=1D
;$TYPE=
;$SUBTYPE=
;$COMMENT=


#include <Avance.incl>
#include <Grad.incl>
#include <Delay.incl>


"FACTOR1=(d9/(p6*115.112))/2"
"l1=FACTOR1*2"


"spoff29=0"
"spoff30=0"


; this isn't used in the sequence, set o1p to the signal that should be selected.
#   ifdef CALC_SPOFFS
"spoff2=bf1*(cnst21/1000000)-o1"
#   else
#   endif /*CALC_SPOFFS*/


;WaveMaker definitions
;cnst50: band-width of the band-selective RSNOB pulse [Hz]
;cnst51: sweep-width of the adiabatic pulse [Hz]
;cnst52: duration of the adiabatic pulse [t1max/2: 50-250 ms]

;sp2(p12):wvm:kp_CSSF_a:f1 rsnob(cnst50 Hz) ss=10.0us;
;sp41:wvm:kp_CSSF_bb1:f1 wurst-80(cnst51 Hz, cnst52 ms; L2H, Q=11) ss=5.0us;
;sp42:wvm:kp_CSSF_bb2:f1 wurst-80(cnst51 Hz, cnst52 ms; H2L, Q=11) ss=5.0us;

"d11=30m"
"d11=30m+1s/(1+cnst50)"
"d11=30m+1s/(1+cnst51)"
"d11=30m+1s/(1+cnst52)"
"d11=30m"


"acqt0=-p1*2/PI"


1 ze
2 30m
  20u pl1:f1 BLKGRAD
  d1 pl1:f1
  50u UNBLKGRAD

  (p1 ph1):f1

	d16
  1u
  1u gron11 
  (p41:sp41 ph6):f1
  1u
	1u groff
	d16

  3u
  p16:gp1
  d16 pl0:f1
  p12:sp2:f1 ph2:r
  3u
  p16:gp1
  d16 pl1:f1

	d16
  1u
  1u gron12 
  (p42:sp42 ph7):f1
  1u
	1u groff
	
	d16 pl1:f1


  p1 ph3
  10u gron0
  (p32:sp29 ph3):f1
  20u groff
  d16 pl10:f1


						;begin DIPSI2
4 p6*3.556 ph23
  p6*4.556 ph25
  p6*3.222 ph23
  p6*3.167 ph25
  p6*0.333 ph23
  p6*2.722 ph25
  p6*4.167 ph23
  p6*2.944 ph25
  p6*4.111 ph23
  
  p6*3.556 ph25
  p6*4.556 ph23
  p6*3.222 ph25
  p6*3.167 ph23
  p6*0.333 ph25
  p6*2.722 ph23
  p6*4.167 ph25
  p6*2.944 ph23
  p6*4.111 ph25

  p6*3.556 ph25
  p6*4.556 ph23
  p6*3.222 ph25
  p6*3.167 ph23
  p6*0.333 ph25
  p6*2.722 ph23
  p6*4.167 ph25
  p6*2.944 ph23
  p6*4.111 ph25

  p6*3.556 ph23
  p6*4.556 ph25
  p6*3.222 ph23
  p6*3.167 ph25
  p6*0.333 ph23
  p6*2.722 ph25
  p6*4.167 ph23
  p6*2.944 ph25
  p6*4.111 ph23
  lo to 4 times l1
						;end DIPSI2

  p16:gp2
  d16
  10u gron0*1.333
  (p32*0.75:sp29 ph3):f1
  20u groff

  d16 pl1:f1
  p1 ph3


  go=2 ph31
  30m mc #0 to 2 F0(zd)
	20u BLKGRAD
exit


ph1=0 2
ph2=0 0 1 1 2 2 3 3
ph3=0
ph6=0
ph7=0
ph23=3
ph25=1
ph31=0 2 2 0



;pl0 : 0W
;pl1 : f1 channel - power level for pulse (default)
;pl10: f1 channel - power level for TOCSY-spinlock
;sp2: f1 channel - shaped pulse
;sp29: f1 channel - shaped pulse (adiabatic)
;p1 : f1 channel -  90 degree high power pulse
;p6 : f1 channel -  90 degree low power pulse
;p12: f1 channel - 180 degree shaped pulse
;p16: homospoil/gradient pulse                       [1 msec]
;p32: f1 channel - 180 degree shaped pulse (adiabatic)    [20 msec]
;     smoothed chirp (sweepwidth, 20% smoothing, 10000 points)
;p41: adiabatic pulse
;p42: reverse sweep adiabatic pulse
;d1 : relaxation delay; 1-5 * T1
;d9 : TOCSY mixing time
;d16: delay for homospoil/gradient recovery
;cnst50: band-width of the band-selective RSNOB pulse [Hz]
;cnst51: sweep-width of the adiabatic pulse [Hz]
;cnst52: duration of the adiabatic pulse [t1max/2: 50-250 ms]
;l1: loop for DIPSI cycle: ((p6*115.112) * l1) = mixing time
;ns: 8 * n, total number of scans: NS * TD0
;ds: 4


;phcor 2 : phasedifference between power levels sp1 and pl1

;choose p12 according to desired selectivity
;the flip-angle is determined by the amplitude
;set O1 on resonance on the multiplet to be excited do NOT use spoffs


;for z-only gradients:
;gpz0: ca. 11%
;gpz1: 15%
;gpz2: 31%
;gpz11: +0.5%
;gpz12: -0.5%

;use gradient files:
;gpnam1: SMSQ10.100
;gpnam2: SMSQ10.100



;for sweepwidth of adiabatic shape and adjusting gpz0
;   see supplementary material of M.J. Thrippleton & J. Keeler,
;   Angew. Chem. Int. Ed. 42, 3938-3941 (2003)



;$Id: selnogpzs.2,v 1.2 2017/02/13 12:28:15 ber Exp $