Sha256: 4afc2fb5e61f54f9d7848f14ed4e65e91f6191129b354fdb96d60c01b90639fc

Contents?: true

Size: 855 Bytes

Versions: 14

Compression:

Stored size: 855 Bytes

Contents

require 'mspire/isotope/nist'

module Mspire
  class Isotope
    module Neese
      RATIOS = {
        H: [0.999844, 0.000156],
        C: [0.9891, 0.0109],
        N: [0.99635, 0.00365],
        O: [0.99759, 0.00037, 0.00204],
        S: [0.9493, 0.0076, 0.0429, 0.0002]
      }

      BY_ELEMENT = Mspire::Isotope::NIST::BY_ELEMENT.dup  # shallow copy on purpose

      RATIOS.each do |el, abundances| 
        BY_ELEMENT[el] = Mspire::Isotope::NIST::BY_ELEMENT[el].
          zip(abundances).map do |isotope, abundance|
          if abundance
            new_isotope = isotope.dup
            new_isotope.relative_abundance = abundance 
            new_isotope
          else
            isotope
          end
        end
      end

      ISOTOPES = BY_ELEMENT.values.flatten(1).sort_by {|ist| [ist.atomic_number, ist.mass_number] }
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
mspire-isotope-0.1.0 lib/mspire/isotope/neese.rb
mspire-0.10.8.0 lib/mspire/isotope/neese.rb
mspire-0.10.7.3 lib/mspire/isotope/neese.rb
mspire-0.10.7.2 lib/mspire/isotope/neese.rb
mspire-0.10.7.1 lib/mspire/isotope/neese.rb
mspire-0.10.7 lib/mspire/isotope/neese.rb
mspire-0.10.6 lib/mspire/isotope/neese.rb
mspire-0.10.5 lib/mspire/isotope/neese.rb
mspire-0.10.4 lib/mspire/isotope/neese.rb
mspire-0.10.3 lib/mspire/isotope/neese.rb
mspire-0.10.2 lib/mspire/isotope/neese.rb
mspire-0.10.1 lib/mspire/isotope/neese.rb
mspire-0.10.0 lib/mspire/isotope/neese.rb
mspire-0.9.2 lib/mspire/isotope/neese.rb