Code owners
Assign users and groups as approvers for specific file changes. Learn more.
grid_options_descriptions.html 22.05 KiB
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Population grid code options — binary_c-python documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Binary_c parameters" href="binary_c_parameters.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> binary_c-python
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="readme_link.html">Python module for binary_c</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">Binarycpython code</a></li>
<li class="toctree-l1"><a class="reference internal" href="example_notebooks.html">Example notebooks</a></li>
<li class="toctree-l1"><a class="reference internal" href="binary_c_parameters.html">Binary_c parameters</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Population grid code options</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#public-options">Public options</a></li>
<li class="toctree-l2"><a class="reference internal" href="#moe-di-stefano-sampler-options">Moe & di Stefano sampler options</a></li>
<li class="toctree-l2"><a class="reference internal" href="#private-options">Private options</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python">Visit the GitLab repo</a></li>
<li class="toctree-l1"><a class="reference external" href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/issues/new">Submit an issue</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">binary_c-python</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>Population grid code options</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/grid_options_descriptions.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<style>
/* CSS overrides for sphinx_rtd_theme */
/* 24px margin */
.nbinput.nblast.container,
.nboutput.nblast.container {
margin-bottom: 19px; /* padding has already 5px */
}
/* ... except between code cells! */
.nblast.container + .nbinput.container {
margin-top: -19px;
}
.admonition > p:before {
margin-right: 4px; /* make room for the exclamation icon */
}
/* Fix math alignment, see https://github.com/rtfd/sphinx_rtd_theme/pull/686 */
.math {
text-align: unset;
}
</style>
<div class="section" id="population-grid-code-options">
<h1>Population grid code options<a class="headerlink" href="#population-grid-code-options" title="Permalink to this headline">¶</a></h1>
<p>The following chapter contains all grid code options, along with their descriptions
There are 3 options that are not described yet.</p>
<div class="section" id="public-options">
<h2>Public options<a class="headerlink" href="#public-options" title="Permalink to this headline">¶</a></h2>
<p>The following options are meant to be changed by the user.</p>
<div class="line-block">
<div class="line"><strong>C_auto_logging</strong>: Dictionary containing parameters to be logged by binary_c. The structure of this dictionary is as follows: the key is used as the headline which the user can then catch. The value at that key is a list of binary_c system parameters (like star[0].mass)</div>
</div>
<div class="line-block">
<div class="line"><strong>C_logging_code</strong>: Variable to store the exact code that is used for the custom_logging. In this way the user can do more complex logging, as well as putting these logging strings in files.</div>
</div>
<div class="line-block">
<div class="line"><strong>amt_cores</strong>: The amount of cores that the population grid will use. The multiprocessing is useful but make sure to figure out how many logical cores the machine has. The core is multi processed, not multi threaded, and will gain no extra speed when amt_cores exceeds the amount of logical cores. Input: int</div>
</div>
<div class="line-block">
<div class="line"><strong>combine_ensemble_with_thread_joining</strong>: Boolean flag on whether to combine everything and return it to the user or if false: write it to data_dir/ensemble_output_{population_id}_{thread_id}.json</div>
</div>
<div class="line-block">
<div class="line"><strong>condor</strong>: Int flag whether to use a condor type population evolution. Not implemented yet.</div>
</div>
<div class="line-block">
<div class="line"><strong>custom_generator</strong>: No description available yet</div>
</div>
<div class="line-block">
<div class="line"><strong>custom_logging_func_memaddr</strong>: Memory address where the custom_logging_function is stored. Input: int</div>
</div>
<div class="line-block">
<div class="line"><strong>do_dry_run</strong>: Whether to do a dry run to calculate the total probability for this run</div>
</div>
<div class="line-block">
<div class="line"><strong>ensemble_factor_in_probability_weighted_mass</strong>: Flag to multiply all the ensemble results with 1/probability_weighted_mass</div>
</div>
<div class="line-block">
<div class="line"><strong>evolution_type</strong>: Variable containing the type of evolution used of the grid. Multiprocessing or linear processing</div>
</div>
<div class="line-block">
<div class="line"><strong>failed_systems_threshold</strong>: Variable storing the maximum amount of systems that are allowed to fail before logging their command line arguments to failed_systems log files</div>
</div>
<div class="line-block">
<div class="line"><strong>gridcode_filename</strong>: Filename for the grid code. Set and used by the population object. TODO: allow the user to provide their own function, rather than only a generated function.</div>
</div>
<div class="line-block">
<div class="line"><strong>log_args</strong>: Boolean to log the arguments. Unused</div>
</div>
<div class="line-block">
<div class="line"><strong>log_args_dir</strong>: Directory to log the arguments to. Unused</div>
</div>
<div class="line-block">
<div class="line"><strong>log_dt</strong>: No description available yet</div>
</div>
<div class="line-block">
<div class="line"><strong>log_file</strong>: Log file for the population object. Unused</div>
</div>
<div class="line-block">
<div class="line"><strong>log_runtime_systems</strong>: Whether to log the runtime of the systems . Each systems run by the thread is logged to a file and is stored in the tmp_dir. (1 file per thread). Don’t use this if you are planning to run a lot of systems. This is mostly for debugging and finding systems that take long to run. Integer, default = 0. if value is 1 then the systems are logged</div>
</div>
<div class="line-block">
<div class="line"><strong>m&s_options</strong>: Internal variable that holds the M&S options. Don’t write to this your self</div>
</div>
<div class="line-block">
<div class="line"><strong>max_queue_size</strong>: Maximum size of the queue that is used to feed the processes. Don’t make this too big! Default: 1000. Input: int</div>
</div>
<div class="line-block">
<div class="line"><strong>modulo</strong>: No description available yet</div>
</div>
<div class="line-block">
<div class="line"><strong>multiplicity_fraction_function</strong>: Which multiplicity fraction function to use. 0: None, 1: Arenou 2010, 2: Rhagavan 2010, 3: M&S 2017</div>
</div>
<div class="line-block">
<div class="line"><strong>parse_function</strong>: Function that the user can provide to handle the output the binary_c. This function has to take the arguments (self, output). Its best not to return anything in this function, and just store stuff in the self.grid_results dictionary, or just output results to a file</div>
</div>
<div class="line-block">
<div class="line"><strong>repeat</strong>: Factor of how many times a system should be repeated. Consider the evolution splitting binary_c argument for supernovae kick repeating.</div>
</div>
<div class="line-block">
<div class="line"><strong>run_zero_probability_system</strong>: Whether to run the zero probability systems. Default: True. Input: Boolean</div>
</div>
<div class="line-block">
<div class="line"><strong>slurm</strong>: Int flag whether to use a Slurm type population evolution.</div>
</div>
<div class="line-block">
<div class="line"><strong>source_file_filename</strong>: Variable containing the source file containing lines of binary_c command line calls. These all have to start with binary_c.</div>
</div>
<div class="line-block">
<div class="line"><strong>tmp_dir</strong>: Directory where certain types of output are stored. The grid code is stored in that directory, as well as the custom logging libraries. Log files and other diagnostics will usually be written to this location, unless specified otherwise</div>
</div>
<div class="line-block">
<div class="line"><strong>verbosity</strong>: Verbosity of the population code. Default is 0, by which only errors will be printed. Higher values will show more output, which is good for debugging.</div>
</div>
<div class="line-block">
<div class="line"><strong>weight</strong>: Weight factor for each system. The calculated probability is multiplied by this. If the user wants each system to be repeated several times, then this variable should not be changed, rather change the _repeat variable instead, as that handles the reduction in probability per system. This is useful for systems that have a process with some random element in it.</div>
</div>
</div>
<div class="section" id="moe-di-stefano-sampler-options">
<h2>Moe & di Stefano sampler options<a class="headerlink" href="#moe-di-stefano-sampler-options" title="Permalink to this headline">¶</a></h2>
<p>The following options are meant to be changed by the user.</p>
<div class="line-block">
<div class="line"><strong>Mmin</strong>: Minimum stellar mass</div>
</div>
<div class="line-block">
<div class="line"><strong>multiplicity_model</strong>:
multiplicity model (as a function of log10M1)</div>
</div>
<blockquote>
<div><p>You can use ‘Poisson’ which uses the system multiplicity
given by Moe and maps this to single/binary/triple/quad
fractions.</p>
<p>Alternatively, ‘data’ takes the fractions directly
from the data, but then triples and quadruples are
combined (and there are NO quadruples).</p>
</div></blockquote>
<div class="line-block">
<div class="line"><strong>multiplicity_modulator</strong>:
[single, binary, triple, quadruple]</div>
</div>
<blockquote>
<div><dl class="simple">
<dt>e.g. [1,0,0,0] for single stars only</dt><dd><p>[0,1,0,0] for binary stars only</p>
</dd>
</dl>
<p>defaults to [1,1,0,0] i.e. singles and binaries</p>
</div></blockquote>
<div class="line-block">
<div class="line"><strong>normalize_multiplicities</strong>:
‘norm’: normalise so the whole population is 1.0
after implementing the appropriate fractions
S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q)
given a mix of multiplicities, you can either (noting that
here (S,B,T,Q) = appropriate modulator * model(S,B,T,Q) )
note: if you only set one multiplicity_modulator
to 1, and all the others to 0, then normalising
will mean that you effectively have the same number
of stars as single, binary, triple or quad (whichever
is non-zero) i.e. the multiplicity fraction is ignored.
This is probably not useful except for
testing purposes or comparing to old grids.</div>
</div>
<blockquote>
<div><dl>
<dt>‘raw’<span class="classifier">stick to what is predicted, i.e.</span></dt><dd><p>S/(S+B+T+Q), B/(S+B+T+Q), T/(S+B+T+Q), Q/(S+B+T+Q)
without normalisation
(in which case the total probability < 1.0 unless
all you use single, binary, triple and quadruple)</p>
</dd>
<dt>‘merge’<span class="classifier">e.g. if you only have single and binary,</span></dt><dd><p>add the triples and quadruples to the binaries, so
binaries represent all multiple systems
…
<strong>* this is canonical binary population synthesis *</strong></p>
<p>It only takes the maximum multiplicity into account,
i.e. it doesn’t multiply the resulting array by the multiplicity modulator again.
This prevents the resulting array to always be 1 if only 1 multiplicity modulator element is nonzero</p>
<p>Note: if multiplicity_modulator == [1,1,1,1]. this option does nothing (equivalent to ‘raw’).</p>
</dd>
</dl>
</div></blockquote>
<div class="line-block">
<div class="line"><strong>q_high_extrapolation_method</strong>: Same as q_low_extrapolation_method</div>
</div>
<div class="line-block">
<div class="line"><strong>q_low_extrapolation_method</strong>:
q extrapolation (below 0.15) method
none
flat
linear2
plaw2
nolowq</div>
</div>
<div class="line-block">
<div class="line"><strong>ranges</strong>:</div>
</div>
<div class="line-block">
<div class="line"><strong>resolutions</strong>:</div>
</div>
</div>
<div class="section" id="private-options">
<h2>Private options<a class="headerlink" href="#private-options" title="Permalink to this headline">¶</a></h2>
<p>The following options are not meant to be changed by the user, as these options are used and set internally by the object itself. The description still is provided, but just for documentation purposes.</p>
<div class="line-block">
<div class="line"><strong>_actually_evolve_system</strong>: Whether to actually evolve the systems of just act as if. for testing. used in _process_run_population_grid</div>
</div>
<div class="line-block">
<div class="line"><strong>_binary_c_config_executable</strong>: Full path of the binary_c-config executable. This options is not used in the population object.</div>
</div>
<div class="line-block">
<div class="line"><strong>_binary_c_dir</strong>: Director where binary_c is stored. This options are not really used</div>
</div>
<div class="line-block">
<div class="line"><strong>_binary_c_executable</strong>: Full path to the binary_c executable. This options is not used in the population object.</div>
</div>
<div class="line-block">
<div class="line"><strong>_binary_c_shared_library</strong>: Full path to the libbinary_c file. This options is not used in the population object</div>
</div>
<div class="line-block">
<div class="line"><strong>_commandline_input</strong>: String containing the arguments passed to the population object via the command line. Set and used by the population object.</div>
</div>
<div class="line-block">
<div class="line"><strong>_count</strong>: Counter tracking which system the generator is on.</div>
</div>
<div class="line-block">
<div class="line"><strong>_custom_logging_shared_library_file</strong>: filename for the custom_logging shared library. Used and set by the population object</div>
</div>
<div class="line-block">
<div class="line"><strong>_end_time_evolution</strong>: Variable storing the end timestamp of the population evolution. Set by the object itself</div>
</div>
<div class="line-block">
<div class="line"><strong>_errors_exceeded</strong>: Variable storing a Boolean flag whether the amount of errors was higher than the set threshold (failed_systems_threshold). If True, then the command line arguments of the failing systems will not be stored in the failed_system_log files.</div>
</div>
<div class="line-block">
<div class="line"><strong>_errors_found</strong>: Variable storing a Boolean flag whether errors by binary_c are encountered.</div>
</div>
<div class="line-block">
<div class="line"><strong>_evolution_type_options</strong>: List containing the evolution type options.</div>
</div>
<div class="line-block">
<div class="line"><strong>_failed_count</strong>: Variable storing the amount of failed systems.</div>
</div>
<div class="line-block">
<div class="line"><strong>_failed_prob</strong>: Variable storing the total probability of all the failed systems</div>
</div>
<div class="line-block">
<div class="line"><strong>_failed_systems_error_codes</strong>: List storing the unique error codes raised by binary_c of the failed systems</div>
</div>
<div class="line-block">
<div class="line"><strong>_grid_variables</strong>: Dictionary storing the grid_variables. These contain properties which are accessed by the _generate_grid_code function</div>
</div>
<div class="line-block">
<div class="line"><strong>_loaded_ms_data</strong>: Internal variable storing whether the M&S data has been loaded into memory</div>
</div>
<div class="line-block">
<div class="line"><strong>_main_pid</strong>: Main process ID of the master process. Used and set by the population object.</div>
</div>
<div class="line-block">
<div class="line"><strong>_population_id</strong>: Variable storing a unique 32-char hex string.</div>
</div>
<div class="line-block">
<div class="line"><strong>_probtot</strong>: Total probability of the population.</div>
</div>
<div class="line-block">
<div class="line"><strong>_set_ms_grid</strong>: Internal flag whether the M&S grid has been loaded</div>
</div>
<div class="line-block">
<div class="line"><strong>_start_time_evolution</strong>: Variable storing the start timestamp of the population evolution. Set by the object itself.</div>
</div>
<div class="line-block">
<div class="line"><strong>_store_memaddr</strong>: Memory address of the store object for binary_c.</div>
</div>
<div class="line-block">
<div class="line"><strong>_system_generator</strong>: Function object that contains the system generator function. This can be from a grid, or a source file, or a Monte Carlo grid.</div>
</div>
<div class="line-block">
<div class="line"><strong>_total_mass_run</strong>: To count the total mass that thread/process has ran</div>
</div>
<div class="line-block">
<div class="line"><strong>_total_probability_weighted_mass_run</strong>: To count the total mass * probability for each system that thread/process has ran</div>
</div>
<div class="line-block">
<div class="line"><strong>_total_starcount</strong>: Variable storing the total amount of systems in the generator. Used and set by the population object.</div>
</div>
<div class="line-block">
<div class="line"><strong>_zero_prob_stars_skipped</strong>: Internal counter to track how many systems are skipped because they have 0 probability</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="binary_c_parameters.html" class="btn btn-neutral float-left" title="Binary_c parameters" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2021, David Hendriks, Robert Izzard
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<br><br>
Generated on binarycpython git branch: feature/generate_docs_script git revision 0f58dd203c24f702f57f121654a664d6d0eed555 url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python/-/tree/feature/generate_docs_script">git url</a>.
<br><br>
Using binary_c with bit branch branch_david: git revision: "5702:20211026:243a29ee7" url: <a href="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c/-/tree/branch_david">git url</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>