src/Gradients/sys_gradz.cc
/*   Function       Arguments                      Result
    -----------   -------------     -------------------------------------------
    SubSys             int          Returns the requested sub-system
    SubSysShift     int, int        Shift (Hz) of spin in specified sub-system
    SubSysShift    double, int      Shift (Hz) of spin @ specified distance (m)
    SubSysPPM       int, int        Shift(PPM) of spin in specified sub-system
    SubSysPPM      double, int      Shift(PPM) of spin @ specified distance (m)
 
  Note that in GAMMA the ith sub-system is viewed as a base system having
  modified shifts.  From this perspective it is assumed that the user wants
  all sub-system referenced to the same rotating frame, namely the base
  Larmor frequency of each isotope type.                                    */
Function       Arguments                      Result

SubSys             int          Returns the requested sub-system
SubSysShift     int, int        Shift (Hz) of spin in specified sub-system
SubSysShift    double, int      Shift (Hz) of spin @ specified distance (m)
SubSysPPM       int, int        Shift(PPM) of spin in specified sub-system
SubSysPPM      double, int      Shift(PPM) of spin @ specified distance (m)

Note that in GAMMA the ith sub-system is viewed as a base system having
modified shifts.  From this perspective it is assumed that the user wants
all sub-system referenced to the same rotating frame, namely the base
Larmor frequency of each isotope type.
Function Arguments Result SubSys int Returns the requested sub - system SubSysShift int int Shift ( Hz ) of spin in specified sub - system SubSysShift double int Shift ( Hz ) of spin @ specified distance ( m ) SubSysPPM int int Shift ( PPM ) of spin in specified sub - system SubSysPPM double int Shift ( PPM ) of spin @ specified distance ( m ) Note that in GAMMA the ith sub - system is viewed as a base system having modified shifts . From this perspective it is assumed that the user wants all sub - system referenced to the same rotating frame namely the base Larmor frequency of each isotope type .
spin_system sys_gradz::SubSys(int nss) const
  {
  spin_system sys(*this);			
  double Bmod = dBodm*SysDist(nss)*RAD2HZ;	
  double newshift;
  for(int i=0; i<spins(); i++)			
    {
    newshift = sys.shift(i);			
    newshift += Bmod*gamma(i);			
    sys.shift(i, newshift);			
    }
  return sys;
  }
spin_system sys_gradz :: SubSys ( int nss ) const { spin_system sys ( * this ) ; double Bmod = dBodm * SysDist ( nss ) * RAD2HZ ; double newshift ; for ( int i = 0 ; i < spins ( ) ; i ++ ) { newshift = sys . shift ( i ) ; newshift += Bmod * gamma ( i ) ; sys . shift ( i , newshift ) ; } return sys ; }
Function       Arguments                      Result
   
SubSys             int          Returns the requested sub-system
SubSysShift     int, int        Shift (Hz) of spin in specified sub-system
SubSysShift    double, int      Shift (Hz) of spin @ specified distance (m)
SubSysPPM       int, int        Shift(PPM) of spin in specified sub-system
SubSysPPM      double, int      Shift(PPM) of spin @ specified distance (m)
Function Arguments Result SubSys int Returns the requested sub - system SubSysShift int int Shift ( Hz ) of spin in specified sub - system SubSysShift double int Shift ( Hz ) of spin @ specified distance ( m ) SubSysPPM int int Shift ( PPM ) of spin in specified sub - system SubSysPPM double int Shift ( PPM ) of spin @ specified distance ( m )
// Copy sysg into spin-system // Gradient at nss (T*Hz/rad) // Loop over the spins //	Current shift //	Gradient modified //	Set modified shift