sourceterm package - Provides modules to calculate the source term for a second order perturbation Klein-Gordon equation.
sosource.py Second order source term calculation module.
Provides the method getsourceandintegrate which uses an instance of a first order class from cosmomodels to calculate the source term required for second order models.
Return the integrated source term at this timestep.
Given the first order model and the timestep calculate the integrated source term at this time step.
Parameters : | m: Cosmomodels.FOCanonicalTwoStage instance :
nix: int :
integrand_elements: tuple :
srceqns: Instance of a subclass of srcequations.SourceEquations :
|
---|---|
Returns : | s: array_like :
|
Calculate and save integrated source term.
Using first order results in the specified model, the source term for second order perturbations is obtained from the given source function. The convolution integral is performed and the results are saved in a file with the specified filename.
Parameters : | m: compatible cosmomodels model instance :
savefile: String, optional :
srcclass: class, optional :
ninit: int, optional :
nfinal: int, optional :
ntheta: int, optional :
numks: int, optional :
|
---|---|
Returns : | savefile: String :
|
srcequations.py - Contains classes which implement source term calculation and are used by sosource.py.
Select the class to be used in a run by changing the settings in run_config.py.
Bases: pyflation.sourceterm.srcequations.SelectedkOnlyFullSource
Convenience class to calculate the convolution for selected k values.
Return unintegrated slow roll source term.
The source term before integration is calculated here using the slow roll approximation. This function follows the revised version of Eq (5.8) in Malik 06 (astro-ph/0610864v5).
Parameters : | bgvars : tuple
a : float
potentials : tuple
dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | src_integrand : array_like
|
References
Malik, K. 2006, JCAP03(2007)004, astro-ph/0610864v5
Bases: pyflation.sourceterm.srcequations.SourceEquations
Full single field (non slow-roll) source term equations
Calculate the value of the constants needed for source term integration.
Return array of integrated values for specified theta function and dphi function.
Parameters : | dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | theta_terms : tuple
|
Notes
The returned expression is of the form
Return unintegrated slow roll source term.
The source term before integration is calculated here using the slow roll approximation. This function follows the revised version of Eq (5.8) in Malik 06 (astro-ph/0610864v5).
Parameters : | bgvars : tuple
a : float
potentials : tuple
dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | src_integrand : array_like
|
References
Malik, K. 2006, JCAP03(2007)004, astro-ph/0610864v5
Bases: pyflation.sourceterm.srcequations.FullSingleFieldSource
Convenience class to the source term for selected k values.
Return array of integrated values for specified theta function and dphi function. This modified version only returns the result for one k value.
Parameters : | dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | theta_terms : tuple
|
Notes
The returned expression is of the form
Bases: pyflation.sourceterm.srcequations.SlowRollSource
Convenience class to do slow roll calculation of source term for only selected k modes.
Return array of integrated values for specified theta function and dphi function.
Parameters : | dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | theta_terms : tuple
|
Notes
The returned expression is of the form
Bases: pyflation.sourceterm.srcequations.SourceEquations
Slow roll source term equations
Solution for J_A which is the integral for A in terms of constants C1 and C2.
Solution for J_B which is the integral for B in terms of constants C3 and C4.
Solution for J_C which is the integral for C in terms of constants C5.
Solution for J_D which is the integral for D in terms of constants C6 and C7.
Calculate the C terms needed for source term integration.
Return array of integrated values for specified theta function and dphi function.
Parameters : | dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | theta_terms : tuple
|
Notes
The returned expression is of the form
Return integrated slow roll source term.
The source term before integration is calculated here using the slow roll approximation. This function follows the revised version of Eq (5.8) in Malik 06 (astro-ph/0610864v5).
Parameters : | bgvars : tuple
a : float
potentials : tuple
dp1 : array_like
dp1dot : array_like
|
---|---|
Returns : | src_integrand : array_like
|
References
Malik, K. 2006, JCAP03(2007)004, astro-ph/0610864v5
Bases: object
Class for source term equations
Return the scalar magnitude of k^i - q^i squared, where theta is angle between vectors.
Parameters : | k : float
q : array_like
theta : array_like
|
---|---|
Returns : | klessq : array_like
|
Notes
The expression evaluated is
Return the scalar magnitude of (k^i - q^i) squared times 1/k^2, where theta is angle between vectors.
Parameters : | k : float
q : array_like
theta : array_like
|
---|---|
Returns : | klessq : array_like
|
Notes
The expression calculated is