get_multidim_sampler

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