conflux.Basic ============= .. py:module:: conflux.Basic Classes ------- .. autoapisummary:: conflux.Basic.Spectrum conflux.Basic.Summed Functions --------- .. autoapisummary:: conflux.Basic.integrate_trapezoid Module Contents --------------- .. py:class:: Spectrum(xbins=np.arange(0, 20, 0.1)) A general class of a spectrum to initialize, add, and modify the object. .. py:attribute:: xbins The particle energy (MeV), or x values of the spectrum .. py:attribute:: nbin Size of the spectrum array .. py:attribute:: spectrum Contents of the spectrum .. py:attribute:: uncertainty Spectrum content uncertainties .. py:attribute:: cov_matrix Spectrum content covariance .. py:attribute:: integral :value: 0 Integral of spectrum .. py:method:: Add(targetSpec, W=1, sigma_W=0) An operator to add (or subtract) a spectrum Parameters: targetSpec (list): A list containing the spectrum we want to add to the current spectrum W (float): The weight of the added spectrum sigma_W (float): The uncertainty in the weight of the added spectrum Returns: None .. py:method:: Norm(W, sigma_W=0) An operator to scale the spectrum by a weighting factor Parameters: W (float): The weight of the spectrum sigma_W (float): The uncertainty in the weight Returns: None .. py:method:: Integral() The absolute integral of the spectrum Parameters: None Returns: integral (float): The integral of the spectrum .. py:method:: SaveToFile(filename) To save the spectrum to a csv file Parameters: filename (String): The name of the file you want to save the spectrum to. Returns: None .. py:function:: integrate_trapezoid(xs, ys) integrate \int y dx points (sorted ascending x) by trapezoidal rule .. py:class:: Summed(ID) A general class for summed objects, such as summed spectra ... Parameters ---------- ID : int The isotopic ID of a particular spectrum in the summed spectrum branches : dictionary A dictionary that contains the branch IDs of all spectra in this summed object spectra : dictionary A dictionary containing all spectral information for each branch uncertainty : dictionary A dictionary containing all uncertainty information for each branch Methods ------- Clear(): Clears out all associated dictionaries inside the summed spectra AddBranch(branch): Adds a branch object to the summed specctra SumSpectra(): Sums the spectra of all branches .. py:attribute:: ID .. py:attribute:: branches .. py:attribute:: spectra .. py:attribute:: uncertainty .. py:method:: Clear() Clears out all associated dictionaries inside the summed spectra Parameters: None Returns: None .. py:method:: AddBranch(branch) Adding a branch element to the summing object Parameters: branch (int): The ID of the branch you want to add to the summed spectrum Returns: None .. py:method:: SumSpectra() Summing units together Paremeters: None Returns: None