cmc

class cosmic.sample.sampler.cmc.CMCSample[source]

Bases: Sample

calc_porb_max(mass, vr, vt, binary_index, mass1_binary, mass2_binary, **kwargs)[source]
set_r_vr_vt(cluster_profile, **kwargs)[source]
cosmic.sample.sampler.cmc.get_cmc_sampler(cluster_profile, primary_model, ecc_model, porb_model, binfrac_model, met, size, **kwargs)[source]

Generates an initial cluster sample according to user specified models

Parameters:
cluster_profilestr

Model to use for the cluster profile (i.e. sampling of the placement of objects in the cluster and their velocity within the cluster) Options include: ‘plummer’ : Standard Plummer sphere.

Additional parameters: ‘r_max’ : float

the maximum radius (in virial radii) to sample the clsuter

‘elson’EFF 1987 profile. Generalization of Plummer that better fits young massive clusters

Additional parameters: ‘gamma’ : float

steepness paramter for Elson profile; note that gamma=4 is same is Plummer

‘r_max’float

the maximum radius (in virial radii) to sample the clsuter

‘king’King profile
‘w_0’float

King concentration parameter

‘r_max’float

the maximum radius (in virial radii) to sample the clsuter

primary_modelstr

Model to sample primary mass; choices include: kroupa93, kroupa01, salpeter55, custom if ‘custom’ is selected, must also pass arguemts: alphas : array

list of power law indicies

mcutsarray

breaks in the power laws.

e.g. alphas=[-1.3,-2.3,-2.3],mcuts=[0.08,0.5,1.0,150.] reproduces standard Kroupa2001 IMF

ecc_modelstr

Model to sample eccentricity; choices include: thermal, uniform, sana12

porb_modelstr

Model to sample orbital period; choices include: log_uniform, sana12, renzo19, raghavan10, moe19, martinez26

msortfloat

Stars with M>msort can have different pairing and sampling of companions

pairfloat

Sets the pairing of stars M>msort only with stars with M>msort

binfrac_modelstr or float

Model for binary fraction; choices include: vanHaaften, offner23, or a fraction where 1.0 is 100% binaries

binfrac_model_msortstr or float

Same as binfrac_model for M>msort

qminfloat

kwarg which sets the minimum mass ratio for sampling the secondary where the mass ratio distribution is flat in q if q > 0, qmin sets the minimum mass ratio q = -1, this limits the minimum mass ratio to be set such that the pre-MS lifetime of the secondary is not longer than the full lifetime of the primary if it were to evolve as a single star

m2_minfloat

kwarg which sets the minimum secondary mass for sampling the secondary as uniform in mass_2 between m2_min and mass_1

qmin_msortfloat

Same as qmin for M>msort; only applies if qmin is supplied

metfloat

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

sizeint

Size of the population to sample

zsunfloat

optional kwarg for setting effective radii, default is 0.02

Returns:
Singles: pandas.DataFrame

DataFrame of Single objects in the format of the InitialCMCTable

Binaries: pandas.DataFrame

DataFrame of Single objects in the format of the InitialCMCTable