コード例 #1
0
ファイル: reference_values.py プロジェクト: mattias-ek/isopy
    def isotopes(self):
        """
        Dictionary containing all naturally isotopes with a given mass number.

        The dictionary is constructed from the isotopes in
        :attr:`isotope.best_abundance_measurement_M16`.

        The ``get()`` method of this dictionary will
        return an empty :class:`IsotopeKeyList` for absent keys.

        Examples
        --------
        >>> isopy.refval.mass.isotopes[40]
        IsotopeKeyList('40Ar', '40K', '40Ca')

        >>> isopy.refval.mass.isotopes.get(96)
        IsotopeKeyList('96Zr', '96Mo', '96Ru')
        """

        fraction = isopy.refval.isotope.best_measurement_fraction_M16
        isotopes = {f'{mass}':
                    isopy.IsotopeKeyList([k for k in fraction if k._filter(mass_number = {'key_eq': (mass,)})])
                    for mass in range(1, 239)}
        return core.IsopyDict(**{key: value for key, value in isotopes.items() if len(value) > 0},
                               default_value=isopy.IsotopeKeyList(), readonly=True)
コード例 #2
0
ファイル: reference_values.py プロジェクト: mattias-ek/isopy
    def atomic_weight(self):
        """
        Dictionary containing the atomic weight for each element symbol.

        The atomic weights are calculated using the isotopic abundances from
        :attr:`isotope.best_abundance_measurement_M16` and the isotopic masses from
        :attr:`isotope.isotope.mass_W17`.

        The ``get()`` method of this dictionary will
        return ``None`` for absent keys.

        Examples
        --------
        >>> isopy.refval.element.atomic_weight['pd']
        106.41532788648

        >>> isopy.refval.element.atomic_weight.get('ge')
        72.6295890304831
        """
        weights = {}
        # Isotopes is also taken from best_measurement_fraction_M16
        for element, isotopes in self.isotopes.items():
            weights[element] = np.sum([refval.isotope.mass_W17.get(isotope) *
                                       refval.isotope.best_measurement_fraction_M16.get(isotope)
                                       for isotope in isotopes])
        return core.IsopyDict(**weights, readonly=True)
コード例 #3
0
ファイル: reference_values.py プロジェクト: mattias-ek/isopy
    def atomic_number(self):
        """
        Dictionary containing the atomic number for each element symbol.

        The ``get()`` method of this dictionary will
        return ``None`` for absent keys.

        Examples
        --------
        >>> isopy.refval.element.atomic_number['pd']
        46

        >>> isopy.refval.element.atomic_number.get('ge')
        32
        """
        return core.IsopyDict(_load_RV_values('element_atomic_number', int), readonly = True)
コード例 #4
0
ファイル: reference_values.py プロジェクト: mattias-ek/isopy
    def symbol_name(self):
        """
        Dictionary containing the full element name mapped to the element symbol.

        The first letter of the element name is capitalised.

        The ``get()`` method of this dictionary will
        return ``None`` for absent keys.

        Examples
        --------
        >>> isopy.refval.element.symbol_name['pd']
        'Palladium'

        >>> isopy.refval.element.symbol_name.get('ge')
        'Germanium'
        """
        data = {isopy.ElementKeyString(key, allow_reformatting=False): value for key, value in _load_RV_values('element_symbol_name').items()}
        return core.IsopyDict(data, readonly = True)
コード例 #5
0
ファイル: reference_values.py プロジェクト: mattias-ek/isopy
    def isotopes(self):
        """
        Dictionary containing all naturally occurring isotopes for each element symbol.

        The dictionary is constructed from the isotopes in
        :attr:`isotope.best_abundance_measurement_M16`.

        The ``get()`` method of this dictionary will
        return an empty :class:`IsotopeKeyList` for absent keys.

        Examples
        --------
        >>> isopy.refval.element.isotopes['pd']
        IsotopeKeyList('102Pd', '104Pd', '105Pd', '106Pd', '108Pd', '110Pd')

        >>> isopy.refval.element.isotopes.get('ge')
        IsotopeKeyList('70Ge', '72Ge', '73Ge', '74Ge', '76Ge')
        """

        fraction = isopy.refval.isotope.best_measurement_fraction_M16
        return core.IsopyDict(**{symbol: isopy.IsotopeKeyList([k for k in fraction if k._filter(element_symbol = {'key_eq': (symbol,)})])
                               for symbol in self.all_symbols}, default_value=isopy.IsotopeKeyList(), readonly=True)