add spin dependence
Added logic to incorporate the spin dependence of comparisons like 'mass <= Mmax(Mtov, spin)' based on Breu+Rezzolla 2016. This forces us to also pass both Mtov and the radius of the non-rotating Mtov stellar configuration along with the spin columns for the individual event posterior (and prior) samples. However, this is all optional, so users can still perform the (original) spin-independent inference.
summary of changes
For each file that has been modified, we briefly describe the (non-trivial) changes in the order in which they appear in the file
~/bin/mmax-model-selection
- added more command-line options to pass columns for spin effects. This includes
- --spin-column
- --rmax-column
- --prior-spin-column
- added more verbose help strings for options, declaring the expected units where appropriate
- added logic to extract spin values from event_samples
- fixed a typo in how we exponentiate weight columns for mmax_weights when --mmax-weight-is-log==True
- added logic to extract rmax from mmax samples. This is required to determine the compactness of the maximum-mass non-rotating stellar configuration (Cmax = Mmax/Rmax), which is needed as part of the spin inference (see Eqn 18 of Breu+Rezzolla 2016)
- printed the properties of the marginal distribution of spins
- added logic to extract spin values from event_prior_samples
- added a loop to compute prior weights from a population model in order to match what is done for the single-event posterior weights
- changed delegations to mmax_model_selection.utils to include spin data (spin, spin_prior, rmax)
~/mmax-model-selection/utils.py
- declared a few more default values
- declare a few more units (CGS, used to determine the compactness of stellar models)
- added kwargs for spin, rmax to weigh_mass_samples, weigh_mmax_samples
- we now scale Mtov based on the object's spin to estimate Mmax
- we also declare objects that are spinning faster than the the NS break-up frequency as "BHs"
- Note that this implies we are stretching the concept of "P(m2<Mmax)" a bit here, but it should still hold as long as we're clear that we implicitly define Mmax = Mmax(Mtov, Rtov, spin)
- changed weigh_mmax_samples to explicitly loop over the data rather than delegating to weigh_mass_samples. This was easier to figure out how to modify things based on the scalings with spin
- added function to compute the compactness, with appropriate unit conversions
- added function to estimate the break-up spin of a NS based on Eqn 17 of Breu+Rezzolla 2016
- added function to compute the scaling of Mmax(Mtov, Rtov, spin) based on Eqn 18 of Breu+Rezzolla 2016
- added spin kwargs to signatures of (and delegations within)
- _samples_2_prob
- _samples_2_bayes
- prob
- odds
- prob_odds
- bayes
- _prob_2_bayes
- post_prior_bayes
This patch also includes brief updates to a previously added plotting script, which does not affect the "main inference" within the library. Note, we may want to update this plotting script to produce visualizations of the spin inference, but that can wait until later.