multidim

class cosmic.sample.sampler.multidim.MultiDim

Bases: object

initial_sample(self, 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)

Sample initial binary distribution according to Moe & Di Stefano (2017) <http://adsabs.harvard.edu/abs/2017ApJS..230…15M>`_

Parameters

M1min : float

minimum primary mass to sample [Msun] DEFAULT: 0.08

M2min : float

minimum secondary mass to sample [Msun] DEFAULT: 0.08

M1max : float

maximum primary mass to sample [Msun] DEFAULT: 150.0

M2max : float

maximum primary mass to sample [Msun] DEFAULT: 150.0

porb_lo : float

minimum orbital period to sample [log10(days)]

porb_hi : float

maximum orbital period to sample [log10(days)]

rand_seed : int

random seed generator DEFAULT: 0

size : int, optional

number of evolution times to sample NOTE: this is set in cosmic-pop call as Nstep

Returns

primary_mass_list : array

array of primary masses with size=size

secondary_mass_list : array

array of secondary masses with size=size

porb_list : array

array of orbital periods in days with size=size

ecc_list : array

array of eccentricities with size=size

mass_singles : float

Total mass in single stars needed to generate population

mass_binaries : float

Total mass in binaries needed to generate population

n_singles : int

Number of single stars needed to generate a population

n_binaries : int

Number of binaries needed to generate a population

binfrac_list : array

array of binary probabilities based on primary mass and period with size=size

sample_SFH(self, SF_start=13700.0, SF_duration=0.0, met=0.02, size=None)

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_start : float

Time in the past when star formation initiates in Myr

SF_duration : float

Duration of constant star formation beginning from SF_Start in Myr

met : float

metallicity of the population [Z_sun = 0.02] Default: 0.02

size : int, optional

number of evolution times to sample NOTE: this is set in cosmic-pop call as Nstep

Returns

tphys : array

array of evolution times of size=size

metallicity : array

array of metallicities

set_kstar(self, mass)

Initialize stellar types according to BSE classification kstar=1 if M>=0.7 Msun; kstar=0 if M<0.7 Msun

Parameters

mass : array

array of masses

Returns

kstar : array

array of initial stellar types

cosmic.sample.sampler.multidim.get_multidim_sampler(final_kstar1, final_kstar2, rand_seed, nproc, SF_start, SF_duration, met, size, **kwargs)

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_kstar1 : list or int

Int or list of final kstar1

final_kstar2 : list or int

Int or list of final kstar2

rand_seed : int

Int to seed random number generator

nproc : int

Number of processors to use to generate population

SF_start : float

Time in the past when star formation initiates in Myr

SF_duration : float

Duration of constant star formation beginning from SF_Start in Myr

met : float

Sets the metallicity of the binary population where solar metallicity is 0.02

size : int

Size of the population to sample

**porb_lo : float

Lower limit in days for the orbital period distribution

**porb_hi: `float`

Upper limit in days for the orbital period distribution

Returns

InitialBinaryTable : pandas.DataFrame

DataFrame in the format of the InitialBinaryTable

mass_singles : float

Total mass in single stars needed to generate population

mass_binaries : float

Total mass in binaries needed to generate population

n_singles : int

Number of single stars needed to generate a population

n_binaries : int

Number of binaries needed to generate a population