COSMIC-PopSynth / COSMIC

COSMIC (Compact Object Synthesis and Monte Carlo Investigation Code)
GNU General Public License v3.0
46 stars 58 forks source link

changes to the independent sampler #505

Closed carlrodriguez closed 3 years ago

carlrodriguez commented 3 years ago

Somewhat large commit that still needs some testing, but is pretty critical for CMC. Two major changes to the independent sampler:

  1. Adds a new flag to the independent sampler, sample_porb_first, which if true will sample the orbital periods before the eccentricities. This is somewhat necessary to prevent pathologically large eccentricities (e=0.999) that will come from the thermal distribution, and often place stars inside one another. This breaks CMC, but is also unphysical for isolated binaries. If this option is selected, the radii for Roche Lobe overflow are still computed with the orbits, but they are returned and used to truncate the eccentricity distribution (if it is not selected, then the eccentricities are sampled first, and the orbital periods are selected s.t. none of them are in Roche Lobe overflow)
  2. I have changed it to where the minimum distribution for all the period distributions is set by the RL overflow criterion, not just the log-uniform option. For the Sana12 distribution, it takes the maximum of the RL overflow criterion and the minimum of the actual distribution from Sana.
carlrodriguez commented 3 years ago

Oh and third big change: I added another option, set_radii_with_BSE, that when True will use BSE to compute the radii for the Roche Lobe in the independent sampler. This is basically the same option that we were using in the IC generators for CMC, but I figured it was smarter to port it over to the independent sampler.