00001 #ifndef CCTBX_ELTBX_SASAKI_H
00002 #define CCTBX_ELTBX_SASAKI_H
00003
00004 #include <cctbx/eltbx/fp_fdp.h>
00005 #include <scitbx/constants.h>
00006
00007 namespace cctbx { namespace eltbx { namespace sasaki {
00008
00009 namespace detail {
00010
00011 const long n_raw = 280;
00012 const double first_wide = 0.1;
00013 const double wide_incr = 0.01;
00014 const double edge_incr = 0.0001;
00015
00016 struct raw
00017 {
00018 float fp;
00019 float fdp;
00020 };
00021
00022 struct info
00023 {
00024 char* label;
00025 int z;
00026 raw* wide;
00027 double first_k;
00028 raw* k;
00029 double first_l1;
00030 raw* l1;
00031 double first_l2;
00032 raw* l2;
00033 double first_l3;
00034 raw* l3;
00035 };
00036
00037 }
00038
00040
00054 class table
00055 {
00056 public:
00058 table() : info_(0) {}
00059
00061
00074 explicit
00075 table(
00076 std::string const& label,
00077 bool exact=false,
00078 bool exception_if_no_match=true);
00079
00081
00085 bool
00086 is_valid() const { return info_ != 0 && info_->label != 0; }
00087
00089 const char*
00090 label() const { return info_->label; }
00091
00093 int
00094 atomic_number() const { return info_->z; }
00095
00097
00104 fp_fdp
00105 at_ev(double energy) const;
00106
00108
00112 fp_fdp
00113 at_kev(double energy) const { return at_ev(energy * 1000); }
00114
00123 fp_fdp
00124 at_angstrom(double wavelength) const
00125 {
00126 return at_ev(scitbx::constants::factor_ev_angstrom / wavelength);
00127 }
00128
00129 private:
00130 const detail::info* info_;
00131 friend class table_iterator;
00132 };
00133
00136 class table_iterator
00137 {
00138 public:
00140 table_iterator();
00141
00143
00145 table
00146 next();
00147
00148 private:
00149 table current_;
00150 };
00151
00152 }}}
00153
00154 #endif // CCTBX_ELTBX_SASAKI_H