multidim
- class cosmic.sample.sampler.multidim.MultiDim[source]¶
Bases:
object- initial_sample(M1min=0.08, M2min=0.08, M1max=150.0, M2max=150.0, porb_lo=0.15, porb_hi=8.0, rand_seed=0, size=None, nproc=1, pool=None, mp_seeds=None)[source]¶
Sample initial binary distribution according to Moe & Di Stefano (2017) <http://adsabs.harvard.edu/abs/2017ApJS..230…15M>`_
- Parameters:
- M1minfloat
minimum primary mass to sample [Msun] DEFAULT: 0.08
- M2minfloat
minimum secondary mass to sample [Msun] DEFAULT: 0.08
- M1maxfloat
maximum primary mass to sample [Msun] DEFAULT: 150.0
- M2maxfloat
maximum primary mass to sample [Msun] DEFAULT: 150.0
- porb_lofloat
minimum orbital period to sample [log10(days)]
- porb_hifloat
maximum orbital period to sample [log10(days)]
- rand_seedint
random seed generator DEFAULT: 0
- sizeint, optional
number of evolution times to sample NOTE: this is set in cosmic-pop call as Nstep
- Returns:
- primary_mass_listarray
array of primary masses with size=size
- secondary_mass_listarray
array of secondary masses with size=size
- porb_listarray
array of orbital periods in days with size=size
- ecc_listarray
array of eccentricities with size=size
- single_mass_listarray
array of mass of single stars
- mass_singlesfloat
Total mass in single stars needed to generate population
- mass_binariesfloat
Total mass in binaries needed to generate population
- n_singlesint
Number of single stars needed to generate a population
- n_binariesint
Number of binaries needed to generate a population
- binfrac_listarray
array of binary probabilities based on primary mass and period with size=size
- sample_SFH(SF_start=13700.0, SF_duration=0.0, met=0.02, size=None)[source]¶
Sample an evolution time for each binary based on a user-specified time at the start of star formation and the duration of star formation. The default is a burst of star formation 13,700 Myr in the past.
- Parameters:
- SF_startfloat
Time in the past when star formation initiates in Myr
- SF_durationfloat
Duration of constant star formation beginning from SF_Start in Myr
- metfloat
metallicity of the population [Z_sun = 0.02] Default: 0.02
- sizeint, optional
number of evolution times to sample NOTE: this is set in cosmic-pop call as Nstep
- Returns:
- tphysarray
array of evolution times of size=size
- metallicityarray
array of metallicities
- cosmic.sample.sampler.multidim.get_multidim_sampler(final_kstar1, final_kstar2, rand_seed, nproc, SF_start, SF_duration, met, size, **kwargs)[source]¶
adapted version of Maxwell Moe’s IDL code that generates a population of single and binary stars
Below is the adapted version of Maxwell Moe’s IDL code that generates a population of single and binary stars based on the paper Mind your P’s and Q’s By Maxwell Moe and Rosanne Di Stefano
The python code has been adopted by Mads Sørensen
Version history: V. 0.1; 2017/02/03 By Mads Sørensen - This is a pure adaption from IDL to Python. - The function idl_tabulate is similar to the IDL function int_tabulated except, this function seems to be slightly more exact in its solution. Therefore, relative to the IDL code, there are small numerical differences.
Comments below beginning with ; is the original nodes by Maxwell Moe. Please read these careful for understanding the script. ; NOTE - This version produces only the statistical distributions of ; single stars, binaries, and inner binaries in hierarchical triples. ; Outer tertiaries in hierarchical triples are NOT generated. ; Moreover, given a set of companions, all with period P to ; primary mass M1, this version currently uses an approximation to ; determine the fraction of those companions that are inner binaries ; vs. outer triples. Nevertheless, this approximation reproduces ; the overall multiplicity statistics. ; Step 1 - Tabulate probably density functions of periods, ; mass ratios, and eccentricities based on ; analytic fits to corrected binary star populations. ; Step 2 - Implement Monte Carlo method to generate stellar ; population from those density functions.
- Parameters:
- final_kstar1list or int
Int or list of final kstar1
- final_kstar2list or int
Int or list of final kstar2
- rand_seedint
Int to seed random number generator
- nprocint
Number of processors to use to generate population
- SF_startfloat
Time in the past when star formation initiates in Myr
- SF_durationfloat
Duration of constant star formation beginning from SF_Start in Myr
- metfloat
Sets the metallicity of the binary population where solar metallicity is 0.02
- sizeint
Size of the population to sample
- **porb_lofloat
Lower limit in days for the orbital period distribution
- **porb_hi: `float`
Upper limit in days for the orbital period distribution
- Returns:
- InitialBinaryTablepandas.DataFrame
DataFrame in the format of the InitialBinaryTable
- mass_singlesfloat
Total mass in single stars needed to generate population
- mass_binariesfloat
Total mass in binaries needed to generate population
- n_singlesint
Number of single stars needed to generate a population
- n_binariesint
Number of binaries needed to generate a population