conflux.BetaEngine
Public modules.
Attributes
Classes
Beta decay branch with spectrum |
|
Collection of all beta decay branches from one isotope |
|
BetaEngine tallys beta branches in the betaDB and calculate theoretical beta spectra of all tallied branches. |
Functions
|
|
|
Bateman ODEs for a linear chain. |
|
Calculate the electron or beta spectrum from theory as a function of energy. |
|
Calculate the beta spectrum from theory as a function of energy. |
|
Calculate the neutrino spectrum from theory as a function of energy. |
Module Contents
- conflux.BetaEngine.libBSG = None
- conflux.BetaEngine.init_libBSG(libname='libBSG.so')
- conflux.BetaEngine.decay_rhs(t, N, lambdas)
Bateman ODEs for a linear chain.
- conflux.BetaEngine._e_nu_spectrum(p, isNu, numass=0)
Calculate the electron or beta spectrum from theory as a function of energy.
- Parameters:
W (float) – electron total energy in electron mass units, (m_e + KE)/m_e
p (dictionary) –
A dictionary containing parameters to be used in the calculation of the beta spectrum from theory. Parameters: {
’We’: electron total energy in electron mass units, (m_e + KE)/m_e ‘Z’: Z, ‘A’: A, ‘W0’: Spectrum endpoint W ‘R’: nuclear radius, ‘L’: forbiddenness transition, ‘c’: 1.0, ‘b’: bAc*A, ‘d’: 0.0, ‘Lambda’: 0.0, ‘l’: screening_potential(Z)
}
isNu (bool) – spectrum corrections for neutrino or electron?
numass (float, optional) – Neutrino mass parameter, defaults to 0
- Returns:
beta spectrum amplitude at given beta energy
- Return type:
float
- conflux.BetaEngine.electron(ebeta, p, numass=0)
Calculate the beta spectrum from theory as a function of energy.
- Parameters:
ebeta (float) – The energy of the beta. Unit: MeV
p (dictionary) –
A dictionary containing parameters to be used in the calculation of the beta spectrum from theory. Parameters: {
’Z’: Z, ‘A’: A, ‘W0’: Spectrum endpoint electron total energy (m_e + KE)/m_e ‘R’: nuclear radius, ‘L’: forbiddenness transition, ‘c’: 1.0, ‘b’: bAc*A, ‘d’: 0.0, ‘Lambda’: 0.0, ‘l’: screening_potential(Z)
}
numass (float, optional) – Neutrino mass parameter, defaults to 0
- Returns:
beta spectrum amplitude at given beta energy
- Return type:
float
- conflux.BetaEngine.neutrino(enu, p, numass=0)
Calculate the neutrino spectrum from theory as a function of energy.
- Parameters:
enu – The energy of the electron antineutrino. Unit: MeV
p (dictionary) –
A dictionary containing parameters to be used in the calculation of the beta spectrum from theory. Parameters: {
’Z’: Z, ‘A’: A, ‘W0’: Spectrum endpoint electron total energy (m_e + KE)/m_e ‘R’: nuclear radius, ‘L’: forbiddenness transition, ‘c’: 1.0, ‘b’: bAc*A, ‘d’: 0.0, ‘Lambda’: 0.0, ‘l’: screening_potential(Z)
}
numass (float, optional) – Neutrino mass parameter, defaults to 0
- Returns:
beta spectrum amplitude at given beta energy
- Return type:
float
- class conflux.BetaEngine.BetaBranch(Z, A, I, Q, E0, sigma_E0, frac, sigma_frac, forbiddenness=0, bAc=4.7, xbins=np.arange(0, 20, 0.1), numass=0, mixing=0, custom_func=None)
Bases:
conflux.Basic.SpectrumBeta decay branch with spectrum
- Z: int
The Atomic number of the mother isotope
- A: int
The Atomic mass of the mother isotope
- I: int
The isomeric state this decay mode
- Q: float
Q value of the decay (MeV)
- ZAI: int
The unique identity of the isotope (ZAI = Z*1e4+A*10+I)
- E0: float
End-point energy of this branch, unique for each individual beta-unstable isotope
- sigma_E0: float
Uncertainty of the end-point energy
- frac: float
The fraction of this branch to the entire decay.
- sigma_frac: float
The uncertainty of the branching fraction.
- forbiddenness: int
Type of forbiddeness
- numass: float
neutrno mass (MeV), by default 0
- mixing: float
mixing of nonzero neutrino mass, by default 0
- Parameters: dict
Beta decay function parameters
- corr: dict
Correlation vector of this beta decay branch to other branches of the same isotope
- cov: dict
Covariance vector of this beta decay branch with other branches of the same isotope
- bAc = 4.7
- custom_func = None
- Display()
Display vital branch info.
- UpdateParams()
- SetCovariance(otherBranch, correlation)
Calculate the correlation and covariances between this branch and the other branch.
- Parameters:
otherBranch (
conflux.BetaEngine.BetaBranch) – The other beta branch whose correlation and covariance you want to calculatecorrelation (float) – The correlation between the two branches
- BetaSpectrum(e, nu_spectrum=False)
Calculate the unnormalized beta/neutrino spectral shape as a function of energy.
- Parameters:
e (float) – the kinetic energy of beta/neutrino (MeV)
nu_spectrum (bool, optional) – Determine whether to calculate neutrino spectrum, defaults to False
numass (float, optional) – neutrino mass, defaults to 0
- Returns:
the spectrum amplitude at specific energy
- Return type:
float
- SpectEndpointUncertMC(e, nu_spectrum=False, samples=30)
Calculate the beta/neutrino spectral shape uncertainty due to enpoint energy uncertainty sigma_E0 as a function of energy using Monte Carlo sampling.
- Parameters:
e (float) – The energy of beta/neutrino (MeV).
nu_spectrum (bool, optional) – Determine whether to calculate neutrino spectrum, defaults to False
samples (int, optional) – Set the size of MC samples, defaults to 30
- Returns:
The uncertainty of spectrum amplitude at the input energy
- Return type:
float
- CalcNormalizedSpectrum(nu_spectrum=False)
Calculated unit-normalized beta/neutrino spectrum shape (at xbins coordinates)
- Parameters:
nu_spectrum (bool, optional) – Determine whether to calculate neutrino spectrum, defaults to False
- class conflux.BetaEngine.BetaIstp(Z, A, I, Q, HL, name, xbins=np.arange(0, 20, 0.1), numass=0, mixing=0)
Bases:
conflux.Basic.SpectrumCollection of all beta decay branches from one isotope
- ZAI: int
Top-of-chain isotope (ZAI = Z*1e4+A*10+I)
- Z: int
The Atomic number of the mother isotope
- A: int
The Atomic mass of the mother isotope
- I: int
The isomeric state this decay mode
- HL: float
Half life of this isotope (s)
- Q: float
Q value of the decay (MeV)
- name: str
Name of the isotope
- missing: bool = False
Uncertainty of the end-point energy
- branches: dict
Dictionary of decay brances, keys (float) are endpoint energies, values are
conflux.BetaEngine.BetaBranch
- numass: float
neutrno mass (MeV), by default 0
- mixing: float
mixing of nonzero neutrino mass, by default 0
- MaxBranch: BetaEngine.BetaBranch
The beta decay branch with the largest fraction
- AddBranch(branch)
Add beta branch with a new endpoint energy to this isotope.
- Parameters:
branch – the branch to be added
- EditBranch(defaultE0, **kwargs)
Add or edit branches to the isotope with analyzer’s assumptions.
- Parameters:
defaultE0 (float) – Existing end point energy of the missing branch
**kwargs –
AAdditional keyword arguments.
- Keyword Args:
sigma_E0 (float): The uncertainty of the end-point energy. fraction (float): The fraction that this branch contributes to the total isotopic spectrum. sigma_frac (float): The uncertainty of fraction. forbiddenness (int): The type of forbidden/allowed transition. bAc (float): weak magnetism correcion. custom_func (method): customized beta function, needs to be structued similarly as
neutrino()orelectron(), defaults to None.
- CalcCovariance(GSF=True)
Calculate the covaraince matrix for all the beta branches of this isotope.
- Parameters:
GSF (bool, optional) – Determine whether to consider the anti-correlation between the Ground-State-decay branching Fraction (GSF) and other branches, defaults to True
- SumSpectra(nu_spectrum=True, branchErange=[0, 20.0])
Sum the beta/antineutrino spectra of all branches of this isotope.
- Parameters:
nu_spectrum (bool, optional) – Determine whether to calculate neutrino spectrum, defaults to True
branchErange (two-element list, optional) – set the lower and upper limit of the endpoint energy of branches to be summed, defaults to [0, 20.]
- Display()
Display vital isotope property and branch information.
- decay_time_adjust(begin, end)
Calculate the percentage of isotope decayed in the given time window.
- Parameters:
begin (float) – the begining of the window (s)
end (float) – the end of the window (s)
- Returns:
The fraction of isotope decayed (from 0 to 1)
- Return type:
float
- daughterZAI(gen)
ZAI identifier for decay daughter at generation gen.
- Parameters:
gen (int) – daughter generation
- Returns:
The ZAI of the decay daughter
- Return type:
int
- decay_fraction(t, HLs)
Calculate the fraction of decays completed at a generation in a decay chain. The list HLs contains all half lives of the this isotope and all its antecedents.
- Parameters:
t (float) – time for which to calculate decay fraction (in same units as HLs)
HLs (list(int)) – half-lives of all decays in chain (in same units as t)
- Returns:
fraction of decays completed at time t (0 for t=0; 1 as t -> infinity)
- Return type:
float
- CalcDecayChain(betaSpectraDB, time)
Calculate the total spectrum of a beta-decay chain in a selected window. Assumes beta decays are 100% of allowed decays in chain.
- Parameters:
betaSpectraDB (
conflux.BetaEngine.BetaEngine) – the spectrum database that saves all relavant spectratime (float) – the time stamp
- Returns:
summed, decay rate adjusted spectrum and uncertainty in the calculated window
- Return type:
numpy.array
- class conflux.BetaEngine.BetaEngine(inputlist=None, targetDB=CONFLUX_DB + '/betaDB/ENSDFbetaDB_250804.xml', xbins=np.arange(0, 20, 0.1), custom_func=None, numass=0, mixing=0)
BetaEngine tallys beta branches in the betaDB and calculate theoretical beta spectra of all tallied branches.
- inputlist: list[int] = None
A list of isotopes. If the inputlist is not given, load the entire betaDB from the default betaDB.
- istplist: dict
A dictionary of isotopes. istplist contain keys as the ZAI number of the isotope and values being
conflux.BetaEngine.BetaIstp
- targetDB: str
The file name of beta decay data base, defaults to CONFLUX_DB+`/betaDB/ENSDFbetaDB_250804.xml’
- xbins: numpy.ndarray
The spectrum range and binning, defaults to np.arange(0, 20, 0.1) (MeV)
- custom_func: callable = None
Customized beta function, needs to be structued similarly as
conflux.BetaEngine.neutrino()orconflux.BetaEngine.electron(), defaults to None
- numass: float = 0
To calculate the spectrum with non-zero neutrino mass, give the neutrino mass in the MeV unit.
- mixing: float = 0
To calcualte spectrum with non-zero neutrino mass, provide the mixing (0-1) of the neutrino mass state.
- LoadBetaDB(targetDB=CONFLUX_DB + '/betaDB/ENSDFbetaDB_250804.xml', missingBranch=3)
Load default or input betaDB to obtain beta decay informtion. A customed DB must follow the same format as the default DB.
- Parameters:
targetDB (str, optional) – The file name of beta decay data base, defaults to CONFLUX_DB+”/betaDB/ENSDFbetaDB2.xml”
missingBranch (int, optional) – Determine how many branches there are in a missing isotope, defaults to 3
- GetBetaIstp(Z, A, I=0)
Get the BetaIstp object by giving the ZAI number
- Parameters:
Z (int) – Proton number of the isotope
A (int) – Atomic mass number of the isotope
I (int, optional) – the Ith isomeric state, defaults to 0
- Returns:
the specified beta isotope object
- Return type:
- CalcBetaSpectra(nu_spectrum=True, branchErange=[0.0, 20.0], GSF=False, silent=False)
Calculates beta or neutrino spectra of listed/default beta decaying isotopes.
- Parameters:
nu_spectrum (bool, optional) – Determine whether to calculate neutrino spectrum, defaults to True
branchErange (two-element list, optional) – set the lower and upper limit of the endpoint energy of branches to be summed, defaults to [0, 20.]
GSF (bool, optional) – Determine whether to consider the anti-correlation between the Ground-State-decay branching Fraction (GSF) and other branches, defaults to True
silent (bool, optional) – whether to disable the tqdm output, defaults to False
- SaveToFile(filename)
- LoadFile(filename)