Reference Input Parameter Library (RIPL)

The Reference Input Parameter Library (RIPL) contains nuclear structure information. These files are much easier to parse and manipulate than their source, the Experimental Nuclear Structure Database (XUNDL). XUNDL files are not directly supported for now. Let us get an overview of what NucML can do for us. Let us begin, as always, by importing the nucml.datasets module.

[1]:
# # PROTOTYPE
# import sys
# sys.path.append("../..")
[2]:
import nucml.datasets as nuc_data

RIPL/XUNDL Headers

The RIPL headers are the most basic information in terms of nuclear structure. It includes the elements, the number of levels and gammas available, and the neutron and proton separation energy.

[3]:
ensdf_headers = nuc_data.load_ensdf_headers()
[4]:
ensdf_headers.head()
[4]:
Element_w_A A Z Number_of_Levels Number_of_Gammas N_max N_c Sn Sp
0 1H 1 1 1 0 1 1 0.00000 0.00000
1 2H 2 1 1 0 1 1 2.22457 2.22457
2 3H 3 1 1 0 1 1 6.25723 0.00000
3 3He 3 2 1 0 1 1 0.00000 5.49348
4 4He 4 2 16 0 1 16 20.57762 19.81386

Elemental RIPL Information

We can easily load all available nuclear structure levels for a given isotope using the load_ensdf_isotopic(). It returns all levels and their energies, the spin, parity, half-life, gammas per level, a RIPL specific flag, and the number of decay modes.

[5]:
u236_levels = nuc_data.load_ensdf_isotopic("u236")
[6]:
u236_levels.head()
[6]:
Level_Number Energy Spin Parity Half_Life Gammas Flag ENSDF_Spin Num_Decay_Modes Decay_Info
0 1.0 0.000000 0.0 1 7.391000e+14 0 u 0+ 2 = 1.0000E+02 %A = 9.4000E-08 %SF ...
1 2.0 0.045244 2.0 1 2.340000e-10 1 u 2+ 0 0.000000 0
2 3.0 0.149477 4.0 1 1.240000e-10 1 u 4+ 0 0.000000 0
3 4.0 0.309785 6.0 1 5.800000e-11 1 u 6+ 0 0.000000 0
4 5.0 0.522250 8.0 1 2.400000e-11 1 u 8+ 0 0.000000 0

Elemental RIPL Gammas

We can also obtain the known gammas per level including their initial and final level state, the energy, the gamma and electromagnetic decay probability, and the ICC.

[7]:
u235_gammas = nuc_data.load_ensdf_isotopic("u235", filetype='gammas')
[8]:
u235_gammas.head()
[8]:
Level_Record Final_State Energy Gamma_Decay_Prob Electromag_Decay_Prob ICC
2 2.0 1 0.000 1.000000e-10 1.0000 1.000000e+10
4 3.0 2 0.013 9.990000e-04 1.0000 1.000000e+03
6 4.0 1 0.046 1.515000e-02 1.0000 6.500000e+01
8 5.0 3 0.039 8.712000e-04 0.2709 3.100000e+02
9 5.0 2 0.052 2.293000e-03 0.7291 3.170000e+02

Ground State Data

With the previous functions, you can obtain most of the basic nuclear structure data. Another commodity function offered by NucML is the load_ensdf_ground_states(). This will load only the ground state for all available isotopes.

[9]:
ground_states = nuc_data.load_ensdf_ground_states()
[10]:
ground_states.head()
[10]:
Element_w_A Spin Parity Half_Life Flag ENSDF_Spin Num_Decay_Modes Modifier Decay_Info
0 1H 0.5 1 -1.0 1/2+ 0 0.000000
1 2H 1.0 1 -1.0 1+ 0 0.000000
2 3H 0.5 1 388800000.0 1/2+ 1 = 1.0000E+02 %B- ...
3 3He 0.5 1 -1.0 1/2+ 0 0.000000
4 4He 0.0 1 -1.0 0+ 0 0.000000

RIPL Cut-Off Parameters

RIPL offers some recommended cut-off parameters for nuclear structure data. These will be useful when deciding the transformations applied to an ML-ready XUNDL dataset. For now, you can obtain the Cut-Off parameters using the load_riple_parameteres().

[11]:
ripl_cutoff = nuc_data.load_ripl_parameters()
[12]:
ripl_cutoff.head()
[12]:
Z A Element Temperature_MeV Temperature_U Black_Shift Black_Shift_U N_Lev_ENSDF N_Max_Lev_Complete Min_Lev_Complete Num_Lev_Unique_Spin E_Max_N_Max E_Num_Lev_U_Spin Chi Fit Flag Nox Xm_Ex Sigma Element_w_A
0 0 1 n 0.0 0.0 0.0 0.0 1 1 1 1 0.0 0.0 0 0.0 1n
1 1 1 H 0.0 0.0 0.0 0.0 1 1 1 1 0.0 0.0 0 0.0 1H
2 1 2 H 0.0 0.0 0.0 0.0 1 1 1 1 0.0 0.0 0 0.0 2H
3 1 3 H 0.0 0.0 0.0 0.0 1 1 1 1 0.0 0.0 0 0.0 3H
4 2 3 He 0.0 0.0 0.0 0.0 1 1 1 1 0.0 0.0 0 0.0 3He

All RIPL/XUNDL Data

You can also load all nuclear structure levels and their energies along with some basic information. It is a good place to get started building an ML-ready dataset.

[13]:
ensdf = nuc_data.load_ensdf()
INFO:root:Reading data from C:/Users/Pedro/Desktop/ML_Nuclear_Data/ENSDF\CSV_Files/ensdf.csv
[14]:
ensdf.head()
[14]:
Level_Number Energy Spin Parity Half_Life Gammas Flag ENSDF_Spin Num_Decay_Modes Decay_Info Element_w_A
0 1 0.0 0.5 1 -1.0 0 NaN 1/2+ 0 0.0 1H
1 1 0.0 1.0 1 -1.0 0 NaN 1+ 0 0.0 2H
2 1 0.0 0.5 1 388800000.0 0 NaN 1/2+ 1 = 1.0000E+02 %B- ... 3H
3 1 0.0 0.5 1 -1.0 0 NaN 1/2+ 0 0.0 3He
4 1 0.0 0.0 1 -1.0 0 NaN 0+ 0 0.000000 4He

You can also load a limited set of levels based on the RIPL cut-off parameters by specifying the cutoff argument:

[15]:
ensdf_cutoff= nuc_data.load_ensdf(cutoff=True)
INFO:root:Reading data from C:/Users/Pedro/Desktop/ML_Nuclear_Data/ENSDF\CSV_Files/ensdf_cutoff.csv
[16]:
ensdf.shape
[16]:
(72667, 11)
[17]:
ensdf_cutoff.shape
[17]:
(21354, 11)

ML-ready RIPL Dataset

Modeling nuclear structure is tricky. There are many ways we could prepare the dataset and model it using different algorithms and approaches. One option is using processing similar to that of EXFOR. We can achieve this using the load_ensdf_ml() method.

NOTE: This method is experimental and the returned data should always be inspected.

[18]:
ensdf_ml, x_train, x_test, y_train, y_test, to_scale, scaler = nuc_data.load_ensdf_ml(
    cutoff=False, log=True, append_ame=True, basic=1, num=True)
INFO:root:Dropping Ground State...
INFO:root:AME: Reading and loading Atomic Mass Evaluation files from:
 C:/Users/Pedro/Desktop/ML_Nuclear_Data/AME/CSV_Files\AME_all_merged_no_NaN.csv
INFO:root:Dropping unnecessary features and one-hot encoding categorical columns...
INFO:root:Splitting dataset into training and testing...
INFO:root:Normalizing dataset...
INFO:root:Fitting new scaler.
INFO:root:Finished. Resulting dataset has shape (72138, 12), Training and Testing dataset shapes are (50496, 11) and (21642, 11) respesctively.
[19]:
x_train.head()
[19]:
Level_Number Z N A Atomic_Mass_Micro Mass_Excess Binding_Energy B_Decay_Energy S(2n) S(n) S(p)
2028 1.414973 -1.618364 -1.511965 -1.553747 -1.552763 1.144175 -0.214506 -3.507361 3.207512 3.279167 1.675159
63871 1.653213 1.208436 1.342290 1.292679 1.292933 0.767382 -1.213664 1.179749 -1.036423 -1.285178 0.293675
45732 1.462398 0.480321 0.478158 0.479414 0.478960 -0.595716 -0.212229 0.989262 -1.022829 -0.572432 -1.124873
58077 1.531479 0.951455 0.975689 0.967373 0.967281 0.121217 -0.833843 0.635374 -0.879278 -1.059364 -0.409278
58027 2.250420 0.951455 0.949503 0.951108 0.950984 0.065985 -0.803468 0.114818 -0.808407 -0.424349 -0.445178

This loader function offers less flexibility than the EXFOR counterpart. The same functionalities will hopefully be integrated in the future.