nucml.ame package¶
Submodules¶
nucml.ame.parsing module¶
-
nucml.ame.parsing.
create_natural_element_data
(originals_directory, saving_directory, fillna=True, mode='elemental', fill_value=0)[source]¶ Creates natural element data by averaging isotopic data. Additionally it adds a flag to indicate rows which correspond to isotopic or natural data.
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the periodic_table csv file is located.
saving_directory (str) – Path to directory where the resulting formatted csv file will be saved including the AME_all_merged.csv file.
fillna (bool) – If True, missing values are filled. For the remaining NaN values not filled by the used mode, a value of 0 will be inserted unless specified otherwise.
mode (str) – The supported modes are: elemental: missing values are filled using linear interpolation element-wise.
fill_value (float) – Value to fill remaining missing values with after imputation is finished with selected mode. Defaults to 0.
- Returns
None
-
nucml.ame.parsing.
get_all
(originals_directory, saving_directory, fillna=True, fill_value=0, create_imputed=True, add_qvalues=True)[source]¶ Creates 5 CSV files: Proccesed (1) mass16, (2) rct1, and (3) rct2 files. It then creates a (4) single CSV merging the first three CSV files. It then creates (5) a proccesed CSV file containing isotpic and natural element data with NaN values. If wanted a (6) copy of the fifth CSV file is saved with imputed NaN values.
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the periodic_table csv file is located.
saving_directory (str) – Path to directory where the resulting formatted csv file will be saved.
fillna (bool) – If True, it fills the missing values. For NaN values not filled by the used “mode”, then the filling method is just the mean of the entire dataset.
fill_value (int, float) – Value to fill remaining missing values with after imputation is finished with selected mode. Defaults to 0.
create_imputed (bool) – If True, missing values will be imputed.
add_qvalues (bool) – If true it will add the following reaction Q-values: [“Q(g,p)”] = -1 * [“S(p)”] [“Q(g,n)”] = -1 * [“S(n)”] [“Q(g,pn)”] = [“Q(d,a)”] - 26071.0939 [“Q(g,d)”] = [“Q(d,a)”] - 23846.5279 [“Q(g,t)”] = [“Q(p,a)”] - 19813.8649 [“Q(g,He3)”] = [“Q(n,a)”] - 20577.6194 [“Q(g,2p)”] = -1 * [“S(2p)”] [“Q(g,2n)”] = -1 * [“S(2n)”] [“Q(g,a)”] = [“Q(a)”] [“Q(p,n)”] = [“B_Decay_Energy”] - 782.3465 [“Q(p,2p)”] = -1 * [“S(p)”] [“Q(p,pn)”] = -1 * [“S(n)”] [“Q(p,d)”] = -1 * [“S(n)”] + 2224.5660 [“Q(p,2n)”] = [“Q(B-n)”] - 782.3465 [“Q(p,t)”] = -1 * [“S(2n)”] + 8481.7949 [“Q(p,3He)”] = [“Q(d,a)”] - 18353.0535 [“Q(n,2p)”] = [“Q(ep)”] + 782.3465 [“Q(n,np)”] = -1 * [“S(p)”] [“Q(n,d)”] = -1 * [“S(p)”] + 2224.5660 [“Q(n,2n)”] = -1 * [“S(n)”] [“Q(n,t)”] = [“Q(d,a)”] - 17589.2989 [“Q(n,3He)”] = -1 * [“S(2p)”] + 7718.0404 [“Q(d,t)”] = -1 * [“S(n)”] + 6257.2290 [“Q(d,3He)”] = -1 * [“S(p)”] + 5493.4744 [“Q(3He,t)”] = [“B_Decay_Energy”] - 18.5920 [“Q(3He,a)”] = -1 * [“S(n)”] + 20577.6194 [“Q(t,a)”] = -1 * [“S(p)”] + 19813.8649
- Returns
None
-
nucml.ame.parsing.
get_ame_originals
(originals_directory)[source]¶ Requests and stores the three AME original files for further processing from the IAEA website.
- Parameters
originals_directory (str) – Path-like string where the text files will be stored.
- Returns
None
-
nucml.ame.parsing.
merge_mass_rct
(directory, create_imputed=True, add_qvalues=True)[source]¶ Reads the proccessed mass16, rct1, and rct2 files and merges them while adding other reaction Q-values if needed. It creates one main CSV file when finished. This assumes the three files were created using the read_mass(), read_rct1(), and read_rct2() functions. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/. It also creates a new CSV file where missing values are filled via linear imputation paramenter- and element-wise.
- Parameters
directory (str) – Path to the Atomic Mass Evaluation directory where the processed mass16, rct2, and rct2 files are saved. The length of all three files must be the same. The resulting file will be stored in the same directory.
create_imputed (bool) – If True, missing values will be imputed.
add_qvalues (bool) – If true it will add the following reaction Q-values: [“Q(g,p)”] = -1 * [“S(p)”] [“Q(g,n)”] = -1 * [“S(n)”] [“Q(g,pn)”] = [“Q(d,a)”] - 26071.0939 [“Q(g,d)”] = [“Q(d,a)”] - 23846.5279 [“Q(g,t)”] = [“Q(p,a)”] - 19813.8649 [“Q(g,He3)”] = [“Q(n,a)”] - 20577.6194 [“Q(g,2p)”] = -1 * [“S(2p)”] [“Q(g,2n)”] = -1 * [“S(2n)”] [“Q(g,a)”] = [“Q(a)”] [“Q(p,n)”] = [“B_Decay_Energy”] - 782.3465 [“Q(p,2p)”] = -1 * [“S(p)”] [“Q(p,pn)”] = -1 * [“S(n)”] [“Q(p,d)”] = -1 * [“S(n)”] + 2224.5660 [“Q(p,2n)”] = [“Q(B-n)”] - 782.3465 [“Q(p,t)”] = -1 * [“S(2n)”] + 8481.7949 [“Q(p,3He)”] = [“Q(d,a)”] - 18353.0535 [“Q(n,2p)”] = [“Q(ep)”] + 782.3465 [“Q(n,np)”] = -1 * [“S(p)”] [“Q(n,d)”] = -1 * [“S(p)”] + 2224.5660 [“Q(n,2n)”] = -1 * [“S(n)”] [“Q(n,t)”] = [“Q(d,a)”] - 17589.2989 [“Q(n,3He)”] = -1 * [“S(2p)”] + 7718.0404 [“Q(d,t)”] = -1 * [“S(n)”] + 6257.2290 [“Q(d,3He)”] = -1 * [“S(p)”] + 5493.4744 [“Q(3He,t)”] = [“B_Decay_Energy”] - 18.5920 [“Q(3He,a)”] = -1 * [“S(n)”] + 20577.6194 [“Q(t,a)”] = -1 * [“S(p)”] + 19813.8649
- Returns
None
-
nucml.ame.parsing.
read_mass16
(originals_directory, saving_directory)[source]¶ Reads the mass16.txt file and creates a formatted CSV file. The Mass 16 file contains a variety of features including atomic mass, mass excess, binding energy, beta decay energy, and more. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/
It is parse base on the Fortran formatting: a1,i3,i5,i5,i5,1x,a3,a4,1x,f13.5,f11.5,f11.3,f9.3,1x,a2,f11.3,f9.3,1x,i3,1x,f12.5,f11.5
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the mass16_toparse.txt file is located.
saving_directory (str) – Path to save resulting formatted csv file.
- Returns
None
-
nucml.ame.parsing.
read_rct1
(originals_directory, saving_directory)[source]¶ Reads the rct1-16.txt file and creates a formatted CSV file. The rct1-16 file contains a variety of features including neutron and proton separation energies and q-values for a variety of reactions. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/
It is parse base on the Fortran formatting: a1,i3,1x,a3,i3,1x,6(f10.2,f8.2)
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the rct1-16.txt file is located.
saving_directory (str) – Path to save resulting formatted csv file.
- Returns
None
-
nucml.ame.parsing.
read_rct2
(originals_directory, saving_directory)[source]¶ Reads the rct2-16.txt file and creates a formatted CSV file. The rct2-16 file contains a variety of features including neutron and proton separation energies and q-values for a variety of reactions. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/
It is parse base on the Fortran formatting: a1,i3,1x,a3,i3,1x,6(f10.2,f8.2)
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the rct2-16.txt file is located.
saving_directory (str) – Path to save resulting formatted csv file.
- Returns
None
nucml.ame.parsing_utilities module¶
-
nucml.ame.parsing_utilities.
create_natural_element_data
(originals_directory, saving_directory, fillna=True, mode='elemental', fill_value=0)[source]¶ Creates natural element data by averaging isotopic data. Additionally it adds a flag to indicate rows which correspond to isotopic or natural data.
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the periodic_table csv file is located.
saving_directory (str) – Path to directory where the resulting formatted csv file will be saved including the AME_all_merged.csv file.
fillna (bool) – If True, missing values are filled. For the remaining NaN values not filled by the used mode, a value of 0 will be inserted unless specified otherwise.
mode (str) – The supported modes are: elemental: missing values are filled using linear interpolation element-wise.
fill_value (float) – Value to fill remaining missing values with after imputation is finished with selected mode. Defaults to 0.
- Returns
None
-
nucml.ame.parsing_utilities.
get_all
(originals_directory, saving_directory, fillna=True, fill_value=0, create_imputed=True, add_qvalues=True)[source]¶ Creates 5 CSV files: Proccesed (1) mass16, (2) rct1, and (3) rct2 files. It then creates a (4) single CSV merging the first three CSV files. It then creates (5) a proccesed CSV file containing isotpic and natural element data with NaN values. If wanted a (6) copy of the fifth CSV file is saved with imputed NaN values.
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the periodic_table csv file is located.
saving_directory (str) – Path to directory where the resulting formatted csv file will be saved.
fillna (bool) – If True, it fills the missing values. For NaN values not filled by the used “mode”, then the filling method is just the mean of the entire dataset.
fill_value (int, float) – Value to fill remaining missing values with after imputation is finished with selected mode. Defaults to 0.
create_imputed (bool) – If True, missing values will be imputed.
add_qvalues (bool) – If true it will add the following reaction Q-values: [“Q(g,p)”] = -1 * [“S(p)”] [“Q(g,n)”] = -1 * [“S(n)”] [“Q(g,pn)”] = [“Q(d,a)”] - 26071.0939 [“Q(g,d)”] = [“Q(d,a)”] - 23846.5279 [“Q(g,t)”] = [“Q(p,a)”] - 19813.8649 [“Q(g,He3)”] = [“Q(n,a)”] - 20577.6194 [“Q(g,2p)”] = -1 * [“S(2p)”] [“Q(g,2n)”] = -1 * [“S(2n)”] [“Q(g,a)”] = [“Q(a)”] [“Q(p,n)”] = [“B_Decay_Energy”] - 782.3465 [“Q(p,2p)”] = -1 * [“S(p)”] [“Q(p,pn)”] = -1 * [“S(n)”] [“Q(p,d)”] = -1 * [“S(n)”] + 2224.5660 [“Q(p,2n)”] = [“Q(B-n)”] - 782.3465 [“Q(p,t)”] = -1 * [“S(2n)”] + 8481.7949 [“Q(p,3He)”] = [“Q(d,a)”] - 18353.0535 [“Q(n,2p)”] = [“Q(ep)”] + 782.3465 [“Q(n,np)”] = -1 * [“S(p)”] [“Q(n,d)”] = -1 * [“S(p)”] + 2224.5660 [“Q(n,2n)”] = -1 * [“S(n)”] [“Q(n,t)”] = [“Q(d,a)”] - 17589.2989 [“Q(n,3He)”] = -1 * [“S(2p)”] + 7718.0404 [“Q(d,t)”] = -1 * [“S(n)”] + 6257.2290 [“Q(d,3He)”] = -1 * [“S(p)”] + 5493.4744 [“Q(3He,t)”] = [“B_Decay_Energy”] - 18.5920 [“Q(3He,a)”] = -1 * [“S(n)”] + 20577.6194 [“Q(t,a)”] = -1 * [“S(p)”] + 19813.8649
- Returns
None
-
nucml.ame.parsing_utilities.
get_ame_originals
(originals_directory)[source]¶ Requests and stores the three AME original files for further processing from the IAEA website.
- Parameters
originals_directory (str) – Path-like string where the text files will be stored.
- Returns
None
-
nucml.ame.parsing_utilities.
merge_mass_rct
(directory, create_imputed=True, add_qvalues=True)[source]¶ Reads the proccessed mass16, rct1, and rct2 files and merges them while adding other reaction Q-values if needed. It creates one main CSV file when finished. This assumes the three files were created using the read_mass(), read_rct1(), and read_rct2() functions. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/. It also creates a new CSV file where missing values are filled via linear imputation paramenter- and element-wise.
- Parameters
directory (str) – Path to the Atomic Mass Evaluation directory where the processed mass16, rct2, and rct2 files are saved. The length of all three files must be the same. The resulting file will be stored in the same directory.
create_imputed (bool) – If True, missing values will be imputed.
add_qvalues (bool) – If true it will add the following reaction Q-values: [“Q(g,p)”] = -1 * [“S(p)”] [“Q(g,n)”] = -1 * [“S(n)”] [“Q(g,pn)”] = [“Q(d,a)”] - 26071.0939 [“Q(g,d)”] = [“Q(d,a)”] - 23846.5279 [“Q(g,t)”] = [“Q(p,a)”] - 19813.8649 [“Q(g,He3)”] = [“Q(n,a)”] - 20577.6194 [“Q(g,2p)”] = -1 * [“S(2p)”] [“Q(g,2n)”] = -1 * [“S(2n)”] [“Q(g,a)”] = [“Q(a)”] [“Q(p,n)”] = [“B_Decay_Energy”] - 782.3465 [“Q(p,2p)”] = -1 * [“S(p)”] [“Q(p,pn)”] = -1 * [“S(n)”] [“Q(p,d)”] = -1 * [“S(n)”] + 2224.5660 [“Q(p,2n)”] = [“Q(B-n)”] - 782.3465 [“Q(p,t)”] = -1 * [“S(2n)”] + 8481.7949 [“Q(p,3He)”] = [“Q(d,a)”] - 18353.0535 [“Q(n,2p)”] = [“Q(ep)”] + 782.3465 [“Q(n,np)”] = -1 * [“S(p)”] [“Q(n,d)”] = -1 * [“S(p)”] + 2224.5660 [“Q(n,2n)”] = -1 * [“S(n)”] [“Q(n,t)”] = [“Q(d,a)”] - 17589.2989 [“Q(n,3He)”] = -1 * [“S(2p)”] + 7718.0404 [“Q(d,t)”] = -1 * [“S(n)”] + 6257.2290 [“Q(d,3He)”] = -1 * [“S(p)”] + 5493.4744 [“Q(3He,t)”] = [“B_Decay_Energy”] - 18.5920 [“Q(3He,a)”] = -1 * [“S(n)”] + 20577.6194 [“Q(t,a)”] = -1 * [“S(p)”] + 19813.8649
- Returns
None
-
nucml.ame.parsing_utilities.
read_mass16
(originals_directory, saving_directory)[source]¶ Reads the mass16.txt file and creates a formatted CSV file. The Mass 16 file contains a variety of features including atomic mass, mass excess, binding energy, beta decay energy, and more. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/
It is parse base on the Fortran formatting: a1,i3,i5,i5,i5,1x,a3,a4,1x,f13.5,f11.5,f11.3,f9.3,1x,a2,f11.3,f9.3,1x,i3,1x,f12.5,f11.5
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the mass16_toparse.txt file is located.
saving_directory (str) – Path to save resulting formatted csv file.
- Returns
None
-
nucml.ame.parsing_utilities.
read_rct1
(originals_directory, saving_directory)[source]¶ Reads the rct1-16.txt file and creates a formatted CSV file. The rct1-16 file contains a variety of features including neutron and proton separation energies and q-values for a variety of reactions. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/
It is parse base on the Fortran formatting: a1,i3,1x,a3,i3,1x,6(f10.2,f8.2)
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the rct1-16.txt file is located.
saving_directory (str) – Path to save resulting formatted csv file.
- Returns
None
-
nucml.ame.parsing_utilities.
read_rct2
(originals_directory, saving_directory)[source]¶ Reads the rct2-16.txt file and creates a formatted CSV file. The rct2-16 file contains a variety of features including neutron and proton separation energies and q-values for a variety of reactions. For more information visit the IAEA webiste: https://www-nds.iaea.org/amdc/
It is parse base on the Fortran formatting: a1,i3,1x,a3,i3,1x,6(f10.2,f8.2)
- Parameters
originals_directory (str) – Path to the Atomic Mass Evaluation directory where the rct2-16.txt file is located.
saving_directory (str) – Path to save resulting formatted csv file.
- Returns
None