holodeck.sams.sam_cyutils
$ python setup.py build_ext -i
$ python setup.py develop
- holodeck.sams.sam_cyutils.dynamic_binary_number_at_fobs()
Calculate the differential number of binaries at the given frequencies.
This function converts from differential binary volume-density to differential number of binaries. The differential binary volume-density is:
\[d^3 n / [d \log_{10} M d q d z]\]Where the number density is \(n = d N/d V_c\) for a comoving volume \(V_c\). The differential binary number is:
\[d^4 N / [d \log_{10} M d q d z d \ln f]\]- Parameters:
fobs_orb ((F,) array of float, [1/s]) – The observer-frame orbital frequencies of interest, in units of inverse seconds.
sam (
holodeck.sams.sam.Semi_Analytic_Modelinstance) – The semi-analytic model population.hard (
holodeck.hardening._Hardeningsubclass instance,) – The binary evolution model to evolve binaries from galaxy merger to the given frequencies.cosmo (
astropy.cosmology.core.Cosmologyinstance) – Cosmology object used for calculating cosmological measurements.
- Returns:
redz_final ((M, Q, Z, F) array of float, []) – The redshifts at which binaries at each grid point reach the frequencies of interest. Unitless.
diff_num ((M, Q, Z, F) array of float, []) – The differential number of binaries at each grid point. Unitless.
- holodeck.sams.sam_cyutils.find_2pwl_hardening_norm()
- holodeck.sams.sam_cyutils.hard_func_2pwl_gw()
NOTE: this function will be somewhat slow, because of the explicit broadcasting!
- holodeck.sams.sam_cyutils.hard_gw()
- holodeck.sams.sam_cyutils.integrate_binary_evolution_2pwl()
- holodeck.sams.sam_cyutils.integrate_differential_number_3dx1d()
Integrate the differential number of binaries over each grid bin into total numbers of binaries.
Trapezoid used over first 3 dims (mtot, mrat, redz), and Riemann over 4th (freq). (Riemann seemed empirically to be more accurate for freq, but this should be revisited.) mtot is integrated over log10(mtot) and frequency is integrated over ln(f).
Note on array shapes:
input dnum is shaped (M, Q, Z, F)
input edges must be (4,) of array_like of lengths: M, Q, Z, F+1
output numb is shaped (M-1, Q-1, Z-1, F)
- Parameters:
edges ((4,) array_like w/ lengths M, Q, Z, F+1) –
Grid edges of mtot, mrat, redz, and freq. NOTE:
mtot should be passed as regular mtot, NOT log10(mtot)
freq should be passed as regular freq, NOT ln(freq)
dnum ((M, Q, Z, F)) – Differential number of binaries, dN/[dlog10M dq qz dlnf] where ‘N’ is in units of dimensionless number.
- Returns:
numb
- Return type:
(M-1, Q-1, Z-1, F)