src/HSLib/SpinSystem.cc
/* These functions allow users to either get or set the isotropic chemical
   shift of a spin or set of spins. There are a few important items worth
   taking note of.

   1.) Electrons CANNOT have their "shift" set with these functions.  Users
       must set the electron g factor to get the ESR semi-equivalent for e-.
   2.) GAMMA assumes system shifts are stored relative to a base Larmor
       frequency particular for the associated spin's isotope type.  For a
       positive gyromagnetic ratio, a spin with a positive shift is deshielded 
       relative to what the base Larmor frequency is.
   3.) Shifts in PPM may not be set/obtained unless a spectrometer field
       strength has been specified (Omega).
  
       Function    Return   Arguments	           Results
      ----------   ------   ---------   --------------------------------------
       shift       void      spin,w	Set spin shift to w spin = [0,ns)
       shift       double     spin      Retrieve shift of spin in Hz
       lab_shift   double     spin      Retrieve shift of spin in Hz, lab frame
       PPM         spin      spin,PPM   Set spin shift to PPM
       PPM         void       spin      Retrieve shift to spin in PPM
       shifts      double       w       Set all nuclear spin shifts to w in Hz
       maxShift    double               Retrieve largest shift in Hz
       maxShift    double      iso      Get largest shift in Hz, iso spins only
       minShift    double               Retrieve smallest shift in Hz
       minShift    double      iso      Get smallest shift Hz, iso spins only
       medianShift double               Get middle of shifts in Hz
                                                                             */
These functions allow users to either get or set the isotropic chemical
shift of a spin or set of spins. There are a few important items worth
taking note of.

1.) Electrons CANNOT have their "shift" set with these functions.  Users
must set the electron g factor to get the ESR semi-equivalent for e-.
2.) GAMMA assumes system shifts are stored relative to a base Larmor
frequency particular for the associated spin's isotope type.  For a
positive gyromagnetic ratio, a spin with a positive shift is deshielded
relative to what the base Larmor frequency is.
3.) Shifts in PPM may not be set/obtained unless a spectrometer field
strength has been specified (Omega).

Function    Return   Arguments              Results

shift       void      spin,w     Set spin shift to w spin = [0,ns)
shift       double     spin      Retrieve shift of spin in Hz
lab_shift   double     spin      Retrieve shift of spin in Hz, lab frame
PPM         spin      spin,PPM   Set spin shift to PPM
PPM         void       spin      Retrieve shift to spin in PPM
shifts      double       w       Set all nuclear spin shifts to w in Hz
maxShift    double               Retrieve largest shift in Hz
maxShift    double      iso      Get largest shift in Hz, iso spins only
minShift    double               Retrieve smallest shift in Hz
minShift    double      iso      Get smallest shift Hz, iso spins only
medianShift double               Get middle of shifts in Hz
These functions allow users to either get or set the isotropic chemical shift of a spin or set of spins . There are a few important items worth taking note of . 1 . ) Electrons CANNOT have their " shift " set with these functions . Users must set the electron g factor to get the ESR semi - equivalent for e - . 2 . ) GAMMA assumes system shifts are stored relative to a base Larmor frequency particular for the associated spin ' s isotope type . For a positive gyromagnetic ratio a spin with a positive shift is deshielded relative to what the base Larmor frequency is . 3 . ) Shifts in PPM may not be set / obtained unless a spectrometer field strength has been specified ( Omega ) . Function Return Arguments Results shift void spin w Set spin shift to w spin = [ 0 ns ) shift double spin Retrieve shift of spin in Hz lab_shift double spin Retrieve shift of spin in Hz lab frame PPM spin spin PPM Set spin shift to PPM PPM void spin Retrieve shift to spin in PPM shifts double w Set all nuclear spin shifts to w in Hz maxShift double Retrieve largest shift in Hz maxShift double iso Get largest shift in Hz iso spins only minShift double Retrieve smallest shift in Hz minShift double iso Get smallest shift Hz iso spins only medianShift double Get middle of shifts in Hz
void spin_system::shift(int spin, double shift)
  {
  if(!check_spin(spin,1)) SYSTfatality(108,Gdec(spin));	
  if(!checkNotE(spin,1))  SYSTfatality(10);             
  cshifts[spin]=shift;                                  
  }
void spin_system :: shift ( int spin , double shift ) { if ( ! check_spin ( spin , 1 ) ) SYSTfatality ( 108 , Gdec ( spin ) ) ; if ( ! checkNotE ( spin , 1 ) ) SYSTfatality ( 10 ) ; cshifts [ spin ] = shift ; }
These functions allow users to either get or set the isotropic chemical
shift of a spin or set of spins.
These functions allow users to either get or set the isotropic chemical shift of a spin or set of spins .
// Insure spin exists // Insure spin not e- // Set chemical shift