Class: Radiation::Resource::IAEA
- Defined in:
- lib/radiation/resource/iaea.rb
Constant Summary collapse
- PATH =
FIXME: Better path creation
File.join(File.dirname(__FILE__), "../../../data")
- FILENAME =
"iaea-xgamma.json"
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Radiation::Resource::Base
Instance Method Details
#fetch(nuclide) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/radiation/resource/iaea.rb', line 10 def fetch(nuclide) @nuclide = nuclide begin @data = load_data.select{|n| n[:nuclide] == nuclide}.first # FIXME: Better conversion from x, x_uncertainty to pm @data[:transitions].collect!{|t| { :energy => t[:energy].to_f.pm(t[:energy_uncertainty].to_f), :intensity => t[:intensity].to_f.pm(t[:intensity_uncertainty].to_f)} } rescue raise "No Data for #{@nuclide}" end self end |
#list ⇒ Object
22 23 24 |
# File 'lib/radiation/resource/iaea.rb', line 22 def list load_data.collect{|n| n[:nuclide]} end |