cosmic-popsynth 3.5.0__tar.gz → 3.6.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/workflows/build_wheels_and_publish.yml +2 -2
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/PKG-INFO +1 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/bin/cosmic-pop +92 -42
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/changelog.md +6 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/cosmic-settings.json +4 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/evolve/evolve_sample.rst +2 -2
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/fixedpop.rst +9 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/sample/independent.rst +4 -4
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/sample/multidim.rst +4 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/meson.build +1 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/pyproject.toml +1 -1
- cosmic_popsynth-3.6.1/src/cosmic/_version.py +1 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/evolve.py +1 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/initialcmctable.py +4 -3
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/sampler/cmc.py +1 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/sampler/independent.py +5 -3
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/sampler/multidim.py +24 -15
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/comenv.f +35 -20
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/kick.f +51 -17
- cosmic_popsynth-3.6.1/src/cosmic/tests/test_kick.py +92 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/test_sample.py +10 -10
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/utils.py +47 -4
- cosmic_popsynth-3.5.0/src/cosmic/_version.py +0 -1
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.codecov.yml +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.gitattributes +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/ISSUE_TEMPLATE/general_issue.md +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/ISSUE_TEMPLATE/unexpected-stellar-evolutionary-behavior.md +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/workflows/deploy-github-pages.yml +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/workflows/github_registory.yml +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/workflows/python-package.yml +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.gitignore +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.readthedocs.yml +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.vscode/launch.json +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.vscode/tasks.json +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/Dockerfile +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/LICENSE +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/MANIFEST.in +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/README.md +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/ci/compile_benchmark.sh +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/ci/run-tests.sh +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/debug/create_binary_in.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/Makefile +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/_static/bootstrap-grid.min.css +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/_static/cosmic-docs.css +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/_static/custom.js +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/_static/settings.js +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/_templates/layout.html +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/conf.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/create_params_ini.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/create_settings_html.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/data/dat_DeltaBurst_13_14_13_14.h5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/data/qcrit_table.csv +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/index.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/about.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/cite.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/config/README.md +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/config/config_insert_bse.html +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/config/config_insert_convergence.html +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/config/config_insert_filters.html +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/config/config_insert_rand_seed.html +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/config/config_insert_sampling.html +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/adding-options.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/debugging-vscode.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/how-it-works.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/new-settings.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/option-schema.csv +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/setting-schema.csv +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/develop/settings-json-file.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/developers.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/evolve/grid.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/evolve/multiple.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/evolve/resolution.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/evolve/restart.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/evolve/single.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/examples.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/inifile.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/install.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/output_info.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/reference_material.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/runpop.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/docs/pages/sample/cluster.rst +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/examples/CMC_Params.ini +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/examples/Params.ini +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/requirements.txt +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/Match.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/__init__.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/bse_utils/__init__.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/bse_utils/meson.build +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/bse_utils/zcnsts.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/bse_utils/zdata.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/checkstate.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/filter.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/get_commit_hash.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/meson.build +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/plotting.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/__init__.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/cmc/__init__.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/cmc/elson.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/cmc/king.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/cmc/meson.build +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/initialbinarytable.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/meson.build +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/sampler/__init__.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/sampler/meson.build +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/sample/sampler/sampler.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/Makefile +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/assign_remnant.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/benchmarkevolv2.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/bpp_array.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/bse.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/checkstate.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/checkstate.h +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/comprad.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/concatkstars.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/const_bse.h +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/corerd.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/deltat.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/dgcore.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/evolv1.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/evolv2.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/gntage.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/hrdiag.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/hrdiag_remnant.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/instar.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/int64.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/int64.h +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/int64.h.in +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/mix.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/mlwind.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/mrenv.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/ran3.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/rl.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/sse.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/star.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/taus113-ran3.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/taus113tester.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/tausworth.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/tausworth.h +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/test_bse.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/zcnsts.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/zdata.h +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/src/zfuncs.f +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/GW_dat.h5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/Kroupa93.npy +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/Params.ini +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/bpp_array_ind_sampling.npy +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/cmc_elson_test.npz +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/cmc_king_test.npz +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/cmc_plummer_test.npz +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/dat_ThinDisk_10_12_10_12.h5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/dat_ThinDisk_11_11_3.h5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/init_conditions_ind_sampling.npy +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/initial_conditions_for_testing.hdf5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/input_cmc.fits +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/input_cmc.hdf5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/kick_initial_conditions.h5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/unit_test_results.hdf5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/unit_tests_results.hdf5 +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/data/utils_test.hdf +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/meson.build +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/test_evolve.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/test_match.py +0 -0
- {cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/src/cosmic/tests/test_utils.py +0 -0
{cosmic_popsynth-3.5.0 → cosmic_popsynth-3.6.1}/.github/workflows/build_wheels_and_publish.yml
RENAMED
|
@@ -6,7 +6,7 @@ on:
|
|
|
6
6
|
workflow_dispatch:
|
|
7
7
|
|
|
8
8
|
env:
|
|
9
|
-
CIBW_BUILD: "cp39-* cp310-*"
|
|
9
|
+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
|
|
10
10
|
CIBW_ARCHS_LINUX: "x86_64"
|
|
11
11
|
CIBW_SKIP: "*-win32 *musllinux*"
|
|
12
12
|
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
strategy:
|
|
21
21
|
matrix:
|
|
22
22
|
os: [ubuntu-latest, macos-latest]
|
|
23
|
-
python-version: [3.9, "3.10"]
|
|
23
|
+
python-version: [3.9, "3.10", "3.11", "3.12"]
|
|
24
24
|
|
|
25
25
|
steps:
|
|
26
26
|
- uses: actions/checkout@v4
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cosmic-popsynth
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.6.1
|
|
4
4
|
Summary: a Python-interfaced binary population synthesis suite
|
|
5
5
|
Author: Scott Coughlin, Michael Zevin, Carl L. Rodriguez, Tom Wagg
|
|
6
6
|
Author-Email: Katelyn Breivik <katie.breivik@gmail.com>
|
|
@@ -11,29 +11,24 @@
|
|
|
11
11
|
##############################################################################
|
|
12
12
|
# IMPORT ALL NECESSARY PYTHON PACKAGES
|
|
13
13
|
##############################################################################
|
|
14
|
-
from collections import OrderedDict
|
|
15
|
-
import warnings
|
|
16
14
|
import argparse
|
|
17
15
|
import schwimmbad
|
|
18
16
|
|
|
19
|
-
import math
|
|
20
|
-
import random
|
|
21
17
|
import time
|
|
22
18
|
from time import sleep
|
|
23
|
-
import string
|
|
24
|
-
import os.path
|
|
25
19
|
import json
|
|
26
20
|
|
|
27
21
|
import numpy as np
|
|
28
|
-
import scipy.special as ss
|
|
29
22
|
import pandas as pd
|
|
23
|
+
from pandas.errors import PerformanceWarning
|
|
30
24
|
import warnings
|
|
31
25
|
|
|
32
26
|
from cosmic.sample.initialbinarytable import InitialBinaryTable
|
|
33
27
|
from cosmic import Match, utils
|
|
34
28
|
from cosmic.evolve import Evolve
|
|
35
29
|
|
|
36
|
-
from schwimmbad import
|
|
30
|
+
from schwimmbad import MPIPool
|
|
31
|
+
from os import sys
|
|
37
32
|
|
|
38
33
|
def str2bool(v):
|
|
39
34
|
if isinstance(v, bool):
|
|
@@ -243,10 +238,12 @@ if __name__ == '__main__':
|
|
|
243
238
|
kstar2_range = args.final_kstar2
|
|
244
239
|
kstar2_range_string = str(int(args.final_kstar2[0]))
|
|
245
240
|
|
|
241
|
+
dat_store_fname = 'dat_kstar1_{0}_kstar2_{1}_SFstart_{2}_SFduration_{3}_metallicity_{4}.h5'.format(kstar1_range_string, kstar2_range_string, sampling['SF_start'], sampling['SF_duration'], sampling['metallicity'])
|
|
246
242
|
# Open the hdf5 file to store the fixed population data
|
|
247
243
|
try:
|
|
248
|
-
|
|
249
|
-
|
|
244
|
+
with pd.HDFStore(dat_store_fname,complib=args.complib,complevel=args.complevel) as dat_store:
|
|
245
|
+
# If the file exists, we will read it and continue from where we left off
|
|
246
|
+
conv_save = pd.read_hdf(dat_store, 'conv')
|
|
250
247
|
log_file = open('log_kstar1_{0}_kstar2_{1}_SFstart_{2}_SFduration_{3}_metallicity_{4}.txt'.format(kstar1_range_string, kstar2_range_string, sampling['SF_start'], sampling['SF_duration'], sampling['metallicity']), 'a')
|
|
251
248
|
log_file.write('There are already: '+str(conv_save.shape[0])+' '+kstar1_range_string+'_'+kstar2_range_string+' binaries evolved\n')
|
|
252
249
|
log_file.write('\n')
|
|
@@ -258,8 +255,8 @@ if __name__ == '__main__':
|
|
|
258
255
|
total_n_stars = np.max(pd.read_hdf(dat_store, 'n_stars'))[0]
|
|
259
256
|
idx = int(np.max(pd.read_hdf(dat_store, 'idx'))[0])
|
|
260
257
|
except:
|
|
258
|
+
#dat_store = pd.HDFStore('dat_kstar1_{0}_kstar2_{1}_SFstart_{2}_SFduration_{3}_metallicity_{4}.h5'.format(kstar1_range_string, kstar2_range_string, sampling['SF_start'], sampling['SF_duration'], sampling['metallicity']),complib=args.complib,complevel=args.complevel)
|
|
261
259
|
conv_save = pd.DataFrame()
|
|
262
|
-
dat_store = pd.HDFStore('dat_kstar1_{0}_kstar2_{1}_SFstart_{2}_SFduration_{3}_metallicity_{4}.h5'.format(kstar1_range_string, kstar2_range_string, sampling['SF_start'], sampling['SF_duration'], sampling['metallicity']),complib=args.complib,complevel=args.complevel)
|
|
263
260
|
total_mass_singles = 0
|
|
264
261
|
total_mass_binaries = 0
|
|
265
262
|
total_mass_stars = 0
|
|
@@ -273,10 +270,14 @@ if __name__ == '__main__':
|
|
|
273
270
|
configuration_settings = {'BSEDict' : BSEDict, 'filters' : filters,
|
|
274
271
|
'convergence' : convergence, 'sampling' : sampling}
|
|
275
272
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
273
|
+
with warnings.catch_warnings():
|
|
274
|
+
warnings.simplefilter(action="ignore", category=PerformanceWarning)
|
|
275
|
+
|
|
276
|
+
with pd.HDFStore(dat_store_fname,complib=args.complib,complevel=args.complevel) as dat_store:
|
|
277
|
+
for k, v in configuration_settings.items():
|
|
278
|
+
for k1, v1 in v.items():
|
|
279
|
+
dat_store.put('config/{0}/{1}/'.format(k, k1), pd.Series(v1))
|
|
280
|
+
dat_store.put('config/rand_seed/', pd.Series(seed_int))
|
|
280
281
|
|
|
281
282
|
# Initialize the step counter and convergence array/list
|
|
282
283
|
Nstep = idx - np.mod(idx, args.Nstep)
|
|
@@ -304,6 +305,9 @@ if __name__ == '__main__':
|
|
|
304
305
|
|
|
305
306
|
# Select the initial binary sample method from user input
|
|
306
307
|
if sampling['sampling_method'] == 'independent':
|
|
308
|
+
if hasattr(args,'qmin') and hasattr(args,'m2_min'):
|
|
309
|
+
raise ValueError("You cannot specify both qmin and m2_min in the inifile if you are using the independent sampler. Please choose one or the other.")
|
|
310
|
+
# If qmin is specified, use it to sample the initial binary table
|
|
307
311
|
if hasattr(args,'qmin'):
|
|
308
312
|
init_samp_list = InitialBinaryTable.sampler(format_ = sampling['sampling_method'],
|
|
309
313
|
final_kstar1 = kstar1_range,
|
|
@@ -319,6 +323,7 @@ if __name__ == '__main__':
|
|
|
319
323
|
size = args.Nstep,
|
|
320
324
|
qmin = args.qmin,
|
|
321
325
|
params = args.inifile)
|
|
326
|
+
# if m2_min is specified, use it to sample the initial binary table
|
|
322
327
|
elif hasattr(args,'m2_min'):
|
|
323
328
|
init_samp_list = InitialBinaryTable.sampler(format_ = sampling['sampling_method'],
|
|
324
329
|
final_kstar1 = kstar1_range,
|
|
@@ -343,14 +348,15 @@ if __name__ == '__main__':
|
|
|
343
348
|
init_samp_list = InitialBinaryTable.sampler(format_ = sampling['sampling_method'],
|
|
344
349
|
final_kstar1 = kstar1_range,
|
|
345
350
|
final_kstar2 = kstar2_range,
|
|
346
|
-
keep_singles = args.keep_singles,
|
|
347
351
|
rand_seed = rand_seed,
|
|
348
352
|
nproc = args.nproc,
|
|
349
353
|
SF_start = sampling['SF_start'],
|
|
350
354
|
SF_duration = sampling['SF_duration'],
|
|
351
355
|
met = sampling['metallicity'],
|
|
352
356
|
size = args.Nstep,
|
|
353
|
-
pool=pool
|
|
357
|
+
pool=pool,
|
|
358
|
+
keep_singles = args.keep_singles
|
|
359
|
+
)
|
|
354
360
|
IBT, mass_singles, mass_binaries, n_singles, n_binaries = init_samp_list
|
|
355
361
|
|
|
356
362
|
# Log the total sampled mass from the initial binary sample
|
|
@@ -387,17 +393,33 @@ if __name__ == '__main__':
|
|
|
387
393
|
dtp=dtp,
|
|
388
394
|
timestep_conditions=filters['timestep_conditions'])
|
|
389
395
|
|
|
396
|
+
# extract single stars
|
|
397
|
+
|
|
398
|
+
if (args.keep_singles==True):
|
|
399
|
+
singles_bin_num = initCond.loc[initCond.kstar_2 == 15].bin_num.unique()
|
|
400
|
+
# get the singles from the bcm and bpp arrays
|
|
401
|
+
bcm_singles = bcm.loc[bcm.bin_num.isin(singles_bin_num)]
|
|
402
|
+
bpp_singles = bpp.loc[bpp.bin_num.isin(singles_bin_num)]
|
|
403
|
+
initCond_singles = initCond.loc[initCond.bin_num.isin(singles_bin_num)]
|
|
404
|
+
kick_info_singles = kick_info.loc[kick_info.bin_num.isin(singles_bin_num)]
|
|
405
|
+
|
|
406
|
+
bpp = bpp.loc[~bpp.bin_num.isin(singles_bin_num)]
|
|
407
|
+
bcm = bcm.loc[~bcm.bin_num.isin(singles_bin_num)]
|
|
408
|
+
initCond = initCond.loc[~initCond.bin_num.isin(singles_bin_num)]
|
|
409
|
+
kick_info = kick_info.loc[~kick_info.bin_num.isin(singles_bin_num)]
|
|
390
410
|
# get any nans and pull them out for now
|
|
391
411
|
nans = np.isnan(bpp.sep)
|
|
392
412
|
if nans.any():
|
|
393
413
|
nan_bin_nums = np.unique(bpp[nans]["bin_num"].values)
|
|
394
414
|
initCond_nan = initCond.loc[initCond.bin_num.isin(nan_bin_nums)]
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
log_file.write(f"
|
|
415
|
+
with pd.HDFStore(dat_store_fname,complib=args.complib,complevel=args.complevel) as dat_store:
|
|
416
|
+
if pd.__version__<="2.0.0":
|
|
417
|
+
dat_store.append("nan_initC", initCond_nan)
|
|
418
|
+
else:
|
|
419
|
+
dat_store["nan_initC"] = initCond_nan
|
|
420
|
+
log_file.write(f"There are {len(nan_bin_nums)} NaNs stored in the datfile with key: 'nan_initC'\n")
|
|
421
|
+
log_file.write(f"You might want to check them out carefully to see if there is something that impacts your results\n")
|
|
422
|
+
#log_file.write(f"These NaNs likely arise because you have pts1 = 0.001, try running with pts1 = 0.01")
|
|
401
423
|
|
|
402
424
|
bcm = bcm.loc[~bcm.bin_num.isin(nan_bin_nums)]
|
|
403
425
|
bpp = bpp.loc[~bpp.bin_num.isin(nan_bin_nums)]
|
|
@@ -410,6 +432,8 @@ if __name__ == '__main__':
|
|
|
410
432
|
# If dtp is not set, filter out first timestep in bcm
|
|
411
433
|
if np.all(dtp == IBT['tphysf'].values):
|
|
412
434
|
bcm = bcm.loc[bcm['tphys'].isin(dtp)]
|
|
435
|
+
if (args.keep_singles==True):
|
|
436
|
+
bcm_singles = bcm_singles.loc[bcm_singles['tphys'].isin(dtp)]
|
|
413
437
|
|
|
414
438
|
# Now get the converging population and bin_nums for conv systems whic
|
|
415
439
|
# satisfy the convergence_limits
|
|
@@ -417,6 +441,9 @@ if __name__ == '__main__':
|
|
|
417
441
|
kstar1_range, kstar2_range,
|
|
418
442
|
convergence['pop_select'],
|
|
419
443
|
convergence['convergence_limits'])
|
|
444
|
+
if (args.keep_singles==True):
|
|
445
|
+
conv_singles_filter = utils.conv_select_singles(bcm_singles, bpp_singles, kstar1_range)
|
|
446
|
+
|
|
420
447
|
if conv_filter.empty:
|
|
421
448
|
warnings.warn("After filtering for desired convegence systems there were no systems matching your request. It is possible you are suggesting incompatible bin_state choices and pop_select, e.g. bin_state=[0,1], pop_select='disruption'")
|
|
422
449
|
log_file.write("After filtering for desired convegence systems there were no systems matching your request. It is possible you are suggesting incompatible bin_state choices and pop_select, e.g. bin_state=[0,1], pop_select='disruption'")
|
|
@@ -426,6 +453,12 @@ if __name__ == '__main__':
|
|
|
426
453
|
initC_filter = initCond.loc[initCond.bin_num.isin(conv_filter.bin_num)]
|
|
427
454
|
kick_info_filter = kick_info.loc[kick_info.bin_num.isin(conv_filter.bin_num)]
|
|
428
455
|
|
|
456
|
+
if (args.keep_singles==True):
|
|
457
|
+
bpp_singles_filter = bpp_singles.loc[bpp_singles.bin_num.isin(conv_singles_filter.bin_num)]
|
|
458
|
+
bcm_singles_filter = bcm_singles.loc[bcm_singles.bin_num.isin(conv_singles_filter.bin_num)]
|
|
459
|
+
initC_singles_filter = initCond_singles.loc[initCond_singles.bin_num.isin(conv_singles_filter.bin_num)]
|
|
460
|
+
kick_info_singles_filter = kick_info_singles.loc[kick_info_singles.bin_num.isin(conv_singles_filter.bin_num)]
|
|
461
|
+
|
|
429
462
|
# Filter the bin_state based on user specified filters
|
|
430
463
|
bcm_filter, bin_state_nums = utils.filter_bin_state(bcm_filter, bpp_filter, filters, kstar1_range, kstar2_range)
|
|
431
464
|
if bcm_filter.empty:
|
|
@@ -444,19 +477,17 @@ if __name__ == '__main__':
|
|
|
444
477
|
conv_filter = conv_filter.loc[conv_filter.bin_num.isin(conv_lims_bin_num)]
|
|
445
478
|
|
|
446
479
|
# Filter the bcm and bpp arrays according to user specified filters
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
conv_filter_match = pd.concat([conv_filter_match,conv_filter.loc[conv_filter.bin_num.isin(conv_lims_bin_num)]], ignore_index=True)
|
|
459
|
-
|
|
480
|
+
bcm_filter_match = bcm_filter.copy()
|
|
481
|
+
bpp_filter_match = bpp_filter.copy()
|
|
482
|
+
initC_filter_match = initC_filter.copy()
|
|
483
|
+
conv_filter_match = conv_filter.copy()
|
|
484
|
+
kick_info_filter_match = kick_info_filter.copy()
|
|
485
|
+
if (args.keep_singles==True):
|
|
486
|
+
conv_singles_filter_match = conv_singles_filter.copy()
|
|
487
|
+
bpp_singles_filter_match = bpp_singles_filter.copy()
|
|
488
|
+
bcm_singles_filter_match = bcm_singles_filter.copy()
|
|
489
|
+
initC_filter_singles_match = initC_singles_filter.copy()
|
|
490
|
+
kick_info_singles_filter_match = kick_info_singles_filter.copy()
|
|
460
491
|
|
|
461
492
|
if len(conv_filter_match) >= np.min([50, args.Niter]):
|
|
462
493
|
conv_save = pd.concat([conv_save, pd.DataFrame(conv_filter_match)], ignore_index=True)
|
|
@@ -478,9 +509,20 @@ if __name__ == '__main__':
|
|
|
478
509
|
# write the data and the logs!
|
|
479
510
|
mass_list = [total_mass_singles, total_mass_binaries, total_mass_stars]
|
|
480
511
|
n_list = [total_n_singles, total_n_binaries, total_n_stars]
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
512
|
+
|
|
513
|
+
# write the data to the dat_store
|
|
514
|
+
with pd.HDFStore(dat_store_fname,complib=args.complib,complevel=args.complevel) as dat_store:
|
|
515
|
+
if (args.keep_singles==True):
|
|
516
|
+
utils.pop_write(dat_store, log_file, mass_list, n_list, bcm_filter_match,
|
|
517
|
+
bpp_filter_match, initC_filter_match, conv_filter_match, kick_info_filter_match,
|
|
518
|
+
bin_state_nums, match_save, idx,
|
|
519
|
+
conv_singles=conv_singles_filter_match, bcm_singles=bcm_singles_filter_match,
|
|
520
|
+
bpp_singles=bpp_singles_filter_match, initC_singles=initC_filter_singles_match,
|
|
521
|
+
kick_info_singles=kick_info_singles_filter_match)
|
|
522
|
+
else:
|
|
523
|
+
utils.pop_write(dat_store, log_file, mass_list, n_list, bcm_filter_match,
|
|
524
|
+
bpp_filter_match, initC_filter_match, conv_filter_match, kick_info_filter_match,
|
|
525
|
+
bin_state_nums, match_save, idx)
|
|
484
526
|
|
|
485
527
|
# reset the bcm_filter DataFrame
|
|
486
528
|
bcm_filter_match = []
|
|
@@ -488,12 +530,20 @@ if __name__ == '__main__':
|
|
|
488
530
|
initC_filter_match = []
|
|
489
531
|
conv_filter_match = []
|
|
490
532
|
kick_info_filter_match = []
|
|
533
|
+
if (args.keep_singles==True):
|
|
534
|
+
conv_singles_filter_match = []
|
|
535
|
+
bpp_singles_filter_match = []
|
|
536
|
+
bcm_singles_filter_match = []
|
|
537
|
+
initC_filter_singles_match = []
|
|
538
|
+
kick_info_singles_filter_match = []
|
|
491
539
|
log_file.write('\n')
|
|
492
540
|
Nstep += args.Nstep
|
|
493
541
|
log_file.flush()
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
542
|
+
|
|
543
|
+
# close the log file and print the final message
|
|
497
544
|
log_file.write('All done friend!')
|
|
498
545
|
log_file.close()
|
|
499
546
|
|
|
547
|
+
pool.close()
|
|
548
|
+
pool.join()
|
|
549
|
+
|
|
@@ -49,4 +49,9 @@ See the discussed changes in our previous releases here: https://github.com/COSM
|
|
|
49
49
|
- Bug fix: Changed `kick.f` to use the Pfahl+02 kick prescription by default instead of Kiel & Hurley 2009, this fixes ejection velocities of secondaries and also changed kick_info to have an extra column
|
|
50
50
|
|
|
51
51
|
## 3.6.0
|
|
52
|
-
- Overhaul documentation and added debugging environment
|
|
52
|
+
- Overhaul documentation and added debugging environment
|
|
53
|
+
- Feature: Added Disberg+2025 kick prescription as a new choice of `kickflag` (`kickflag=5`). Applies log-normal distribution to regular CCSN, ECSN/USSN still use `sigmadiv` Maxwellian and BH fallback scaling is still applied via `bhflag` and `bhsigmafrac` as with `kickflag=1`
|
|
54
|
+
|
|
55
|
+
## 3.6.1
|
|
56
|
+
- Add support for single stars in both independent and multidim sampling
|
|
57
|
+
- update documentation
|
|
@@ -845,6 +845,10 @@
|
|
|
845
845
|
"name": 4,
|
|
846
846
|
"description": "Natal kicks are drawn according to Eq. 1 of <a class='reference external' href='https://ui.adsabs.harvard.edu/abs/2016MNRAS.461.3747B/abstract'>Bray & Eldridge 2016</a>, with their default parameters (\\(\\alpha=70 \\, {\\rm km/s}, \\beta = 120 \\, {\\rm km/s)}"
|
|
847
847
|
},
|
|
848
|
+
{
|
|
849
|
+
"name": 5,
|
|
850
|
+
"description": "Follows the same prescription as 1, but uses the kick prescription described in <a class='reference external' href='https://ui.adsabs.harvard.edu/abs/2025arXiv250522102D/abstract'>Disberg & Mandel 2025</a> for CCSN."
|
|
851
|
+
},
|
|
848
852
|
{
|
|
849
853
|
"name": "negative values",
|
|
850
854
|
"description": "Same as above settings but using the old Kiel & Hurley 2009 prescription for changing the orbital configuration of the binary, available for reproducibility purposes but not recommended for new work"
|
|
@@ -27,8 +27,8 @@ about the independent sampler in the :ref:`independent` page.
|
|
|
27
27
|
...: InitialBinaryTable.sampler('independent', final_kstars, final_kstars,
|
|
28
28
|
...: binfrac_model=0.5, primary_model='kroupa01',
|
|
29
29
|
...: ecc_model='sana12', porb_model='sana12',
|
|
30
|
-
...: qmin=-1,
|
|
31
|
-
...: SF_duration=0.0, met=0.02, size=10)
|
|
30
|
+
...: qmin=-1, SF_start=13700.0,
|
|
31
|
+
...: SF_duration=0.0, met=0.02, size=10, keep_singles=True)
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
And finally, we can evolve the initial binary population using the Evolve class as we've done in the previous
|
|
@@ -92,7 +92,15 @@ The fixed population contains several pandas DataFrames accessed by the followin
|
|
|
92
92
|
|
|
93
93
|
* ``kick_info`` : The magnitude and direction of natal kicks, three dimensional systemic velocity changes, total tilt of orbital plane, and azimuthal angle of orbital angular momentum axis with respect to spins
|
|
94
94
|
|
|
95
|
-
* ``
|
|
95
|
+
* ``initC`` : The initial conditions for each binary which satisfies the user-specified final kstars and filter in the ``convergence`` subsection
|
|
96
|
+
|
|
97
|
+
* ``bpp_singles`` : The evolutionary history of single stars which satisfy the user-specified final kstars and filter in the ``convergence`` subsection
|
|
98
|
+
|
|
99
|
+
* ``bcm_singles`` : The final state of single stars in the bcm array which satisfy the user-specified final kstars and filter in the ``convergence`` subsection
|
|
100
|
+
|
|
101
|
+
* ``kick_info_singles`` : The magnitude and direction of natal kicks, three dimensional systemic velocity changes, total tilt of orbital plane, and azimuthal angle of orbital angular momentum axis with respect to spins
|
|
102
|
+
|
|
103
|
+
* ``initC_singles`` : The initial conditions for each single star which satisfies the user-specified final kstars and filter in the ``convergence`` subsection
|
|
96
104
|
|
|
97
105
|
* ``idx`` : An integer that keeps track of the total number of simulated binaries to maintain proper indexing across several runs of ``cosmic-pop``
|
|
98
106
|
|
|
@@ -47,9 +47,9 @@ If you don't want to filter the binaries, you can supply final kstars as
|
|
|
47
47
|
|
|
48
48
|
In [6]: final_kstars = np.linspace(0, 14, 15)
|
|
49
49
|
|
|
50
|
-
In [7]: InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler('independent', final_kstars, final_kstars, binfrac_model=0.5, primary_model='kroupa01', ecc_model='sana12', porb_model='sana12', qmin=-1,
|
|
50
|
+
In [7]: InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler('independent', final_kstars, final_kstars, binfrac_model=0.5, primary_model='kroupa01', ecc_model='sana12', porb_model='sana12', qmin=-1, SF_start=13700.0, SF_duration=0.0, met=0.02, size=10000)
|
|
51
51
|
|
|
52
|
-
Additionally if you are interested in single stars then you can specify ``keep_singles=True``.
|
|
52
|
+
Additionally if you are interested in single stars then you can specify ``keep_singles=True``. In this case, the singles will be added onto the end of the InitialBinaryTable where ``kstar_1`` will host the singles, ``kstar_2`` will be filled with 15s only, and all orbital properties (e.g. ``porb`` or ``ecc``) will be indicated with -1.
|
|
53
53
|
|
|
54
54
|
Understanding parameter sampling models
|
|
55
55
|
=======================================
|
|
@@ -76,7 +76,7 @@ Using the final kstar inputs we mentioned above, the initial binary population c
|
|
|
76
76
|
|
|
77
77
|
.. ipython::
|
|
78
78
|
|
|
79
|
-
In [9]: InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler('independent', final_kstar1, final_kstar2, binfrac_model=0.5, primary_model='kroupa01', ecc_model='sana12', porb_model='sana12', qmin=-1,
|
|
79
|
+
In [9]: InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler('independent', final_kstar1, final_kstar2, binfrac_model=0.5, primary_model='kroupa01', ecc_model='sana12', porb_model='sana12', qmin=-1, SF_start=13700.0, SF_duration=0.0, met=0.02, size=10000)
|
|
80
80
|
|
|
81
81
|
In [10]: print(InitialBinaries)
|
|
82
82
|
|
|
@@ -95,7 +95,7 @@ Alternatively, we could do the same thing but now instead set our ``sampling_tar
|
|
|
95
95
|
|
|
96
96
|
.. ipython::
|
|
97
97
|
|
|
98
|
-
In [10]: InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler('independent', final_kstar1, final_kstar2, binfrac_model=0.5, primary_model='kroupa01', ecc_model='sana12', porb_model='sana12', qmin=-1,
|
|
98
|
+
In [10]: InitialBinaries, mass_singles, mass_binaries, n_singles, n_binaries = InitialBinaryTable.sampler('independent', final_kstar1, final_kstar2, binfrac_model=0.5, primary_model='kroupa01', ecc_model='sana12', porb_model='sana12', qmin=-1, SF_start=13700.0, SF_duration=0.0, met=0.02, sampling_target="total_mass", total_mass=15000)
|
|
99
99
|
|
|
100
100
|
In [11]: print(InitialBinaries)
|
|
101
101
|
|
|
@@ -33,3 +33,7 @@ The multidimensional sample is generated as follows:
|
|
|
33
33
|
|
|
34
34
|
NOTE that in the multidimensional case, the binary fraction is a parameter in the sample. This results in the size of the initial binary data matching the size provided to the sampler. As in the independent sampling case, we keep track of the total sampled mass of singles and binaries as well as the total number of single and binary stars to scale the simulated population to astrophysical populations.
|
|
35
35
|
|
|
36
|
+
.. note::
|
|
37
|
+
|
|
38
|
+
NOTE that you can also keep singles for the multidim sampelr as well. As with the independent sampler, the singles will be added onto the end of the InitialBinaryTable where ``kstar_1`` will host the singles, ``kstar_2`` will be filled with 15s only, and all orbital properties (e.g. ``porb`` or ``ecc``) will be indicated with -1.
|
|
39
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.6.1"
|
|
@@ -46,7 +46,7 @@ __credits__ = ['Katelyn Breivik <katie.breivik@gmail.com>',
|
|
|
46
46
|
__all__ = ['Evolve']
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
# Make this match the ordering of all_cols in bpp_array.f
|
|
50
50
|
ALL_COLUMNS = ['tphys', 'mass_1', 'mass_2', 'kstar_1', 'kstar_2', 'sep', 'porb',
|
|
51
51
|
'ecc', 'RRLO_1', 'RRLO_2', 'evol_type', 'aj_1', 'aj_2', 'tms_1',
|
|
52
52
|
'tms_2', 'massc_1', 'massc_2', 'rad_1', 'rad_2', 'mass0_1',
|
|
@@ -332,9 +332,10 @@ class InitialCMCTable(pd.DataFrame):
|
|
|
332
332
|
)
|
|
333
333
|
singles = pd.concat([singles, Singles])
|
|
334
334
|
singles = pd.concat([singles, singles_bottom])
|
|
335
|
-
|
|
336
|
-
singles["r"]
|
|
337
|
-
singles
|
|
335
|
+
|
|
336
|
+
singles.iloc[-1, singles.columns.get_loc("r")] = 1e40
|
|
337
|
+
singles.iloc[0, singles.columns.get_loc("r")] = 2.2250738585072014e-308
|
|
338
|
+
singles.iloc[0, singles.columns.get_loc("m")] = Singles.central_bh
|
|
338
339
|
|
|
339
340
|
# Add a special row to the end of Bianries table
|
|
340
341
|
binaries = pd.DataFrame(
|
|
@@ -231,7 +231,7 @@ def get_cmc_sampler(
|
|
|
231
231
|
singles_table.metallicity = met
|
|
232
232
|
binaries_table.metallicity = met
|
|
233
233
|
singles_table.virial_radius = kwargs.get("virial_radius",1)
|
|
234
|
-
singles_table.tidal_radius = kwargs.get("tidal_radius",
|
|
234
|
+
singles_table.tidal_radius = kwargs.get("tidal_radius",1e6)
|
|
235
235
|
singles_table.central_bh = kwargs.get("central_bh",0)
|
|
236
236
|
singles_table.scale_with_central_bh = kwargs.get("scale_with_central_bh",False)
|
|
237
237
|
singles_table.mass_of_cluster = np.sum(singles_table["m"]) + singles_table.central_bh
|
|
@@ -343,7 +343,7 @@ def get_independent_sampler(
|
|
|
343
343
|
np.ones_like(mass1_singles) * 15, # kstar2 (all massless remnants)
|
|
344
344
|
metallicity_singles, # metallicity
|
|
345
345
|
)
|
|
346
|
-
binary_table = pd.concat([binary_table, singles_table])
|
|
346
|
+
binary_table = pd.concat([binary_table, singles_table], ignore_index=True)
|
|
347
347
|
else:
|
|
348
348
|
binary_table = InitialBinaryTable.InitialBinaries(
|
|
349
349
|
mass1_binary,
|
|
@@ -362,7 +362,7 @@ def get_independent_sampler(
|
|
|
362
362
|
m_sampled_singles,
|
|
363
363
|
m_sampled_binaries,
|
|
364
364
|
n_singles,
|
|
365
|
-
n_binaries
|
|
365
|
+
n_binaries
|
|
366
366
|
)
|
|
367
367
|
|
|
368
368
|
|
|
@@ -505,7 +505,6 @@ class Sample(object):
|
|
|
505
505
|
sampled secondary masses with array size matching size of
|
|
506
506
|
primary_mass
|
|
507
507
|
"""
|
|
508
|
-
|
|
509
508
|
qmin = kwargs["qmin"] if "qmin" in kwargs.keys() else 0.0
|
|
510
509
|
m1_min = kwargs["m1_min"] if "m1_min" in kwargs.keys() else 0.08
|
|
511
510
|
m2_min = kwargs["m2_min"] if "m2_min" in kwargs.keys() else None
|
|
@@ -515,6 +514,9 @@ class Sample(object):
|
|
|
515
514
|
raise ValueError("The m2_min you specified is above the minimum"
|
|
516
515
|
" primary mass of the IMF, either lower m2_min or"
|
|
517
516
|
" raise the lower value of your sampled primaries")
|
|
517
|
+
|
|
518
|
+
if (m2_min is not None) & (qmin != 0):
|
|
519
|
+
raise ValueError("You cannot specify both m2_min and qmin, please choose one or the other")
|
|
518
520
|
|
|
519
521
|
# --- `msort` kwarg can be set to have different qmin above `msort`
|
|
520
522
|
msort = kwargs["msort"] if "msort" in kwargs.keys() else None
|
|
@@ -25,6 +25,7 @@ from .. import InitialBinaryTable
|
|
|
25
25
|
from ... import utils
|
|
26
26
|
|
|
27
27
|
import numpy as np
|
|
28
|
+
import pandas as pd
|
|
28
29
|
|
|
29
30
|
__author__ = "Katelyn Breivik <katie.breivik@gmail.com>"
|
|
30
31
|
__credits__ = "Scott Coughlin <scott.coughlin@ligo.org>"
|
|
@@ -146,6 +147,7 @@ def get_multidim_sampler(
|
|
|
146
147
|
mass2_binary,
|
|
147
148
|
porb,
|
|
148
149
|
ecc,
|
|
150
|
+
single_mass_list,
|
|
149
151
|
mass_singles,
|
|
150
152
|
mass_binaries,
|
|
151
153
|
n_singles,
|
|
@@ -174,7 +176,7 @@ def get_multidim_sampler(
|
|
|
174
176
|
metallicity[metallicity < 1e-4] = 1e-4
|
|
175
177
|
metallicity[metallicity > 0.03] = 0.03
|
|
176
178
|
|
|
177
|
-
if kwargs.pop("keep_singles",
|
|
179
|
+
if kwargs.pop("keep_singles", True):
|
|
178
180
|
binary_table = InitialBinaryTable.InitialBinaries(
|
|
179
181
|
mass1_binary,
|
|
180
182
|
mass2_binary,
|
|
@@ -187,22 +189,22 @@ def get_multidim_sampler(
|
|
|
187
189
|
binfrac=binfrac,
|
|
188
190
|
)
|
|
189
191
|
tphysf, metallicity = initconditions.sample_SFH(
|
|
190
|
-
SF_start=SF_start, SF_duration=SF_duration, met=met, size=
|
|
192
|
+
SF_start=SF_start, SF_duration=SF_duration, met=met, size=single_mass_list.size
|
|
191
193
|
)
|
|
192
194
|
metallicity[metallicity < 1e-4] = 1e-4
|
|
193
195
|
metallicity[metallicity > 0.03] = 0.03
|
|
194
|
-
kstar1 = initconditions.set_kstar(
|
|
196
|
+
kstar1 = initconditions.set_kstar(single_mass_list)
|
|
195
197
|
singles_table = InitialBinaryTable.InitialBinaries(
|
|
196
|
-
|
|
197
|
-
np.ones_like(
|
|
198
|
-
np.ones_like(
|
|
199
|
-
np.ones_like(
|
|
198
|
+
single_mass_list,
|
|
199
|
+
np.ones_like(single_mass_list)*0,
|
|
200
|
+
np.ones_like(single_mass_list)*-1,
|
|
201
|
+
np.ones_like(single_mass_list)*-1,
|
|
200
202
|
tphysf,
|
|
201
203
|
kstar1,
|
|
202
|
-
np.ones_like(
|
|
204
|
+
np.ones_like(single_mass_list)*15, # # kstar2 is not used for singles
|
|
203
205
|
metallicity,
|
|
204
206
|
)
|
|
205
|
-
binary_table =
|
|
207
|
+
binary_table = pd.concat([binary_table, singles_table], ignore_index=True)
|
|
206
208
|
else:
|
|
207
209
|
binary_table = InitialBinaryTable.InitialBinaries(
|
|
208
210
|
mass1_binary,
|
|
@@ -321,6 +323,8 @@ class MultiDim:
|
|
|
321
323
|
array of orbital periods in days with size=size
|
|
322
324
|
ecc_list : array
|
|
323
325
|
array of eccentricities with size=size
|
|
326
|
+
single_mass_list : array
|
|
327
|
+
array of mass of single stars
|
|
324
328
|
mass_singles : `float`
|
|
325
329
|
Total mass in single stars needed to generate population
|
|
326
330
|
mass_binaries : `float`
|
|
@@ -360,7 +364,7 @@ class MultiDim:
|
|
|
360
364
|
worker = Worker()
|
|
361
365
|
results = list(pool.map(worker, inputs))
|
|
362
366
|
|
|
363
|
-
dat_lists = [[], [], [], [], [], [], [], [], []]
|
|
367
|
+
dat_lists = [[], [], [], [], [], [], [], [], [], []]
|
|
364
368
|
|
|
365
369
|
for output_list in results:
|
|
366
370
|
ii = 0
|
|
@@ -372,17 +376,19 @@ class MultiDim:
|
|
|
372
376
|
secondary_mass_list = np.hstack(dat_lists[1])
|
|
373
377
|
porb_list = np.hstack(dat_lists[2])
|
|
374
378
|
ecc_list = np.hstack(dat_lists[3])
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
379
|
+
single_mass_list = np.hstack(dat_lists[4])
|
|
380
|
+
mass_singles = np.sum(dat_lists[5])
|
|
381
|
+
mass_binaries = np.sum(dat_lists[6])
|
|
382
|
+
n_singles = np.sum(dat_lists[7])
|
|
383
|
+
n_binaries = np.sum(dat_lists[8])
|
|
384
|
+
binfrac_list = np.hstack(dat_lists[9])
|
|
380
385
|
|
|
381
386
|
return (
|
|
382
387
|
primary_mass_list,
|
|
383
388
|
secondary_mass_list,
|
|
384
389
|
porb_list,
|
|
385
390
|
ecc_list,
|
|
391
|
+
single_mass_list,
|
|
386
392
|
mass_singles,
|
|
387
393
|
mass_binaries,
|
|
388
394
|
n_singles,
|
|
@@ -773,6 +779,7 @@ class Worker(object):
|
|
|
773
779
|
n_binaries = 0
|
|
774
780
|
primary_mass_list = []
|
|
775
781
|
secondary_mass_list = []
|
|
782
|
+
single_mass_list = []
|
|
776
783
|
porb_list = []
|
|
777
784
|
ecc_list = []
|
|
778
785
|
binfrac_list = []
|
|
@@ -857,6 +864,7 @@ class Worker(object):
|
|
|
857
864
|
mass_binaries += myq * myM1
|
|
858
865
|
n_binaries += 1
|
|
859
866
|
else:
|
|
867
|
+
single_mass_list.append(myM1)
|
|
860
868
|
mass_singles += myM1
|
|
861
869
|
n_singles += 1
|
|
862
870
|
|
|
@@ -865,6 +873,7 @@ class Worker(object):
|
|
|
865
873
|
secondary_mass_list,
|
|
866
874
|
porb_list,
|
|
867
875
|
ecc_list,
|
|
876
|
+
single_mass_list,
|
|
868
877
|
mass_singles,
|
|
869
878
|
mass_binaries,
|
|
870
879
|
n_singles,
|