Utility functions (utils)¶
The utils module contains utility functions for use with COSMIC.
utils
Functions¶
|
Filter the output of bpp and bcm, where the kstar ranges have already been selected by the conv_select module |
|
Select bcm data for special convergence cases |
|
Select a minimum and maximum mass to filter out binaries in the initial parameter sample to reduce the number of unneccessary binaries evolved in BSE |
|
Function that replicates the IDL int_tabulated function which performs a p-point integration on a tabulated set of data |
|
Power-law generator for pdf(x)propto x^{g} for a<=x<=b |
|
Transforms a data set to limits between zero and one Leaves some wiggle room on the edges of the data set |
|
Transform a data set to have limits between zero and one using param_transform, then transform to log space |
|
Un-transform data that was transformed in dat_transform |
|
Selects the kde bandwidth using Knuth's rule implemented in Astropy If Knuth's rule raises error, Scott's rule is used |
|
Checks that values in BSEDict, SSEDict,filters, and convergence are viable |
Checks initial conditions and reports warnings |
|
Provides way to convert integer values to their string counterpart |
|
|
Provides a method for parsing the inifile and returning dicts of each section |
|
Writes all the good stuff that you want to save from runFixedPop in a |
|
Computes the separation from orbital period with KEPLER III |
|
Computes separation from orbital period with kepler III |
|
Converts from FeH to Z under the assumption that all stars have the same abundance as the sun |
|
Converts from Z to FeH under the assumption that all stars have the same abundance as the sun |
Calculates the theoretical binary fraction as a function of metallicity. |
|
|
Returns normalization constants to produce log normals consistent with Fig 19 of Moe+19 for the orbital period distribution |
|
Returns a population-wide binary fraction consistent with Moe+19 based on the supplied metallicity |
|
Returns the path to the METISSE files |
|
Read a metallicity namelist |
|
Read the format file associated with the metallicity namelist |
|
|
|
|
|
Read all EEP files in a directory matching the given pattern |
|
Convert Python list of strings to NumPy array of fixed-length strings for F2PY. |
|
Provides explanation for a BSE setting from the cosmic-settings.json file |