;hcconhse.fa
;3D H(CCO)NH - Gradient enhanced with optional 2H decoupling.
; Modified for CryoProbe use.
;Grzesiek, Anglister and Bax, J. Magn. Reson., B101, 114-119 (1993)
;Muhandiran and Kay, J. Magn. Reson. B 103, 203-216 (1994)
;Bruker Avance/Xwin-nmr version
;Written up by F. Abildgaard, NMRFAM (abild@nmrfam.wisc.edu)
;
;  $Id: hcconhse.fa,v 1.1 2021/02/11 14:49:20 bmrbsvc Exp $
;
;  Disclaimer: This pulse program is provided "as is" for your
;  information. Support for the use of this pulse program is
;  provided to users of the National Magnetic Resonance Facility
;  at Madison (NMRFAM). Users of this pulse program employ it at
;  their own risk. Neither NMRFAM nor University of Wisconsin-Madison
;  are liable for any physical or other damage incurred during the
;  use of this pulse program.
;
;f1: 1H, f2: 15N, f3: 13C, f5: 2H (channel assignments may be changed below)
;o1p: use fq1list fahcconhse.H (4.70ppm,8.40ppm) if F1SWITCH defined below,
;     otherwise: o1p 4.7ppm. Frequency switching may not work with DQD.
;o2p: 118ppm
;o3p: use fq3list fahcconhse.C (43ppm,55ppm)
;o5p:: 4.5ppm
;
;d1: relaxation delay=d1+0.1s
;p1 90 H at pl1
;p2 90 N at pl2
;p3 90 Cab at pl3 (for 90 Cab)
;   semi-selective: p90=sqrt(15)/(4*dNu), dNu=(175ppm-43ppm)*bf3); 58.4us at 500MHz
;p4 90 Ca at pl4
;   semi-selective: p90=sqrt(15)/(4*dNu), dNu=(175ppm-55ppm)*bf3); 64.7us at 500MHz
;p5 180 CO SEDUCE1 shaped (spnam5) at power sp5, offset CO-Cab
;p6 90 Cab at pl6 (for 180 Cab)
;   semi-selective: p90=sqrt(3)/(4*dNu), dNu=(175ppm-43ppm)*bf3); 26.1us at 500MHz
;p7 90 CO square shaped (spnam7) at power sp7, offset CO-Ca
;   semi-selective: p90=sqrt(15)/(4*dNu), dNu=(175ppm-55ppm)*bf3); 64.7us at 500MHz
;p8 180 CO square shaped (spnam8) at power sp8, offset CO-Ca
;   semi-selective: p90=sqrt(15)/(4*dNu), dNu=(175ppm-55ppm)*bf3); 129.4us at 500MHz
;p25 90 dgr. 2H pulse at pl15 (optional)
;
;phcor10: optimize phcor10 for max. signal, to compensate for phase difference
;         between pulses at power levels pl3 and pl6, resp.
;         Usually less than 10 dgr. (paropt phcor10 as -20,10,5).
;pl0 120dB
;
;H1  Waltz-16 or DIPSI-2 along x (cpdprg1), pcpd1 90 dgr pulse at pl10
;N15 Waltz-16 (cpdprg2), pcpd 90 dgr pulse at pl12
;Ca  SEDUCE1 decoupling of Ca (not compensated), using pcpd at sp3,
;    shape seduce1 offset 0, cpdprg3 waltz16sp3.
;C13 isotropic mixing: p31 90 C13 at pl14 for isotropic mixing.
;    use a value of l9 that gives the desired mixing time (15-25 ms).
;H2  Waltz-16 (cpdprg5) decoupling, 90 dgr. pulse (PCPD) at pl15
;H1 semi-constant time evolution:
;  select a sweep width for H1 => DW1=1/SW1(H)
;  select l6 (complex points in t1) => Acq. time in t1=(l6-1)*DW1
;  calculate in20, in0 and in19:
;    in20 = d20/(l6-1)  (d20 is calculated below)
;    in0  = DW1/2 + 250us/(l6-1)
;    in19 = DW1/2 - 250us/(l6-1) - in20
;    ( DW1(H) = in0+in19+in20)
;  Process as States (although data is acquired as States-TPPI)
;N15 evolution:
;  in10=in30, SW(N)=1/(2*in10)
;  l4 complex points in t2; max. is ((d10-3u)/in10)+1
;  Process as Echo/Anti-Echo
;  N15 chemical shift axis is reversed: set reverse to true.
;ns=4, 8, ...; ds=4, 8, ...
;
;Recommendations for triple-axis (single-axis) gradients:
;gpz1:  12% (12%)
;gpz2:  29% (29%)
;gpz3:  29% (29%)
;gpz4:  35% (35%)
;gpz5:  22% (22%)
;gpz6:  29% (29%)
;gpx7:  54% adjust for magic angle (0%)
;gpz7:  30% (55%)
;gpx8:  12% (0%)
;gpz8:	 0% (15%)
;gpx9:  54% adjust for magic angle (0%)
;gpz9:  30% (55%)
;gpnam1: sine.50
;gpnam2: sine.32
;gpnam3: sine.100
;gpnam4: sine.32
;gpnam5: sine.100
;gpnam6: sine.100
;gpnam7: sine.100
;gpnam8: sine.50
;gpnam9: sine.20
;
;Define one or more of the following options to tailor this pulse program
; to your specific needs.
;
;#define ONE_D			;uncomment for 1D version
#define N15_EVOL		;uncomment for 3D and H1-N15 2D version
#define H1_EVOL			;uncomment for 3D and H1-H1 2D version
;#define F1SWITCH		;uncomment for H1 carrier jump, between 4.7ppm and 8.4ppm
#define MESSERLE		;may improve solvent suppression
#define H2_DEC			; uncomment to enable H2 decoupling
;#define OPTIM_P19		; uncomment if you want to optimize p19 (GRAD9)
#define EXPTCORR		; uncomment if you want "expt" to report
;				; the correct expt time (works with XWIN-NMR 2.x)
;Select an isotropic mixing scheme
;#define DIPSI2			;taum = 115.112*p31*l9
;#define DIPSI2RC		;taum = 172.668*p31*l9
#define DIPSI3			;taum = 217.336*p31*l9
;#define FLOPSY8		;not available yet
;
;Define channel assignments:
#define H f1
#define N f2
#define C f3
#define D f5
;
;You shouldn't have to worry about anything beyond this point :-)
;
;sanity checks
;
#ifdef ONE_D
#undef N15_EVOL
#undef H1_EVOL
#endif
;
;
define delay DELTA
define delay TAUB
define delay TAUB4
define delay TAUC
define delay TAUD
define delay TAUE
define delay TAUF
define delay TAUG
define delay TAUH
define delay TAUM
define delay TN
define delay RCDELAY
define delay CEN_HN1
define delay CEN_HC1
define pulse H1_90
define pulse H1_180
define pulse CAB_90
define pulse CAB_180
define pulse CA_180
define pulse CO_90
define pulse CO_180
define pulse CO_SED
define pulse N15_90
define pulse N15_180
define pulse GRAD1
define pulse GRAD2
define pulse GRAD3
define pulse GRAD4
define pulse GRAD5
define pulse GRAD6
define pulse GRAD7
define pulse GRAD8
define pulse GRAD9

"d11=100m"			;disk i/o
"d12=10u"			;power switching etc.
"d13=5u"			;a short delay
"d14=60u"			;ip,id etc.
"d16=200u"			;gradient recovery
"d17=50u"			;short gradient recovery
"H1_90=p1"
"H1_180=H1_90*2"
"N15_90=p2"
"N15_180=N15_90*2"
"CAB_90=p3"
"CAB_180=p6*2"
"CA_180=p4*2"
"CO_90=p7"
"CO_180=p8"
"CO_SED=p5"

"GRAD1=500u"
"GRAD2=250u"
"GRAD3=800u"
"GRAD4=300u"
"GRAD5=1.0m"
"GRAD6=1.5m"
"GRAD7=1300u"
"GRAD8=500u"
#ifndef OPTIM_P19
  "p19=131.7u"
#endif
"GRAD9=p19"

"DELTA=1.5m"			; will gradually increase to 1.75m
"TAUB=1.1m"			; for CH, CH2, CH3;
;"TAUB=1.8m"			; for CH only
;"TAUB=0.9m"			; for CH2 only
;"TAUB=0.7m"			; for CH3 only
"TAUB4=TAUB-GRAD4-d16-d13"
"d19=d13"				;t1_b(0)
"d0=DELTA-GRAD2-d17-CAB_180-d19-d13"	;t1_a(0)
"d20=DELTA-GRAD2-d17-d13"		;t1_c(0)
"TN=12.4m"				; configurable: usually 12-12.4ms
"d10=TN-d12*2-d13*3"
"d30=TN-5.5m-CO_180-d12-d13*3"
"d24=CA_180"
"TAUC=3.4m-CO_SED-d13*2-d12"
"TAUD=4.4m"
"TAUE=12.4m"
"TAUF=5.5m-GRAD7-d16-d12-d13*3"
"TAUG=2.3m-GRAD8"
"TAUH=GRAD9+d16+d13*2"
"CEN_HN1=N15_90-H1_90"

"d6=H1_90"
"d7=N15_90"

#ifdef DIPSI2
  "TAUM=115.112*p31*l9"
#endif
#ifdef DIPSI2RC
  "TAUM=172.668*p31*l9"
  "RCDELAY=p31*1.599"
#endif
#ifdef DIPSI3
  "TAUM=217.336*p31*l9"
#endif

#ifdef EXPTCORR
  "d31=2*(GRAD2+GRAD4+TAUB4+TAUC+TAUE+GRAD8*2+TAUG*2)+GRAD1+GRAD3+GRAD5+GRAD6+TAUF+GRAD7+TAUH+GRAD9"
#endif

#define SED_ON d13 \n d12 pl0:C \n d13 cpds3:C
#define SED_OFF d13 do:C

#define H1_DEC_ON d13 \n d12 pl10:H \n d13 cpds1:H
#define H1_DEC_OFF d13 do:H \n d12 pl1:H

#ifdef H2_DEC
#define H2_DEC_ON d12 pl15:D \n p25:D ph1 \n d13 cpds5:D
#define H2_DEC_OFF d13 do:D \n p25:D ph3
#else
#define H2_DEC_ON d13
#define H2_DEC_OFF d13
#endif

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

1 ze
  TAUM LOCKDEC_ON
2 d13
  d14 do:N
  d14 H2_LOCK
  d11 LOCKH_OFF
  3m
3 d14
  d14
  d14
  d14
  d14
  d14
4 d14
  d14
  d14
5 d14
  d14
  d14
  d14
  d14
6 d13
#ifdef EXPTCORR
#include <faexptcorr.incl>
#endif
  d1 pl2:N
  d13 LOCKH_ON
  d13 UNBLKGRAMP
  d13 H2_PULSE
;-------------------- set carbon freq. on Cab ---------------
  d14 fq3:C
;-------------------- set proton freq. on H2O ---------------
#ifdef F1SWITCH
  d14 fq1:H
#endif
  d12 pl3:C
  (CAB_90 ph0):C
  d13
  GRAD1:gp1			; 500u, 8G/cm, z, sine.50
  d16 pl1:H
;----- Proton semi-constant time evolution and INEPT to C ----
  (H1_90 ph11):H
  d13
  GRAD2:gp2			; 250u, 20G/cm, z, sine.32
  d17 pl6:C
  d0				; t1_a
  (CAB_180 ph0):C
  d19				; t1_b
  (H1_180 ph0):H
  d13
  GRAD2:gp2			; 250u, 20G/cm, z, sine.32
  d17
  d20				; t1_c
  (H1_90 ph1):H
  d13
  GRAD3:gp3			; 800u, 20G/cm, z, sine.100
  d16 pl3:C
  H2_DEC_ON
  (CAB_90 ph0):C
  d13
  GRAD4:gp4			; 300u, 25G/cm, z, sine.32
  d16
  TAUB4 pl6:C
  (H1_180 ph0):H (CAB_180 ph10:r TAUB4):C
  d13
  GRAD4:gp4			; 300u, 25G/cm, z, sine.32
  d16 pl3:C
  (CAB_90 ph1):C
  H2_DEC_OFF
;-------------------- C isotropic mixing ---------------------
  d13
  d12 pl14:C
9 d13
#ifdef DIPSI2
#include <dipsi2C.incl>
#endif
#ifdef DIPSI2RC
#include <dipsi2rcC.incl>
#endif
#ifdef DIPSI3
#include <dipsi3C.incl>
#endif
  lo to 9 times l9
  d13
;----------------------- INEPT to C' ---------------------
  H1_DEC_ON
  H2_DEC_ON
  d12 pl3:C
  (CAB_90 ph1):C
  d13
  d12 pl0:C
  (CO_SED:sp5 ph0):C
  d13
  TAUC pl6:C
  (CAB_180 ph12):C
  d13
  d12 pl0:C
  (CO_SED:sp5 ph0):C
  d13
  TAUC pl3:C
  (CAB_90 ph0):C
  H2_DEC_OFF
  H1_DEC_OFF
  GRAD5:gp5		; 1m, 15G/cm
  d17
  H1_DEC_ON
;------------------------ Switch C frequency to Ca --------------
  d16 fq3:C
;-------------------------- INEPT to N --------------------------
  d12 pl0:C
  (CO_90:sp7 ph13):C
  d13
  d12 pl4:C
  (TAUE) (TAUD CA_180 ph0):C
  d12 pl0:C
  d24
  (CO_180:sp8 ph0):C 
  (TAUE) (d13 N15_180 ph0):N
  d12 pl4:C
  (CA_180 ph0):C
  d13
  d12 pl0:C
  (CO_90:sp7 ph0):C
  H1_DEC_OFF
  GRAD6:gp6		; 1.5m, 20G/cm
;-------------------- set proton freq. on NH ---------------
#ifdef F1SWITCH
  d17 fq1:H
#else
  d17
#endif
  H1_DEC_ON 
  d16 pl0:C
;----------- Refocus C' and constant time evolution on N (t2) -----
  (N15_90 ph14):N
  SED_ON
  d10
  SED_OFF
  d12 pl0:C
  (N15_180 ph15):N
  d13
  (CO_180:sp8 ph0):C
  SED_ON
  d30
  H1_DEC_OFF
;------------------ Defocus amide protons --------------------------
  TAUF
  SED_OFF
  d13
  GRAD7:gp7*EA*-1		; 1.3m, -/+30G/cm
  d16
;------------ Double INEPT back to amide protons -------------------
  (N15_90 ph16):N
  d6 
  (H1_90 ph0):H
  d13
  GRAD8:gp8		; 500u, 8G/cm
  TAUG
  (N15_180 ph0):N
  (H1_180 ph0):H
  d13
  GRAD8:gp8		; 500u, 8G/cm
  TAUG
  d7
  (N15_90 ph1):N
  (H1_90 ph1):H
  d13
  GRAD8:gp8		; 500u, 8G/cm
  TAUG
  (CEN_HN1 H1_180 ph0):H (N15_180 ph0):N
  d13
  GRAD8:gp8		; 500u, 8G/cm
  TAUG
  (H1_90 ph0):H
  TAUH pl12:N
  (H1_180 ph0):H
  d13
  GRAD9:gp9		; 130u, 30G/cm, sine.20
  d13
  d16 BLKGRAMP
  go=2 ph31 cpd2:N

#ifdef ONE_D
  d11 do:N wr #0 H2_LOCK
#else
  d11 do:N wr #0 if #0 zd H2_LOCK
#endif
  d13 LOCKH_OFF
#ifdef N15_EVOL
  3m igrad EA
  d14 ip16
  d14 ip16
  lo to 3 times 2
  d14 dd10
  d14 id30
  d14 ip14
  d14 ip14
  d14 ip31
  d14 ip31
  lo to 4 times l4
  d14 rd10
  d14 rd30
#endif
#ifdef H1_EVOL
  d14 ip11
  lo to 5 times 2
  d14 id0 
  d14 id19 
  d14 dd20
  d14 ip31
  d14 ip31
  lo to 6 times l6
#endif
  d14 LOCKDEC_OFF

exit

ph0=0
ph1=1
ph2=2
ph3=3
ph10=0
ph11=0
ph12=0 2
ph13=0 2
ph14=0
ph15=0 0 2 2
ph16=0
ph31=0 2

