"SS_getsolids_CP - Update the basic parameters in a dataset for 'tn' and 'dn', "
"                  the dp90 parameter groups and the decoupling from the probe "
"                  file for the appropriate region.                            "

"                  This macro requires the macro getparam and installation of  " 
"                  the probe template SS_AutoCAl_probe.template, as well as    "
"                  the macro getsolidprobedata. The first argument is the      "
"                  nucleus and the second argument is the region.              "

"                  Current regions: ('13C','adam') standard 13C CP (HC)        "
"                      ('13C','alpha') peptide carbonyl region (HCa)           "
"                      ('13C','carbonyl') peptide carbonyl region (HCO)        "
"                      ('15N','amino') standard 15N CP (HN)                    "
"                      ('15N','amide') peptide amide region (HNai)             "
"                      ('15N','amine') amino acid amine region (HNam)          "

//Check the Syntax or Get Region from n1. 

if ($#<2) then 
   write('error','Format: SS_AutoCal_CP(\'nucleus\',\'region\')')
   abort
endif
if (($2='adam')or($2='alpha')or($2='carbonyl')or($2='amino')or($2='amide')or($2='amine')) then
   n1=$2 
endif
$2=n1 n1=''
 
if (($2<>'adam')and($2<>'alpha')and($2<>'carbonyl')and($2<>'amino')and($2<>'amide')and($2<>'amine')) then
   write('error','Region = \'adam\',\'alpha\',\'carbonyl\',\'amino\',\'amide\' or \'amine\'')
   abort
endif 

// Basic Calibrations 

getsolidsprobedata('tn') getsolidsprobedata('dn')

if (($1='C13')and($2='adam')) then 

// Pulse Widths and Amplitudes 

  getparam('aX90_HC','C13'):aX90
  getparam('pwX90_HC','C13'):pwX90
  getparam('aH90_hpHC','H1'):aH90
  getparam('pwH90_hpHC','H1'):pwH90

elseif (($1='C13')and($2='alpha')) then 

// Pulse Widths and Amplitudes 

  getparam('aX90_HCa','C13'):aX90
  getparam('pwX90_HCa','C13'):pwX90
  getparam('aH90_hpHCa','H1'):aH90
  getparam('pwH90_hpHCa','H1'):pwH90

elseif (($1='C13')and($2='carbonyl')) then 

// Pulse Widths and Amplitudes 

  getparam('aX90_HCO','C13'):aX90
  getparam('pwX90_HCO','C13'):pwX90
  getparam('aH90_hpHCO','H1'):aH90
  getparam('pwH90_hpHCO','H1'):pwH90

elseif (($1='N15')and($2='amino')) then 

// Pulse Widths and Amplitudes 

  getparam('aX90_HN','N15'):aX90
  getparam('pwX90_HN','N15'):pwX90
  getparam('aH90_hpHN','H1'):aH90
  getparam('pwH90_hpHN','H1'):pwH90

elseif (($1='N15')and($2='amide')) then 

// Pulse Widths and Amplitudes 

  getparam('aX90_HNai','N15'):aX90
  getparam('pwX90_HNai','N15'):pwX90
  getparam('aH90_hpHNai','H1'):aH90
  getparam('pwH90_hpHNai','H1'):pwH90

elseif (($1='N15')and($2='amine')) then 

// Pulse Widths and Amplitudes 
// (pwH90_mp = pwX90 and aH90_mp = aH90_hp*pwH90/pwX90)

  getparam('aX90_HNam','N15'):aX90
  getparam('pwX90_HNam','N15'):pwX90
  getparam('aH90_hpHNam','H1'):aH90
  getparam('pwH90_hpHNam','H1'):pwH90

else
  banner('Calibration Nucleus and Region Not Found')
  abort
endif
