Skip to content

Backport Disberg & Mandel 2025 Kick Prescription to METISSE-integrate#708

Closed
d-maclean wants to merge 48 commits into
COSMIC-PopSynth:developfrom
d-maclean:METISSE-integrate
Closed

Backport Disberg & Mandel 2025 Kick Prescription to METISSE-integrate#708
d-maclean wants to merge 48 commits into
COSMIC-PopSynth:developfrom
d-maclean:METISSE-integrate

Conversation

@d-maclean

Copy link
Copy Markdown
Contributor

This is a simple PR that cherry-picks @TomWagg's implementation of the Disberg & Mandel kick prescription into the METISSE-integrate branch. This pull also proposes bumping the minor version to 3.5.1 and notes the addition in the changes.

Examples of the new kicks in action for a population of neutron stars, featuring SSE & METISSE:
NS kicks SSE 06-29-25 positive

NS kicks METISSE 06-29-25 positive

I think it's worth noting somewhere that these new kicks are not usable with kickflag < 0, as the Kiel & Hurley 2009 subroutine doesn't include these changes. If there is demand to add this to the old kick options, I could see to that as well. :)

poojanagrawal and others added 30 commits June 4, 2024 12:21
* modified COSMIC to use the setup for METISSE

* METISSE integration is complete

* moved assign_commons_COSMIC.f90 to COSMIC src dir
* added METISSE as submodule

* try ssedict for one test
* trying to add git submodules to actions

* splitting alphas and accretion limits for primary and secondary

* forgot to add cosnt

* fixing SSEDict columns in initial binary table

* add in correct gfortran compilation

* fixing benchmark to work with SSE, removing repeated compilation arguments

* fixing tests with SSEDict

* add ignore back in

* fix tests and remove SSEDict from setreff for now
* METISSE now returns error instead of stopping the code

* added back meson.build and .gitignore

* updated metisse

* removed print statement
* replaced warning command when path_he_tracks is not provided

* fix tests for he tracks

---------

Co-authored-by: Katie Breivik <kbreivik@andrew.cmu.edu>
Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>
…ts) (COSMIC-PopSynth#657)

* offner22 primary mass dependent binary fraction (COSMIC-PopSynth#644)

* added offner22 primary mass dependent binary fraction

* pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from)

* pinned numpy version so 3.7 works

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>

* Update utils.py (COSMIC-PopSynth#648)

* Update utils.py

fix trapezoid import

* Update utils.py

missed one trapz

* version bump and dropping below python3.9 (COSMIC-PopSynth#653)

* version bump and dropping below python3.9

* forward to numpy 1.26.0

* trying a different version

* fix trapz import

* Update build_wheels_and_publish.yml

explicitly install gcc

* Update build_wheels_and_publish.yml

trying to fix gfortran

* Update build_wheels_and_publish.yml

specifying path with symlink, checking path

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#654)

* Update build_wheels_and_publish.yml

* Update _version.py

* Update meson.build

* Update pyproject.toml (COSMIC-PopSynth#655)

* Version bump for pip (COSMIC-PopSynth#656)

* Update meson.build

* Update _version.py

---------

Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com>
* removed need to add backslash at the end of paths for metisse

* modified utils to raise error instead of warning if metallicity files are not found in path_to_he_tracks

* modified path for METISSE from ssh to https
…PopSynth#658)

* offner22 primary mass dependent binary fraction (COSMIC-PopSynth#644)

* added offner22 primary mass dependent binary fraction

* pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from)

* pinned numpy version so 3.7 works

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>

* Update utils.py (COSMIC-PopSynth#648)

* Update utils.py

fix trapezoid import

* Update utils.py

missed one trapz

* version bump and dropping below python3.9 (COSMIC-PopSynth#653)

* version bump and dropping below python3.9

* forward to numpy 1.26.0

* trying a different version

* fix trapz import

* Update build_wheels_and_publish.yml

explicitly install gcc

* Update build_wheels_and_publish.yml

trying to fix gfortran

* Update build_wheels_and_publish.yml

specifying path with symlink, checking path

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#654)

* Update build_wheels_and_publish.yml

* Update _version.py

* Update meson.build

* Update pyproject.toml (COSMIC-PopSynth#655)

* Version bump for pip (COSMIC-PopSynth#656)

* Update meson.build

* Update _version.py

---------

Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com>
* offner22 primary mass dependent binary fraction (COSMIC-PopSynth#644)

* added offner22 primary mass dependent binary fraction

* pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from)

* pinned numpy version so 3.7 works

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>

* Update utils.py (COSMIC-PopSynth#648)

* Update utils.py

fix trapezoid import

* Update utils.py

missed one trapz

* version bump and dropping below python3.9 (COSMIC-PopSynth#653)

* version bump and dropping below python3.9

* forward to numpy 1.26.0

* trying a different version

* fix trapz import

* Update build_wheels_and_publish.yml

explicitly install gcc

* Update build_wheels_and_publish.yml

trying to fix gfortran

* Update build_wheels_and_publish.yml

specifying path with symlink, checking path

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#654)

* Update build_wheels_and_publish.yml

* Update _version.py

* Update meson.build

* Update pyproject.toml (COSMIC-PopSynth#655)

* Version bump for pip (COSMIC-PopSynth#656)

* Update meson.build

* Update _version.py

* Add power law sampling options for ``porb`` and ``q`` (COSMIC-PopSynth#651)

* add `q_power_law` parameter to change the power law of the mass ratio distribution

* allow custom power laws for orbital periods

* add mass ratio sampling test

* add test for custom porb power laws

* add to changelog

* New ``gamma`` option for circumbinary discs (COSMIC-PopSynth#652)

* add new gamma prescription, add some int() statements

* add  details to docs page

* update ini files

* * Modifying the init file to include the commit hash. (COSMIC-PopSynth#659)

*Created get_commit_hash file that finds the commit hash.

*Modified the meson.build file to run get_commit_hash when cosmic is installed.

* Created maximum wall time option (COSMIC-PopSynth#620)

* Added compression options for pandas

* Created maximum wall time argument

* Add debugging setup, avoid NaNs from timestep issue (COSMIC-PopSynth#647)

* setup debugging environment

* ignore a bunch of files

* add a testing fortran script

* move debugging to its own folder

* add a python script for creating the input

* add a simple makefile for testing

* important change: use `loop` instead of `1000` for timestep condition

* add a note about settings

* clean up vscode setup

* I can't count 🙃

* added new test suite location

* fixing numpy pinned version

* forcing numpy version I guess

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>
Co-authored-by: Katie Breivik <kbreivik@andrew.cmu.edu>

* allow a gamma of -3 in error_check (COSMIC-PopSynth#661)

* fixing wheel build for pypi, hopefully

* tiny version bump (COSMIC-PopSynth#665)

* Update _version.py

* Update pyproject.toml

add @TomWagg as dev

* Update meson.build

bump version

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

removing gfortran symlink

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#666)

* Update build_wheels_and_publish.yml

* this should be a working build.

* add meson to requirements

* Fixing linux only wheel  (COSMIC-PopSynth#667)

* Update build_wheels_and_publish.yml

* adding in python versions

* Update build_wheels_and_publish.yml

* Update meson.build

* Update meson.build

* Update pyproject.toml

* Pip fix (COSMIC-PopSynth#669)

* add DS_Store to ignore

* finalllllly got the platform specific wheels built with a pure: false

* tiny bump in version for tag

* Update build_wheels_and_publish.yml

need to repair linux build with cibuildwheel for PyPI

* Update meson.build

forgot to bump version here

* build wheels and publish fix (COSMIC-PopSynth#670)

* pins cibuildwheel==2.17.0 so that we can build across macOS versions.
* allow push to pypi

* add x_86 and arch compatibility for wheels (COSMIC-PopSynth#671)

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

* Update meson.build version

* Update _version.py version

* Update pyproject.toml version

* Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (COSMIC-PopSynth#672)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com>
Co-authored-by: Tom Wagg <tomjwagg@gmail.com>
Co-authored-by: elenagonzalez870 <52000594+elenagonzalez870@users.noreply.github.com>
Co-authored-by: Vera Eris Del Favero <77068792+xevra@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: duncan_m <duncan_m@ajax.wireless-1x.unc.edu>
* updated METISSE

* added 'SSEDict' to cosmic-pop binary

---------

Co-authored-by: duncan_m <duncan_m@ajax.wireless-1x.unc.edu>
* offner22 primary mass dependent binary fraction (COSMIC-PopSynth#644)

* added offner22 primary mass dependent binary fraction

* pinning numpy version because of new numpy version released on june 16 (https://stackoverflow.com/questions/78634235/numpy-dtype-size-changed-may-indicate-binary-incompatibility-expected-96-from)

* pinned numpy version so 3.7 works

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>

* Update utils.py (COSMIC-PopSynth#648)

* Update utils.py

fix trapezoid import

* Update utils.py

missed one trapz

* version bump and dropping below python3.9 (COSMIC-PopSynth#653)

* version bump and dropping below python3.9

* forward to numpy 1.26.0

* trying a different version

* fix trapz import

* Update build_wheels_and_publish.yml

explicitly install gcc

* Update build_wheels_and_publish.yml

trying to fix gfortran

* Update build_wheels_and_publish.yml

specifying path with symlink, checking path

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#654)

* Update build_wheels_and_publish.yml

* Update _version.py

* Update meson.build

* Update pyproject.toml (COSMIC-PopSynth#655)

* Version bump for pip (COSMIC-PopSynth#656)

* Update meson.build

* Update _version.py

* Add power law sampling options for ``porb`` and ``q`` (COSMIC-PopSynth#651)

* add `q_power_law` parameter to change the power law of the mass ratio distribution

* allow custom power laws for orbital periods

* add mass ratio sampling test

* add test for custom porb power laws

* add to changelog

* New ``gamma`` option for circumbinary discs (COSMIC-PopSynth#652)

* add new gamma prescription, add some int() statements

* add  details to docs page

* update ini files

* * Modifying the init file to include the commit hash. (COSMIC-PopSynth#659)

*Created get_commit_hash file that finds the commit hash.

*Modified the meson.build file to run get_commit_hash when cosmic is installed.

* Created maximum wall time option (COSMIC-PopSynth#620)

* Added compression options for pandas

* Created maximum wall time argument

* Add debugging setup, avoid NaNs from timestep issue (COSMIC-PopSynth#647)

* setup debugging environment

* ignore a bunch of files

* add a testing fortran script

* move debugging to its own folder

* add a python script for creating the input

* add a simple makefile for testing

* important change: use `loop` instead of `1000` for timestep condition

* add a note about settings

* clean up vscode setup

* I can't count 🙃

* added new test suite location

* fixing numpy pinned version

* forcing numpy version I guess

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>
Co-authored-by: Katie Breivik <kbreivik@andrew.cmu.edu>

* allow a gamma of -3 in error_check (COSMIC-PopSynth#661)

* fixing wheel build for pypi, hopefully

* tiny version bump (COSMIC-PopSynth#665)

* Update _version.py

* Update pyproject.toml

add @TomWagg as dev

* Update meson.build

bump version

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

removing gfortran symlink

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#666)

* Update build_wheels_and_publish.yml

* this should be a working build.

* add meson to requirements

* Fixing linux only wheel  (COSMIC-PopSynth#667)

* Update build_wheels_and_publish.yml

* adding in python versions

* Update build_wheels_and_publish.yml

* Update meson.build

* Update meson.build

* Update pyproject.toml

* Pip fix (COSMIC-PopSynth#669)

* add DS_Store to ignore

* finalllllly got the platform specific wheels built with a pure: false

* tiny bump in version for tag

* Update build_wheels_and_publish.yml

need to repair linux build with cibuildwheel for PyPI

* Update meson.build

forgot to bump version here

* build wheels and publish fix (COSMIC-PopSynth#670)

* pins cibuildwheel==2.17.0 so that we can build across macOS versions.
* allow push to pypi

* add x_86 and arch compatibility for wheels (COSMIC-PopSynth#671)

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

* Update meson.build version

* Update _version.py version

* Update pyproject.toml version

* combine the bpp and bcm columns

* pass bpp column information

* add bpp column variables

* pass all columns to bpp_array

* only need 49 actually

* bin nums separate, only index certain parts of table

* all the binaries!

* change writebpp function to use any columns

* add new bcm variables

* switch to a single function for simplicity

* change everything to writetab

* pass deltam to comenv too

* use writetab not writebpp in comenv.f

* ip not jp

* add bcm stuff and convert integer columns with a loop (add kstars/evol_type)

* `rsunau` ended up in the wrong place, this should fix porbs

* Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows (COSMIC-PopSynth#672)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* metisse update

* Pypi fix (COSMIC-PopSynth#676)

* trying out pypi tests

* add in wheel repair

* trying native build

* adding in pytest check

* adding in pytest install

* Update build_wheels_and_publish.yml

remove the cibuildwheel environment variables and updating action versions

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

Had wrong download action version

* Update build_wheels_and_publish.yml

add in auditwheel for manylinux

* Update build_wheels_and_publish.yml (COSMIC-PopSynth#677)

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

split mac and linux builds

* Update build_wheels_and_publish.yml

trying to get cibuildwheels working again for linux

* Update pyproject.toml

removed pytest from cibuildwheel args

* Update build_wheels_and_publish.yml

don't actually publish

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

* Update build_wheels_and_publish.yml

* Update _version.py

* Update pyproject.toml

* Update meson.build

* Implement new kick prescription (COSMIC-PopSynth#678)

* start a function for changing bases

* add cross product function

* fix indents

* better variables and copy over initial function part

* angles, better variables, natal kick done

* fix transformation for pre-disrupted binaries

* add vector calculations

* everything done except Euler angles

* add dot product and angle functions

* fix indentation, add kick info logging of disrupt

* start adding Euler angles

* rename files

* fix vector variables

* get rid of redundant anomaly stuff

* snstar->sn, update jorb, record in kick_info

* make kick info bigger

* /= is not a thing in fortran who knew

* it lives! (compiles!)

* move helpers, calculate new sep, use correct mass!

* better docstring info

* add check for collisions

* clean up all of the units

* properly update Euler angles

* declare all the variables

* put the old function back in

* change kickflag definition

* change default kickflag to 1 not 0

* update kickflag docs

* update ini files

* missed some kickflags

* calculate h_mag earlier, fix jorb units

* fix tiny typo

* update tests to check on OLD kick prescription for now

* add another test for ejection velocities

* update changelog and version

* more version updates

---------

Co-authored-by: katiebreivik <kbreivik@flatironinstitute.org>

* fix error check

* Fix NaNs coming from supernova kicks (COSMIC-PopSynth#679)

* account for cases with no natal kick and ecc_prev=0.0

* don't forget binstate mergertype bookkeeping

* Update cosmic-pop (COSMIC-PopSynth#683)

Fixed parsing of binfrac model. Now string values are properly handled.

* get working

* fixing tests but as a hack for a couple of them because we updated the kicks and I dont have time to fix it

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: MarkGM02 <90350113+MarkGM02@users.noreply.github.com>
Co-authored-by: Tom Wagg <tomjwagg@gmail.com>
Co-authored-by: elenagonzalez870 <52000594+elenagonzalez870@users.noreply.github.com>
Co-authored-by: Vera Eris Del Favero <77068792+xevra@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* update using_sse and using_metisse to ints for C in CMC

* get evolve working

* update tests
* changes for cmc integration

* moved metisse inputs from zcnsts call to a separate subroutine

* renamed assign_common_cosmic.90 to _METISSE utils.f90 in compile_benchmark

* removed hanging metisse variables from compute_r in comprad.f
poojanagrawal and others added 18 commits February 24, 2025 15:03
* added all four metisse variables in python files

* added all four metisse variables in associated fortran files
… of SSE space (without debug messages this time)
upgrade versions
upgrade actions version
… for METISSE (COSMIC-PopSynth#695)

* updated METISSE

* added 'SSEDict' to cosmic-pop binary

* updated METISSE

* allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)

* :Revert "allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)"

This reverts commit 62c102b.

* added logic for independent sampler to return binaries with Z outside of SSE space (without debug messages this time)

* added a warning when the user passes an invalid metallicity value for SSE

* fixed sampler crashing if SSEDict is not passed

---------

Co-authored-by: duncan_m <duncan_m@ajax.wireless-1x.unc.edu>
…r from cosmic-pop (COSMIC-PopSynth#699)

* updated METISSE

* added 'SSEDict' to cosmic-pop binary

* updated METISSE

* allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)

* :Revert "allowed indepdent sampler to return metallicity outside of SSE range (for METISSE)"

This reverts commit 62c102b.

* added logic for independent sampler to return binaries with Z outside of SSE space (without debug messages this time)

* added a warning when the user passes an invalid metallicity value for SSE

* fixed sampler crashing if SSEDict is not passed

* updated exmaple/Params.ini: changed dtype of 'acc_lim' and 'alpha1' to reflect code changes

* documented Params.ini changes

* added SSEDict to cosmic-pop's independent sampler calls

---------

Co-authored-by: duncan_m <duncan_m@ajax.wireless-1x.unc.edu>
…h#704)

* add lognormal function

* add kickflag option for disberg

* only use disberg when it's not an ecsn/ussn

* update version/changelog

* add docs about new option

* apply bhsigmafrac to mean of disberg lognormal

* allow larger kickflag values

* add two tests that check that Hobbs and Disberg kick routines

* improve tests to just evolve a single star, and don't duplicate del's

(cherry picked from commit d4dd9b5)
@d-maclean

Copy link
Copy Markdown
Contributor Author

Please disregard this PR. It targets the wrong branch. Please see #709 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants