;UoM_X2_dec_if_id_ts4x_tbi
;Alternative pulse sequence for X decoupled pure shift 1D experiment with interferogram acquisition
;Recommended only for small JHX values and a small heteronuclear chemical shift range
;
;Developed by:
;NMR Methodology Group
;University of Manchester
;
;Pure shift 1D experiment 
;     with BB heteronuclear and homonuclear decoupling 
;     with interferogram acquisition
;
;Data can be reconstructed using a macro available at http://nmr.chemistry.manchester.ac.uk
;
;References: C. Mycroft, M. Nilsson, G. A. Morris,L. Castanar, Simultaneous broadbroad suppression of homonuclear and heteronuclear couplings in 1H NMR spectroscopy
;
;Band-selection: (1) L. Castanar, P. Nolis, A. Virgili, T. Parella, Chem. Eur. J., 19, 17283-17286, (2013)
;                (2) J. Ying, J. Roche, A. Bax, J. Magn. Reson., 241, 97-102, (2014)
;                (3) R. W. Adams, L. Byrne, P. Kiraly, M. Foroozabdeh, L. Paudel, M. Nilsson, J. Clayden, G. A. Morris, Chem. Commun., 50, 2512, (2014)
;Interferogram:  (1) K. Zangger, H. Sterk, J. Magn. Reson., 124, 486-489, (1997)
;                (2) J. A. Aguilar, S. Faulkner, M. Nilsson, G. A. Morris, 49, 3901-3903, (2010)
;
;PSYCHE: 	       (1) Foroozandeh, M.; Adams, R. W.; Meharry, N. J.; Jeannerat, D.; Nilsson, M.; Morris, G. A. Angew. Chem. Int. Ed. 2014, 53, 6990.
;
;THE USE OF WAVEMAKER IS RECOMMENDED 
; 
;Pure shift active spin refocusing options 
;       ZGOPTION= -DBS (Band-Selective)
;       ZGOPTION= -DZS (Zangger-Sterk)
;       ZGOPTION= -DdSALTIRE (PSYCHE) [used by default]
; 
;Avance NEO Version
;Topspin.4x
;
;$CLASS=HighRes
;$DIM=2D
;$TYPE=
;$SUBTYPE=
;$COMMENT=

#include <Avance.incl>
#include <Delay.incl>
#include <Grad.incl>

define delay tauA
define delay tauB

;%%%%%%%%%% WaveMaker Calculations %%%%%%%%%%
; BAND-SELECTIVE PULSE
#ifdef BS
;sp12:wvm:H_rsnob:f1 rsnob(cnst12 Hz, cnst11 ppm; PA=0.5; NPOINTS=1000) ss=1.0 us;
"spoff12=0"
"d11=30m+1s/(cnst11)-1s/(cnst11)"
"d11=30m+1s/(cnst12)-1s/(cnst12)"
"d11=30m"
#   endif

; ZANGGER-STERK PULSE
#ifdef ZS
;sp12:wvm:H_rsnob:f1 rsnob(cnst12 Hz, cnst11 ppm; PA=0.5; NPOINTS=1000) ss=1.0 us;
"spoff12=0"
"d11=30m+1s/(cnst11)-1s/(cnst11)"
"d11=30m+1s/(cnst12)-1s/(cnst12)"
"d11=30m"
#   endif

;SALTIRE PULSE
#   ifdef dSALTIRE
;Double Saltire pulse calculations
"cnst50=(cnst20/360)*sqrt((2*cnst21)/(p40/2000000))"
"p30=1000000.0/(cnst50*4)"
"cnst31= (p30/p1) * (p30/p1)"
"spw40=plw1/cnst31"
"spoff40=0"
#   endif

;DELAYS
"d0=0"  
"in0=inf1/2"
"tauA=in0/2-p16-d16-50u"
"tauB=dw*2*cnst4" 
"d11=30m"
"d16=1m"
"d17=200u"

;PULSES
"p2=p1*2"
"p4=p3*2"
"p16=1m"
"p17=1m"
"p10=p40"

;ACQUISITION
"acqt0=0"
baseopt_echo

1 ze
2 d11
  50u BLKGRAMP
  50u LOCKH_OFF
  d1 pl1:f1 pl2:f2
  50u LOCKH_ON
  50u UNBLKGRAMP

3 p1 ph1 
  d0
  tauA
  50u 
  p16:gp1 
  d16
 (center (p2 ph2):f1 (p4 ph4):f2 )
  p16:gp1 
  d16
  50u  
  tauA

  tauB
  50u
  d17 pl0:f1
  p17:gp2 
  d16
# ifdef BS
  10u
  (p12:sp12 ph3):f1
  10u
# endif 
# ifdef ZS
  10u gron0
  (p12:sp12 ph3):f1
  10u groff
# endif
# ifdef dSALTIRE
  10u
 (center (p40:sp40 ph3):f1 (p10:gp10) )
  10u 
# endif
  d17 
  p17:gp2 
  d16
  50u BLKGRAMP
  d0

  go=2 ph31
  d11 mc #0 to 2 F1QF(id0)
exit
  50u LOCKH_OFF

ph1= 0 0 0 0 1 1 1 1
ph2= 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2
ph3= 0 1 2 3
ph4= 0
ph31=0 2 0 2 1 3 1 3

;POWER LEVEL
;pl0  : f1 channel - zero power (0W)
;pl1  : f1 channel - power level for hard pulse (default) 
;pl2  : f2 channel - power level for hard pulse (default) 
;sp12 : f1 channel - power level for selective H 180 refocussing pulse (BS and ZS approach)
;sp40 : f1 channel - power level for double-saltire pulse (PSYCHE approach)

;PULSES
;p1  : f1 channel - 90 degree high power pulse 
;p2  : f1 channel - 180 degree high power pulse
;p3  : f2 channel - 90 degree high power pulse
;p4  : f2 channel - 180 degree high power pulse
;p10 : f1 channel - duration of weak gradient during double-saltire element (PSYCHE approach)
;p12 : f1 channel - duration of 180 H selective refocussing pulse (BS and ZS approach)
;p16 : f1 channel - duration of CTP gradients of hard H 180 pulse       [1 ms]
;p17 : f1 channel - duration of CTP gradients of selective H 180 pulse  [1 ms]
;p40 : f1 channel - duration of double-saltire element (PSYCHE approach)

;DELAYS
;d0  : incremented delay
;d1  : relaxation delay;  > 2 T1	
;d16 : recovery delay for CTP gradients of hard 180 pulse       [1 ms]
;d17 : recovery delay                                           [200 us]
;tauA: delay according to chunk duration
;tauB: digital filter correction delay

;SHAPED PULSES
;spnam12: f1 channel - file name for the 1H 180 selective refocussing pulse (BS and ZS approach)     [RSNOB]
;spnam40: f1 channel - file name for the double-saltire pulse element (PSYCHE approach)   [SALTIRE]

;GRADIENTS
;gpz0: spatial encoding gradient during 1H 180 selective refocussing pulse (ZS approach)     [0.1-2%]
;gpz1: CTP gradient for hard 180 pulse      [79%]
;gpz2: CTP gradient for selective 180 pulse [47%]
;gpz10: weak gradient during double-saltire pulse element (PSYCHE approach)   [1-3%]
;gpnam1: SINE.100
;gpnam2: SINE.100
;gpnam10: RECT.1

;CONSTANTS
;cnst4: number of drop points 		[4]
;cnst11: f1 channel - chemical shift for BS selective pulse. If ZS: set as o1p (in ppm)
;cnst12: f1 channel - bandwidth for selective refocussing pulse (in Hz)
;cnst20: f1 channel - desired flip angle for double-saltire pulse element [10-25 degrees]
;cnst21: f1 channel - bandwidth of each saltire pulse [10000 Hz}

;OTHER
;TD1 : number of t1 increments		[16-64]
;in0 : 1/(2 * SW) = DW
;nd0 : 2
;IN_F: chunk duration [us]
;MC2 : QF
;ns : 2 * n
;ds : 2
;BS - set cnst11 to peak of interest
;ZS and PSYCHE: set O1 on in the centre of the spectral window
