trinidi.cross_section#
Cross section routines
Functions
Classes
|
XSDict cross section dictionary class. |
- trinidi.cross_section.info(isotopes=None)[source]#
Print energy ranges for isotopes.
- Parameters:
isotopes (optional, list) – list of isotope symbols. If None all available isotopes are displayed.
- class trinidi.cross_section.XSDict(isotopes, t_F, flight_path_length, samples_per_bin=10)[source]#
Bases:
object
XSDict cross section dictionary class.
The cross section of the \(i^{\mathrm{th}}\) time-of-flight bin corresponds to the average cross section in the time-of-flight interval [t_F[i] - Δt/2, t_F[i] + Δt/2].
The attribute self.values stores the cross section values and is a numpy.ndarray of size (N_m, N_F), where N_m is the number of isotopes (len(isotopes)) and N_m is the number of time-of-flight bins (t_F.size).
The unit of the cross sections is mol/cm².
Initialize a XSDict object.
- Parameters:
isotopes (list) – Isotope symbols e.g. [“U-235”, “U-238”].
t_F (array) – time-of-flight array of the neutrons in \(\mathrm{μs}\).
flight_path_length (scalar) – flight path length in \(\mathrm{m}\).
samples_per_bin (int, optional) – Default 10. Likely this parameter need not be modified. Number of samples used within time-of-flight bin to approximate average cross section within bin. If samples_per_bin == 1, center of the time-of-flight bin is used.
- plot(ax, function_of_energy=False)[source]#
Plot the cross sections of a XSDict object.
- Parameters:
ax – Matplotlib axis used for plotting.
function_of_energy (bool, optional) – True plots the dictionary as a function of energy. Default False plots it as a function of time-of-flight.
- merge(merge_isotopes, merge_weights, new_key)[source]#
Merge cross section entries of an XSDict.
This function can be used to combine cross section entries using a weighted sum. The list merge_isotopes must be a subset of self.isotopes. The merge_weights are the weights of the weighted sum and are often the natural abundance fractions of the isotopes, summing to <=1. The returned list of isotopes has the unchanged isotopes where the merged isotopes are replaced by the new_key string. (I.e. they updated list isotopes is likely not stricly only isotopes.)
For example:
print(self.isotopes) # ["U-235", "U-238", "Pu-239"] new_isotopes = self.merge(["U-235", "U-238"], merge_weights, "U") print(new_isotopes) # ["U", "Pu-239"] (equivalent to self.isotopes)