holodeck.sams.sam_cyutils

$ python setup.py build_ext -i

$ python setup.py develop

holodeck.sams.sam_cyutils.dynamic_binary_number_at_fobs()
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)