Source¶
Note
For all source classes, the source mass must be expressed in units of \(M_P\), and the source radius in units \({M_P}^{-1}\).
- class phienics.source.Source(fem, Ms=1e+20, Rs=1e+47, f=0.95, from_lut=True, lut_dir='./lut/', lut_root='', lut_tmin=0.8, lut_tmax=1.2, lut_tnum=100)[source]¶
Base class for (static, spherically symmetric) sources.
- Arguments
- fem
a
fem.Feminstance- Ms
source mass (in units \(M_P\))
- Rs
source radius (in units \({M_P}^{-1}\))
- f
(float or None) mass fraction to be enclosed within the source radius. For f=None, the characteristic scale of the source profile is used
- from_lut
use a \(f(\bar{t})\) look-up table to obtain an initial guess for \(\bar{t}\), the radial rescaling to apply so that a mass fraction f is enclosed within the source radius
- lut_dir
path of the look-up table
- lut_root
root of the file names for the look-up table
- lut_tmin
if generating a look-up table, minimum \(\bar{t}\) to use in the computation
- lut_tmax
if generating a look-up table, maximum \(\bar{t}\) to use in the computation
- lut_tnum
if generating a look-up table, number of \(\bar{t}\) (between lut_tmin and lut_tmax) for which f is computed
- class phienics.tophatsource.TopHatSource(fem, Ms=1e+20, Rs=1e+47, f=0.95, w=0.02, from_lut=True, lut_dir='./lut/', lut_root='top_hat_', lut_tmin=0.8, lut_tmax=1.2, lut_tnum=100, lut_wmin=0.0001, lut_wmax=0.7, lut_wnum=300)[source]¶
This class defines a smoothed top-hat distribution:
\[\rho(r) = \frac{M_S}{ 4 \pi(-2w^3)\textrm{Li}_3(-e^{\bar{t} r_S/w}) } \frac{1}{\exp{\frac{r - \bar{t} r_S}{ w }} + 1 } \]where \(w\) is the width of the transition, \(\textrm{Li}_3(x)\) is the polylogarithm function of order 3 and \(\bar{t}\) is chosen, inside the code, so that \(r_S\) includes a user-set fraction \(f\) of the total mass.
- Arguments
- fem
a
fem.Feminstance- Ms
source mass (in units \(M_P\))
- Rs
source radius (in units \({M_P}^{-1}\))
- f
(float or None) mass fraction to be enclosed within the source radius. For f=None, \(\bar{t}=1\) is used
- w
width of the transition
- from_lut
use a \(f(w,\bar{t})\) look-up table to obtain an initial guess for \(\bar{t}\), the radial rescaling to apply so that a mass fraction f is enclosed within the source radius
- lut_dir
path of the look-up table
- lut_root
root of the file names for the look-up table
- lut_tmin
if generating a look-up table, minimum \(\bar{t}\) to use in the computation
- lut_tmax
if generating a look-up table, maximum \(\bar{t}\) to use in the computation
- lut_tnum
if generating a look-up table, number of \(\bar{t}\) (between lut_tmin and lut_tmax) for which f is computed
- lut_wmin
if generating a look-up table, minimum w to use in the computation
- lut_wmax
if generating a look-up table, maximum w to use in the computation
- lut_wnum
if generating a look-up table, number of w (between lut_wmin and lut_wmax) for which f is computed
- class phienics.tophatsource.StepSource(fem, Ms=1e+20, Rs=1e+47, f=None)[source]¶
This class defines a step source profile:
\[\rho(r) = \frac{3 M_S}{4 \pi (\bar{t}r_S)^3} \Theta(\bar{t} r_S-r)\]where \(\Theta\) is the step function and \(\bar{t}\) is chosen so that \(r_S\) encloses a user-set fraction \(f\) of the total mass.
- Arguments
- fem
a
fem.Feminstance- Ms
source mass (in units \(M_P\))
- Rs
source radius (in units \({M_P}^{-1}\))
- f
(float or None) mass fraction to be enclosed within the source radius. For f=None, \(\bar{t}=1\) is used
- class phienics.cossource.CosSource(fem, Ms=1e+20, Rs=1e+47, f=0.95, from_lut=True, lut_dir='./lut/', lut_root='cos_', lut_tmin=0.8, lut_tmax=4.0, lut_tnum=100)[source]¶
This class defines a source profile with a truncated cosine:
\[\begin{split}\rho(r) = \begin{cases} \frac{3\pi M_S}{4 (\bar{t}r_S)^3(\pi^2-6)} \left[\cos\left(\pi\frac{r}{\bar{t}r_S}\right)+1\right] & \text{if } r \leq \bar{t}\,r_S \\ 0 & \text{otherwise} \end{cases}\end{split}\]where \(\bar{t}\) is chosen, inside the code, so that \(r_S\) encloses a fraction \(f\) of the total mass.
- Arguments
- fem
a
fem.Feminstance- Ms
source mass (in units \(M_P\))
- Rs
source radius (in units \({M_P}^{-1}\))
- f
(float or None) mass fraction to be enclosed within the source radius. For f=None, \(\bar{t}=1\) is used
- from_lut
use a \(f(w,\bar{t})\) look-up table to obtain an initial guess for \(\bar{t}\), the radial rescaling to apply so that a mass fraction f is enclosed within the source radius
- lut_dir
path of the look-up table
- lut_root
root of the file names for the look-up table
- lut_tmin
if generating a look-up table, minimum \(\bar{t}\) to use in the computation
- lut_tmax
if generating a look-up table, maximum \(\bar{t}\) to use in the computation
- lut_tnum
if generating a look-up table, number of \(\bar{t}\) (between lut_tmin and lut_tmax) for which f is computed
- class phienics.gausssource.GaussianSource(fem, Ms=1e+20, Rs=1e+47, f=0.95, from_lut=True, lut_dir='./lut/', lut_root='gauss_', lut_tmin=0.2, lut_tmax=1.3, lut_tnum=100)[source]¶
This class defines a Gaussian source:
\[\rho(r) = \frac{1}{\left( \sqrt{2\pi} \sigma \right)^3} \exp{\left( -\frac{1}{2} \frac{r^2}{\sigma^2} \right)}\]where \(\sigma = \bar{t} r_S\), and where \(\bar{t}\) is chosen, inside the code, so that \(r_S\) includes a fraction \(f\) of the total mass.
- Arguments
- fem
a
fem.Feminstance- Ms
source mass (in units \(M_P\))
- Rs
source radius (in units \({M_P}^{-1}\))
- f
(float or None) mass fraction to be enclosed within the source radius. For f=None, \(\bar{t}=1\) is used
- from_lut
use a \(f(w,\bar{t})\) look-up table to obtain an initial guess for \(\bar{t}\), the radial rescaling to apply so that a mass fraction f is enclosed within the source radius
- lut_dir
path of the look-up table
- lut_root
root of the file names for the look-up table
- lut_tmin
if generating a look-up table, minimum \(\bar{t}\) to use in the computation
- lut_tmax
if generating a look-up table, maximum \(\bar{t}\) to use in the computation
- lut_tnum
if generating a look-up table, number of \(\bar{t}\) (between lut_tmin and lut_tmax) for which f is computed
- class phienics.gcakesource.GCakeSource(fem, Ms=1e+20, Rs=1e+47, f=0.95, K12=1.5, K13=3.0, from_lut=True, lut_dir='./lut/', lut_root='gcake_', lut_tmin=0.6, lut_tmax=3.0, lut_tnum=100)[source]¶
This class defines a ‘Gaussian wedding cake’ source profile:
\[\rho(r) = \frac{M_S}{4 \pi (\bar{t}r_S)^3 X} \left[A_1 \exp{\left(-\frac{1}{2}\frac{r^2}{{\sigma_1}^2}\right)} + A_2 \exp{\left(-\frac{1}{2}\frac{(r-\mu_2)^2}{{\sigma_2}^2}\right)} + A_3 \exp{\left(-\frac{1}{2}\frac{(r-\mu_3)^2}{{\sigma_3}^2}\right)}\right]\]with \(\mu_2=\bar{t}r_S/3\), \(\mu_3=2 \bar{t}r_S/3\), \(\sigma_1=\bar{t} r_S/9\), \(\sigma_2=\bar{t}r_S/7\), \(\sigma_3=\bar{t} r_S/12\), and the dimensionless factors \(A_{1,2,3}\) chosen so that \(\rho(0)=3/2\rho(\mu_2)=3\rho(\mu_3), A_3=1\).
The normalisation factor \(X\) satisfies \(4 \pi \int_0^{\infty}\rho r^2 dr=M_S\) and \(\bar{t}\) is chosen, inside the code, so that \(r_S\) includes a fraction \(f\) of the total mass.
- Arguments
- fem
a
fem.Feminstance- Ms
source mass (in units \(M_P\))
- Rs
source radius (in units \({M_P}^{-1}\))
- f
(float or None) mass fraction to be enclosed within the source radius. For f=None, \(\bar{t}=1\) is used
- K12
ratio of heights of first and second peak
- K13
ratio of heights of first and third peak
- from_lut
use a \(f(w,\bar{t})\) look-up table to obtain an initial guess for \(\bar{t}\), the radial rescaling to apply so that a mass fraction f is enclosed within the source radius
- lut_dir
path of the look-up table
- lut_root
root of the file names for the look-up table
- lut_tmin
if generating a look-up table, minimum \(\bar{t}\) to use in the computation
- lut_tmax
if generating a look-up table, maximum \(\bar{t}\) to use in the computation
- lut_tnum
if generating a look-up table, number of \(\bar{t}\) (between lut_tmin and lut_tmax) for which f is computed