Evolve

class cosmic.evolve.Evolve[source]

Bases: object

initialize Evolve

Methods Summary

evolve(initialbinarytable[, pool, ...])

After setting a number of initial conditions we evolve the system.

Methods Documentation

classmethod evolve(initialbinarytable, pool=None, bpp_columns=None, bcm_columns=None, dt_mass_modifiers=[(40, 70, 0.3), (70, inf, 0.1)], **kwargs)[source]

After setting a number of initial conditions we evolve the system.

Parameters:
initialbinarytableDataFrame

Initial conditions of the binary

poolMultiprocessing pool

Pool of workers to use to evolve systems in parallel

bpp_columnslist, optional, default: None

Columns to save in the bpp table (key evolutionary stage table)

bcm_columnslist, optional, default: None

Columns to save in the bcm table (detailed evolution table)

dt_modifierslist of tuples, optional, default: [(40, 70, 0.3), (70, np.inf, 0.1)]

List of tuples specifying the mass ranges and corresponding modifiers for the timestep size. Our recommended default improves the numerical stability at higher masses. Each tuple should be of the form (m_low, m_high, mod) and will modify the default timestep by a factor of mod for systems with a primary mass in the range m_low <= mass_1 < m_high. For example, (40, 70, 0.3) would multiply the default timestep size by 0.3 for systems with primary mass between [40, 70) solar masses. We apply the modifier to the pts1, pts2, and pts3 parameters which control the timestep size in different evolutionary phases. These changes are logged in the initial conditions table so you can keep track of which systems had their timesteps modified. Avoid overlapping mass ranges for different modifiers as this will result in multiple modifiers being applied in the overlap region. NOTE: these modifiers are only applied to columns which aren’t present in the initialbinarytable that is passed in (i.e. they only modify values provided by a BSEDict or params.ini file)

**kwargs:

There are three ways to tell evolve and thus the fortran what you want all the flags and other BSE specific parameters to be. If you pass both a dictionary of flags and/or a inifile and a table with the BSE parameters in the columns, the column values will be overwritten by what is in the dictionary or ini file.

NUMBER 1: PASS A DICTIONARY OF FLAGS

BSEDict

NUMBER 2: PASS A PANDAS DATA FRAME WITH PARAMS DEFINED AS COLUMNS

All you need is the initialbinarytable if the all the BSE parameters are defined as columns

NUMBER 3: PASS PATH TO A INI FILE WITH THE FLAGS DEFINED

params

You can also add a progress bar by setting: progress=True

randomseedint, optional, default let numpy choose for you

If you would like the random seed that the underlying fortran code uses to be the same for all of the initial conditions you passed then you can send this keyword argument in. It is recommended to just let numpy choose a random number as the Fortran random seed and then this number will be returned as a column in the initial binary table so that you can reproduce the results.

nprocint, optional, default: 1

number of CPUs to use to evolve systems in parallel

idxint, optional, default: 0

initial index of the bcm/bpp arrays

dtpfloat, optional: default: tphysf

timestep size in Myr for bcm output where tphysf is total evolution time in Myr

n_per_blockint, optional, default: -1

number of systems to evolve in a block with _evolve_multi_system, to allow larger multiprocessing queues and reduced overhead. If less than 1 use _evolve_single_system

Returns:
output_bpppandas.DataFrame

Table of key evolutionary stages for each binary

output_bcmpandas.DataFrame

Table of detailed evolution for each binary

initialbinarytableDataFrame

Initial conditions for each binary