; GEMSTONE-NOE
; Peter Kiraly, Nicolas Kern, Mateusz P. Plesniak, Mathias Nilsson, David J. Procter, Gareth A. Morris, and Ralph William Adams 
; Angew.Chem. (2020) https://doi.org/10.1002/anie.202011642
;_r1 1st release, same as used for publication  
; 18/05/2020


;selnogpzs.2
;avance-version (17/01/23)
;1D NOESY using selective refocussing with a shaped pulse
;dipolar coupling may be due to noe or chemical exchange.
;
;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>


"if (d8 > p32+p44+d16*5+p16*6+34u ) {d20 = d8-p32-p44-d16*5-p16*6-34u;} \
                               else {d20 = 3u;}"

"if (d8 > p32+p44+d16*5+p16*6+34u ) {d31 = d8;} \
                               else {d31 = p32+p44+d16*5+p16*6+37u;}"


"spoff29=0"
"spoff30=0"


#   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

#   ifdef FLAG_BLK
  4u BLKGRAD
#   else
  4u
#   endif /*FLAG_BLK*/                    

  d1 pl1:f1
  50u UNBLKGRAD

  (p1 ph1):f1

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

  3u
  p16:gp1
  d16
  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):f1
  d20*0.31
  p16:gp2
  d16
  (p44:sp30 ph4):f1
  p16:gp2*-1
  d16
  d20*0.49
  p16*2:gp2*-1  
  d16
  10u gron0
  (p32:sp29 ph4):f1
  20u groff
  d16 pl1:f1
  p16*2:gp2
  d16
  d20*0.2

#   ifdef FLAG_BLK
  4u
#   else
  4u BLKGRAD
#   endif /*FLAG_BLK*/

  (p1 ph5):f1
  go=2 ph31
  30m mc #0 to 2 F0(zd)

#   ifdef FLAG_BLK
  d31 BLKGRAD
#   else
  d31
#   endif /*FLAG_BLK*/

exit


ph1=0 2
ph2=0 0 1 1 2 2 3 3
ph3=0
ph4=0
ph5=0
ph6=0
ph7=0
ph31=2 0 0 2


;pl1 : f1 channel - power level for pulse (default)
;sp2: f1 channel - shaped pulse
;sp29: f1 channel - shaped pulse (adiabatic)
;sp30: f1 channel - shaped pulse for broadband inversion
;p1 : f1 channel -  90 degree high 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
;p44: f1 channel - 180 degree shaped pulse for broadband inversion
;d1 : relaxation delay; 1-5 * T1
;d8 : mixing time
;d16: delay for homospoil/gradient recovery
;d31: NOESY mixing time as used
;cnst21: chemical shift for selective pulse (offset, in ppm)
;ns: 2 * 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 or use spoffs


;use gradient ratio:    gp 1 : gp 2
;                         15 :   40

;for z-only gradients:
;gpz0: ca. 11%
;gpz1: 15%
;gpz2: 40%
;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)
;   use pulseprogram zs_setup



                                          ;preprocessor-flags-start
;CALC_SPOFFS: automatically calcuate spoffs for selective pulses
;             start experiment with option -DCALC_SPOFFS (eda: ZGOPTNS)
;FLAG_BLK: for BLKGRAD before d1 rather than go
;             option -DFLAG_BLK: (eda: ZGOPTNS)
                                          ;preprocessor-flags-end



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