# 1 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
;@ schema_version: "0.0.2"
;@ sequence_version: "0.2.0"
;@ title: Pulse nutation calibration
;@ description: |
;@   19F Pulse mutation calibration
;@
;@   - place calibration signal on-resonance
;@   - set cnst8 to nominal rf field in Hz (e.g. 60 for 60 Hz)
;@   - pulse length will be incremented in 45 degree steps
;@   - use 16 points in indirect dimension for nominal 720 degree nutation
;@   - ensure d1 is long enough for full relaxation between scans
;@
;@ authors:
;@   - Chris Waudby <c.waudby@ucl.ac.uk>
;@ created: 2020-09-04
;@ last_modified: 2025-11-15
;@ repository: github.com/waudbylab/pulseprograms
;@ status: beta
;@ experiment_type: [calibration, 1d]
;@ features: [nutation]
;@ typical_nuclei: [19F]
;@ dimensions: [calibration.duration, f1]
;@ acquisition_order: [f1, calibration.duration]
;@ reference_pulse:
;@ - {channel: f1, duration: p1, power: pl1}
;@ calibration:
;@   type: nutation
;@   channel: f1
;@   power: pl8
;@   duration: {type: linear, start: p9, step: p9}
;@   model: sine_modulated


# 1 "/opt/topspin3.7.0/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.7.0/exp/stan/nmr/lists/pp/Avance.incl"
;$Id: Avance3.incl,v 1.10.2.2 2013/08/30 09:43:33 ber Exp $
# 35 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw" 2

# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Delay.incl" 1
;Delay.incl  -  include file for commonly used delays
;
;version (13/08/07)
;
;$CLASS=HighRes Incl
;$COMMENT=

# 9 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Delay.incl"
;general delays

define delay DELTA
define delay DELTA1
define delay DELTA2
define delay DELTA3
define delay DELTA4
define delay DELTA5
define delay DELTA6
define delay DELTA7
define delay DELTA8
define delay DELTA9
define delay DELTA10
define delay DELTA11
define delay DELTA12
define delay DELTA13
define delay DELTA14
define delay DELTA15
define delay DELTA16

define delay TAU
define delay TAU1
define delay TAU2
define delay TAU3
define delay TAU4
define delay TAU5
define delay TAU6
define delay TAU7
define delay TAU8
define delay TAU9
# 40 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Delay.incl"
define delay INCR1
define delay INCR2
define delay INCR3
define delay INCR4
define delay INCR5
define delay INCR6


;delays for centering pulses
# 50 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Delay.incl"
define delay CEN_HN1
define delay CEN_HN2
define delay CEN_HN3
define delay CEN_HC1
define delay CEN_HC2
define delay CEN_HC3
define delay CEN_HC4
define delay CEN_HP1
define delay CEN_HP2
define delay CEN_CN1
define delay CEN_CN2
define delay CEN_CN3
define delay CEN_CN4
define delay CEN_CP1
define delay CEN_CP2


;loop counters
# 69 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Delay.incl"
define loopcounter COUNTER
define loopcounter SCALEF
define loopcounter FACTOR1
define loopcounter FACTOR2
define loopcounter FACTOR3
define loopcounter FACTOR4
define loopcounter FACTOR5
define loopcounter FACTOR6


# 80 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Delay.incl"
;$Id: Delay.incl,v 1.14.2.1 2013/08/30 09:43:33 ber Exp $
# 36 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw" 2

"d11=30m"
"d12=20u"

; calculate power level and pulse length for desired rf field
# 42 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
"p8=1s/(cnst8*4)"          ; pulse length for 90 degree pulse at desired rf field
"plw8=plw1*pow(p1/p8,2)"


"p9=p8*0.5"
"inp9=p8*0.5"
"inf1=inp9"
# 1 "mc_line 50 file /home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw exp. def. part of mc cmd. before ze"
; dimension 2D; AQ_mode  (F1) QF
define delay MCWRK
define delay MCREST
define loopcounter t1loop
"t1loop=0"
define loopcounter ph1loop
"ph1loop=0"
define loopcounter ST1CNT
"ST1CNT = trunc(td1 / 1)"
"MCREST = 30m - d11"
"MCWRK = 0.500000*d11"

    dccorr
# 50 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
# 50 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
1 ze
# 1 "mc_line 50 file /home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw exp. def. of mc cmd. after ze"
LBLAV, MCWRK
# 51 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
# 1 "mc_line 51 file /home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw exp. start label for mc cmd."
2 MCWRK 
LBLST1, MCWRK
  MCREST
# 52 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
  d1 pl8:f1

  p9:f1 ph1

  go=2 ph31
# 58 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
  d12 ipu9
# 1 "mc_line 59 file /home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw exp. mc cmd. in line"
  MCWRK  wr #0 if #0 zd 

  "t1loop+=1"
  lo to LBLST1 times ST1CNT
  MCWRK 
  "t1loop=0"
  MCWRK rf #0
  lo to LBLAV times tdav
# 60 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"

exit

ph1=0 2 2 0 1 3 3 1
ph31=0 2 2 0 1 3 3 1
# 66 "/home/waudbyc/pulseprograms/sequences/19f_calib_nut.cw"
;cnst8 : nominal rf field in Hz (e.g. 60 for 60 Hz)
;pl1 : f1 channel - power level for pulse (default)
;pl8 : f1 channel - power level for nutation calibration
;p1 : f1 channel -  high power pulse
;p8 : f1 channel -  90 degree pulse length at desired rf field
;p9 : f1 channel -  pulse length increment for nutation (45 degree)
;d1 : relaxation delay; 3-5 * T1
;NS: 1 * n
