view extra/xraylib/src/xraylib/src/atomicweight.c @ 2808:c2f77c6b4b0b octave-forge

Initial revision
author tpikonen
date Tue, 12 Dec 2006 15:27:45 +0000
parents
children
line wrap: on
line source

#include "xrayglob.h"
#include "xraylib.h"

//////////////////////////////////////////////////////////////////////
//                                                                  //
//                            Atomic Weight                         //
//                                                                  //
//          Z : atomic number                                       //
//                                                                  //
//////////////////////////////////////////////////////////////////////
float AtomicWeight(int Z)
{
  float atomic_weight;

  if (Z<1 || Z>ZMAX) {
    ErrorExit("Z out of range in function AtomicWeight");
    return 0;
  }

  atomic_weight = AtomicWeight_arr[Z];
  if (atomic_weight < 0.) {
    ErrorExit("Atomic Weight not available in function AtomicWeight");
    return 0;
  }
  return atomic_weight;
}