seqfil = 'hahnecho1d'

//------------------------------
// Receiver Delays
//------------------------------

exists('rd','parameter'):$e
if $e < 0.5 then
   create('rd','pulse')
   setlimit('rd',8192,0,0.0125)  
endif 

exists('ad','parameter'):$e
if $e < 0.5 then
   create('ad','pulse')
   setlimit('ad',8192,0,0.0125)  
endif

exists('ddrtc','parameter'):$e
if $e < 0.5 then
   create('ddrtc','pulse')
   setlimit('ddrtc',8192,0,0.0125)  
endif

//------------------------------
// Spin Rate
//------------------------------

exists('srate','parameter'):$e
if $e < 0.5 then
   create('srate','frequency')
endif 

exists('hsrotor','parameter'):$e
if $e < 0.5 then
   create('hsrotor','flag') 
endif

//------------------------------
// Basic Transmitter Properties
//------------------------------

exists('aX90','parameter'):$e
if $e < 0.5 then
   create('aX90','real')
   setlimit('aX90',4095,0,0)  
endif 

exists('aH90','parameter'):$e
if $e < 0.5 then
   create('aH90','real')
   setlimit('aH90',4095,0,0)  
endif 

exists('aY90','parameter'):$e
if $e < 0.5 then
   create('aY90','real')
   setlimit('aY90',4095,0,0)  
endif

exists('aZ90','parameter'):$e
if $e < 0.5 then
   create('aZ90','real')
   setlimit('aZ90',4095,0,0)  
endif

exists('pwX90','parameter'):$e
if $e < 0.5 then
   create('pwX90','pulse')
   setlimit('pwX90',8192,0,0.0125)
endif 

exists('pwH90','parameter'):$e
if $e < 0.5 then
   create('pwH90','pulse')
   setlimit('pwH90',8192,0,0.0125)
endif 

exists('pwY90','parameter'):$e
if $e < 0.5 then
   create('pwY90','pulse')
   setlimit('pwY90',8192,0,0.0125)
endif

exists('pwZ90','parameter'):$e
if $e < 0.5 then
   create('pwZ90','pulse')
   setlimit('pwZ90',8192,0,0.0125)
endif

//---------------
// cpHX elements
//---------------

exists('shHX','parameter'):$e
if $e < 0.5 then
    create('shHX','flag')
endif

exists('toHX','parameter'):$e
if $e < 0.5 then
   create('toHX','flag')
endif 
setvalue('toHX','obs')

exists('frHX','parameter'):$e
if $e < 0.5 then
   create('frHX','flag')
endif
setvalue('frHX','dec')  

exists('chHX','parameter'):$e
if $e < 0.5 then
   create('chHX','flag')
endif 

exists('aHhx','parameter'):$e
if $e < 0.5 then
   create('aHhx','real')
   setlimit('aHhx',4095,0,0)
endif 

exists('aXhx','parameter'):$e
if $e < 0.5 then
   create('aXhx','real')
   setlimit('aXhx',4095,0,0)
endif 

exists('bHX','parameter'):$e
if $e < 0.5 then
   create('bHX','real')
   setlimit('bHX',1000000,0,1.0e-6)
endif 

exists('dHX','parameter'):$e
if $e < 0.5 then
   create('dHX','real')
   setlimit('dHX',4095,-4095,1)
endif 

exists('tHX','parameter'):$e
if $e < 0.5 then
   create('tHX','pulse')
   setlimit('tHX',50000,0,0.0125)
endif

exists('ofHX','parameter'):$e
if $e < 0.5 then
    create('ofHX','frequency')
endif  

//=====================
// decoupling options
//======================

exists('Hseq','parameter'):$e
if $e < 0.5 then
    create('Hseq','flag')
endif

//-----------
// tppm
//-----------

exists('aHtppm','parameter'):$e
if $e < 0.5 then
    create('aHtppm','real')
    setlimit('aHtppm',4095,0,0)
endif

exists('pwHtppm','parameter'):$e
if $e < 0.5 then
    create('pwHtppm','pulse')
    setlimit('pwHtppm',8192,0,0.0125)
endif

exists('phHtppm','parameter'):$e
if $e < 0.5 then
    create('phHtppm','real')
    setlimit('phHtppm',180,-180,0.0)
endif

exists('chHtppm','parameter'):$e
if $e < 0.5 then
   create('chHtppm','flag')
endif 
setvalue('chHtppm','dec')

//------------------------------
//  spinal 
//------------------------------

exists('aHspinal','parameter'):$e
if $e < 0.5 then
    create('aHspinal','real')
    setlimit('aHspinal',4095,0,0)
endif

exists('pwHspinal','parameter'):$e
if $e < 0.5 then
    create('pwHspinal','pulse')
    setlimit('pwHspinal',8192,0,0.0125)
endif

exists('phHspinal','parameter'):$e
if $e < 0.5 then
    create('phHspinal','real')
    setlimit('phHspinal',180,-180,0.0)
endif

exists('chHspinal','parameter'):$e
if $e < 0.5 then
   create('chHspinal','flag')
endif 
setvalue('chHspinal','dec')

//-------------------------------------------------
// Solid State Echo
//-------------------------------------------------

exists('aXecho','parameter'):$e
if $e < 0.5 then
    create('aXecho','real')
    setlimit('aXecho',4095,0,0)
endif

exists('t1Xecho','parameter'):$e
if $e < 0.5 then
   create('t1Xecho','pulse')
   setlimit('t1Xecho',50000,0,0.0125)
endif

exists('pwXecho','parameter'):$e
if $e < 0.5 then
    create('pwXecho','pulse')
    setlimit('pwXecho',8192,0,0.0125)
endif

exists('t2Xecho','parameter'):$e
if $e < 0.5 then
   create('t2Xecho','pulse')
   setlimit('t2Xecho',50000,0,0.0125)
endif

//------------------------------------------------
//  Set Bit 14 for new parameters of the .par file 
//------------------------------------------------

$params = 'frHX toHX chHspinal chHtppm '
$params = $params + 'aXecho t1Xecho pwXecho t2Xecho'
setprotect('','clear',16384)
setprotect($params,'on',16384)

//--------------------------------------------------------
//  Clear parameters in 'clearparams' in the apptype macro
//--------------------------------------------------------

exists('clearparams','parameter'):$e
if $e < 0.5 then
   create('clearparams','string')
endif
setprotect('clearparams','on',16384)
$clearparams = 'frHX toHX chHspinal chHtppm'
setvalue('clearparams',$clearparams)

//------------------------------------------------
//  Set the parameter templates
//------------------------------------------------

setprotect('dg','clear',4)
$dg = '1:ACQUISITION:sw:1,at:6,np:0,d1:6,nt:0,ct:0,bs:0,'
$dg = $dg + 'ss:0,rd:1,ad:1,ddrtc:1,rof3(rof3):1,gain:0,temp:0,srate:1;'
$dg = $dg + '2:echoX:aXecho:0,t1Xecho:1,pwXecho:1,t2Xecho:1;'
$dg = $dg + '3(Hseq=\'tppm\'):TPPM:aHtppm:0,pwHtppm:1,phHtppm:2;'
$dg = $dg + '3(Hseq=\'spinal\'):SPINAL:aHspinal:0,pwHspinal:1,phHspinal:2;'
dg = $dg
setprotect('dg','on',4)

setprotect('dg2','clear',4)
$dg2 = '1:OBSERVE:tn,sfrq:6,tof:1,tpwr:0,aX90:0,pwX90:1;'
$dg2=$dg2+'2:DECOUPLE:dn,dfrq:6,dof:1,dpwr:0,aH90:0,pwH90:1;'
$dg2=$dg2+'3:DECOUPLE2:dn2,dfrq2:6,dof2:1,dpwr2:0,aY90:0,pwY90:1;'
$dg2=$dg2+'4:DECOUPLE3:dn3,dfrq3:6,dof3:1,dpwr3:0,aZ90:0,pwZ90:1;'
dg2 = $dg2
setprotect('dg2','on',4)

setprotect('ap','clear',4)
$ap = '1:SAMPLE:date,temp:1,srate:1,file;'
$ap = $ap + '1:ACQUISITION:tn,sfrq:6,tof:1,tpwr:0,sw:1,at:6,np:0,d1:6,nt:0,ct:0,ss:0,rd:1,ad:1,aX90:0,pwX90:1;'
$ap = $ap + '1(ni):2D ACQUISITION:d2:6,sw1:1,ni:0,phase:0;'
$ap = $ap + '1:DECOUPLE:dn,dfrq:6,dof:1,dpwr:0,aH90:0,pwH90:1;'
$ap = $ap + '1(dfrq2>0):DECOUPLE2:dn2,dfrq2:6,dof2:1,dpwr2:0,aY90:0,pwY90:1;'
$ap = $ap + '1(dfrq3>0):DECOUPLE3:dn3,dfrq3:6,dof3:1,dpwr3:0,aZ90:0,pwZ90:1;'
$ap = $ap + '1:echoX:aXecho:0,t1Xecho:1,pwXecho:1,t2Xecho:1;'
$ap = $ap + '1(Hseq=\'tppm\'):TPPM:aHtppm:0,pwHtppm:1,phHtppm:2;'
$ap = $ap + '1(Hseq=\'spinal\'):SPINAL:aHspinal:0,pwHspinal:1,phHspinal:2;'
ap = $ap
setvalue('ap',$ap,'processed')
setprotect('ap','on',4)





