Tutorial on naa_isotope_analyzer.py

In order for naa_isotope_analyzer.py to function properly, the user must have access to peak easy. The current implementation of naa_isotope_analyzer.py is dependent on the output of the csv file that peak easy generates. In order to generate the proper csv file, one must manually highlight the peaks of interest using peak easy and then click on the "Peak Analysis".Under the "Peak Analysis" tab click the "Display/Save All ROI Data". This will open a new window, in which the information related to the highlighted peaks are displayed. Click on the "Save Results to CSV File" option on the lower left of the window. This will generate the proper CSV file that will be used for naa_isotope_analyzer.py. First download the naa_isotope_analyzer folder. The folder contains all the required files and dependencies in order for naa_isotope_analyzer.py to function properly. In order to use naa_isotope_analyzer.py, the CSV file generated from peak easy must be in the same directory as naa_isotope_analyzer.py. Next, load naa_isotope_analyzer.py. The command to run the program is: naa_isotope_analyzer(csv_filename). Note: csv_filename is the name of the csv file in string format. naa_isotope_analyzer returns a dataframe as well as a csv file containing the most probable precursor isotopes responsible for the emitted peaks. In addition to the responsible precursor isotopes, naa_isotope_analyzer also returns all the energies in the spectrum that the precursor isotope is responsible for emitting as well its respective branching ratio, net area, net area uncertainty, peak counts per second, and fwhm (full width at half maximum). Below is an example for the analysis of a spectrum of unknown composition.

#Example: Identifying an Unknown Sample

In this example, we will analyze an unknown sample and determine its isotopic composition. Note that the CSV file generated by naa_isotope_analyzer will be created in the same directory as the naa_isotope_analyzer.py directory.

In [10]:
import naa_isotope_analyzer as naa

In [11]:
df = naa.naa_isotope_analyzer('unknownsample.CSV')
df


[('TI51', 2), ('CO60', 2), ('W187', 2), ('FE59', 2), ('SC46', 1), ('TA182', 1), ('GA72', 1), ('SB124', 1), ('MO93', 1), ('TL206', 1), ('GD161', 1), ('Y90', 1), ('CR51', 1), ('ND147', 1), ('RU103', 1), ('HO166', 1), ('RU105', 1), ('LU177', 1), ('ZN71', 1), ('GE77', 1), ('PA232', 1), ('K40', 1)]
[('TI51', 2), ('CO60', 2), ('W187', 2), ('FE59', 2), ('SC46', 1), ('TA182', 1), ('GA72', 1), ('SB124', 1), ('MO93', 1), ('TL206', 1), ('GD161', 1), ('Y90', 1), ('CR51', 1), ('ND147', 1), ('RU103', 1), ('HO166', 1), ('RU105', 1), ('LU177', 1), ('ZN71', 1), ('GE77', 1), ('PA232', 1), ('K40', 1)]
Out[11]:
ordered_br ordered_energies ordered_fwhm ordered_isotopes ordered_net_area ordered_net_area_unc ordered_peak_cps
0 [0.209, 0.258, 0.158] [479.34, 911.46, 969.07] [0.84, 1.21, 1.34] AC228 [55.6, 50.7, 44.3] [14.0, 11.5, 10.7] [0.01101, 0.01003, 0.008775]
1 [0.461, 0.151, 0.154] [609.35, 1120.44, 1764.15] [2.44, 1.9, 2.45] BI214 [93.7, 47.5, 54.7] [18.6, 11.9, 8.4] [0.01856, 0.009409, 0.01083]
2 [0.565, 0.43200000000000005] [1099.18, 1291.47] [2.68, 2.18] FE59 [276.1, 221.8] [19.5, 16.5] [0.0547, 0.04394]
3 [0.9984999999999999, 0.9998260000000001] [1173.0, 1332.2] [2.59, 2.46] CO60 [219.5, 171.1] [17.8, 15.0] [0.04349, 0.03389]
4 [0.332] [685.51] [1.59] W187 [81.2] [15.0] [0.01608]
5 [[None]] [609.35] [2.44] SE:BI214 [93.7] [18.6] [0.01856]
6 [0.020870000000000003] [810.69] [2.5] GA72 [141.3] [18.0] [0.028]
7 [0.9309999999999999] [320.01] [2.05] TI51 [11352.0] [109.5] [2.249]
8 [0.99] [2614.19] [2.71] TL208 [123.4] [11.3] [0.02445]
9 [0.11] [1460.71] [2.38] K40 [486.0] [22.6] [0.09628]

In [ ]: