Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
347 commits
Select commit Hold shift + click to select a range
4fac0c2
isolated evolution step (#35)
ezapartas May 18, 2023
871c40d
small changes to solve issues in accepted PR35 (#74)
ezapartas May 18, 2023
cd026ad
Updating modules to newest versions for python 3.11 (#57)
kasdaglie May 25, 2023
aa78869
Added script for estimating detection probabilities. These are estima…
michaelzevin May 25, 2023
656bee4
[insane PR 🤯] POSYDON v2 DCO population synthesis workflow (#63)
ssbvr May 25, 2023
7db811e
Catch corrupted mesa files for creating a psygrid (#72)
mkruckow May 25, 2023
80ed446
making some if statements clear (#83)
kasdaglie May 25, 2023
c4427f7
rename selection_effects.py
ssbvr May 31, 2023
9e46ba6
adding profile interpolation (#58)
elizabethteng Jun 15, 2023
fb9369b
Post processing pipeline prepare master ini (#91)
mkruckow Jun 15, 2023
8619f5b
Allow grid end at He depletion (for massive stars) (#89)
mkruckow Jun 15, 2023
c1b4daa
Support arbitrary MODEL for double compact object rates (#95)
ssbvr Jun 15, 2023
c2e47d2
Add support for post processing an arbitrary number of core-collapse …
ssbvr Jun 22, 2023
ca569b7
Initially single stars and merged isolated evolution (#92)
kasdaglie Jun 29, 2023
2a2725d
Fixes to orbital_kick in step_SN (#39)
chase-kimball Jun 29, 2023
e4ca54e
updates to profile interpolation (#101)
elizabethteng Jun 29, 2023
3b9f213
Seth TPAGBwind pipeline (#102)
Jun 29, 2023
5d35a8e
Update step_SN.py (#108)
devimisra Jul 3, 2023
7418d51
Update setup.py (#107)
devimisra Jul 3, 2023
366526e
Update run-pipeline (#109)
mkruckow Jul 20, 2023
ea23ac4
Introducing GRB properties and rate calculations (#103)
ssbvr Jul 20, 2023
6a0128a
profile interpolation update (#111)
elizabethteng Jul 20, 2023
a470516
Allowing for relative paths in the pipeline (#113)
mkruckow Jul 20, 2023
96f70f9
Update step_detached.py, corrected order of magnitude on Rappaport, V…
Jul 20, 2023
a6f0923
Fix coefficinent SFRH Neijssel+19 (#112)
ssbvr Aug 3, 2023
45c99d8
Plot popsyn values over grid slices (#115)
ssbvr Aug 3, 2023
5940ce9
Add multi panel plots to plot2D (#118)
mkruckow Aug 3, 2023
ddd8e69
fix grid post processing WD and above PISN BH formation (#119)
ssbvr Aug 3, 2023
8aa5064
Fix missing Z values in case of missing history files (#120)
mkruckow Aug 3, 2023
507db9d
Hdf5 refactor - data types for population output (#88)
ka-rocha Aug 10, 2023
85812a7
remove wrong code for kick in eccentric orbit (#121)
ssbvr Aug 10, 2023
2ee1613
Update scrubbing.py (#123)
mkruckow Aug 10, 2023
bbcf475
Update binarypopulation.py (#128)
mkruckow Aug 15, 2023
85148e5
Update profile_interpolation.py
astroJeff Aug 24, 2023
9f7cc30
Merge 124 and 125 (#126)
ssbvr Aug 24, 2023
945b621
Konst removing init imports (#132)
kkovlakas Aug 24, 2023
5f1648b
introducing step_CO_HeMS_RLO (#122)
ssbvr Aug 31, 2023
cc0e2a5
add rerun type: thermohaline_mixing (#136)
mkruckow Aug 31, 2023
905373b
Vhd multiple (#139)
WeneKouarfate Sep 14, 2023
3898614
Create deploy-github-pages-unstable.yml (#145)
kkovlakas Sep 28, 2023
77041e4
Correcting the boolean logic in deciding single/binary evolution in t…
kkovlakas Sep 28, 2023
5369763
Update deploy-github-pages-unstable.yml
kkovlakas Sep 28, 2023
28212b8
Merge pull request #146 from POSYDON-code/kkovlakas-patch-2
kkovlakas Sep 28, 2023
cb05dd5
redirect keeps info from before (#141)
ezapartas Sep 28, 2023
350d3ea
changed the Thorne-Zytkow objects correctly to non_existent_companion…
ezapartas Sep 28, 2023
f32eff4
Update deploy-github-pages-unstable.yml (#147)
kkovlakas Sep 28, 2023
d8119b8
TF2 remake and support reverse MT flag in TF12 (#137)
ssbvr Oct 12, 2023
0e5e92d
Single stars updates (#110)
kasdaglie Oct 12, 2023
4eaac73
Introducing POSYDON v2 documentation (#144)
ssbvr Oct 19, 2023
c728ee2
Update deploy-github-pages.yml to point to development
kkovlakas Oct 25, 2023
3cd929e
Merge pull request #172 from POSYDON-code/kkovlakas-patch-3
kkovlakas Oct 25, 2023
848b468
Update deploy-github-pages.yml
kkovlakas Oct 25, 2023
6083088
Update deploy-github-pages.yml
kkovlakas Oct 25, 2023
265f341
Update deploy-github-pages.yml
kkovlakas Oct 25, 2023
9154b04
Using a child process to copy data from work to storage directory (#157)
mkruckow Oct 26, 2023
bdd53ae
Concatenate fix for casting current scalar_names (#167)
maxbriel Oct 26, 2023
42615c3
add requested tutorials (#169)
ssbvr Oct 26, 2023
c963873
rewrite PSyGrid.rerun to use pandas instead of csv module; some enhan…
mkruckow Nov 9, 2023
0d5009c
Minor edits on documentation (#182)
kkovlakas Nov 9, 2023
f4fd69b
Not printing metallicity value if verbose is False (#180)
kkovlakas Nov 16, 2023
476b200
Removing duplicated code and simplifying if statements in CEE step (#…
kkovlakas Nov 16, 2023
6d7bd41
Update README.md (#189)
tassos25 Nov 16, 2023
d048f27
Matthias documentation additions (#166)
mkruckow Nov 30, 2023
c589732
Upgrades on documentation makefile (#186)
mkruckow Nov 30, 2023
e9c0304
pipeline updates for reruns (#177)
mkruckow Nov 30, 2023
ddb43e1
Synthetic Population: MPI removal + DataFrame fix (#175)
maxbriel Dec 14, 2023
a8aa494
Option for losing mass during cee that leads to merging (#193)
ezapartas Dec 14, 2023
7b7306a
Update posydon-run-grid (#207)
mkruckow Dec 14, 2023
3003a2b
add casting to float64 (#212)
maxbriel Dec 14, 2023
f866de6
change loc call to list to return a pandas.DataFrame (#216)
maxbriel Dec 14, 2023
1121f1a
Setting the lower limit of the mass ratio to q=0.05
kasdaglie Jan 2, 2024
65f1234
removing unused import and duplicates
kasdaglie Jan 3, 2024
f043314
Numerical precision fix failed (#210)
mkruckow Jan 11, 2024
1a829db
rerun for He stars starting past ZAMS (#227)
mkruckow Jan 11, 2024
dea1102
flip"massless_remnant" and "merged_star" for CO (#219)
celiotine Jan 11, 2024
c2af389
add error warning for returning to step_detached after leaving it (#222)
maxbriel Jan 11, 2024
3f2ebc0
Merge pull request #231 from POSYDON-code/fixing_issues
celiotine Jan 11, 2024
7d084b6
HDF5 read fix (#229)
maxbriel Jan 11, 2024
e4f7dff
add loop checks for other CO grids
maxbriel Jan 12, 2024
b38d3f8
when raising an error set state to 'ERR' and event to 'FAILED'
maxbriel Jan 12, 2024
6a39da4
Merge branch 'max_additional_err_binaries' into max_loop_fix
maxbriel Jan 12, 2024
487e519
Update step_detached.py
maxbriel Jan 12, 2024
d9aff76
deepcopy SimulationProperties (#233)
maxbriel Jan 18, 2024
5ba89f3
implement multiprocessing to free memory on finishing a metallicity (…
maxbriel Jan 18, 2024
f65293c
Update step_mesa.py
astroJeff Jan 18, 2024
c159a95
add set_binary_to_failed function
maxbriel Jan 19, 2024
49adcac
change to m2 min and max
maxbriel Jan 22, 2024
0ae8d24
add mass out of grid error for CO grids
maxbriel Jan 22, 2024
d14c2fe
Allow non-burning stars in MT (#206)
astroJeff Jan 25, 2024
ed74710
minor bug fixes to profile interpolation (#223)
elizabethteng Jan 25, 2024
ff0302d
Add below minimum period redirect
maxbriel Jan 30, 2024
a56943c
add clarification + selection based on mass ratio
maxbriel Jan 30, 2024
5e71b0d
add additional mass_ratio minimum
maxbriel Jan 30, 2024
9a2d6ed
Update step_mesa.py
maxbriel Jan 30, 2024
b239229
Copy column list for MESA (#228)
mkruckow Feb 1, 2024
687947c
Add loop checks for other CO grids (#239)
maxbriel Feb 1, 2024
39a7789
notation fix for np.max compared to maximum
maxbriel Feb 2, 2024
e479166
development merge
maxbriel Feb 2, 2024
ca32948
fix missed merge
maxbriel Feb 2, 2024
4ed2e8c
Merge pull request #250 from POSYDON-code/max_loop_fix
maxbriel Feb 2, 2024
1c52d6a
Update scrubbing.py (#249)
mkruckow Feb 8, 2024
f0902fa
CO and SN_type consistency checks (#240)
maxbriel Feb 15, 2024
b52d19d
Inhomogeneous binary array (#251)
ezapartas Feb 15, 2024
6abf1ac
change itemsizes for event_f and mass_transfer_case_f (#253)
celiotine Feb 15, 2024
3ca9243
Tilt tracking (#129)
chase-kimball Feb 22, 2024
83a458d
add 'stable_reverse_MT' and interpolation_class for CO (#170)
ZepeiX Feb 22, 2024
44dea62
String len in [step_names] columns (#257)
dimsour94 Feb 22, 2024
8db84b6
CO-H(e)MS period outside grid being failed fix (#255)
maxbriel Feb 22, 2024
b098431
Refinements in the `compress-mesa` tool (#241)
kkovlakas Feb 22, 2024
6f242e1
Keeping the WD abundances for the step_merged (#261)
kasdaglie Mar 7, 2024
a4f5fa5
Revert "add 'stable_reverse_MT' and interpolation_class for CO (#170)"
maxbriel Mar 7, 2024
e0fad01
Merge pull request #269 from POSYDON-code/max_dev_fix
kasdaglie Mar 8, 2024
f7a9573
Fix get_combined_tilt calculation (#274)
maxbriel Mar 14, 2024
c825163
Remove legacy code realte to integration to BSE (#277)
tassos25 Mar 14, 2024
28c7147
Fixes in postprocessing (#237)
mkruckow Mar 15, 2024
9640107
Updates on running MESA grids (#263)
mkruckow Apr 4, 2024
d312358
Allows non-Roche lobe overflowing systems in the RLO grids (#217)
kkovlakas Apr 18, 2024
de3ba99
Posydon error checking (#287)
celiotine Apr 18, 2024
166f2a6
Update synthetic_population.py (#293)
ZepeiX Apr 25, 2024
b33be54
change name of slurm files (#294)
mkruckow May 2, 2024
93c5048
Update step_SN.py (#297)
mkruckow May 9, 2024
43d206f
remove old and not used code (#301)
mkruckow May 9, 2024
cf933e4
Add functions to read initial values from file (#299)
mkruckow May 16, 2024
8c516c9
Add extra hooks columns to binary.restore() (#306)
celiotine May 23, 2024
ff58bcb
Unstable documentation fix (missing dependency) (#305)
kkovlakas May 23, 2024
9c8695c
More fixes in post-processing pipeline (#281)
mkruckow May 23, 2024
d145f34
Added new rerun type: dedt_energy_eqn (#275)
May 24, 2024
1640a3e
Generalize and improve on compress MESA (#289)
mkruckow May 24, 2024
5159d79
Population Analysis Framework Refactor (#267)
maxbriel Jun 6, 2024
15d70ce
update absolute imports and default ini with some docs (#310)
ka-rocha Jun 6, 2024
07ebd74
Update termination_flags.py (#317)
mkruckow Jun 6, 2024
ee33713
Fixes to error checking (#320)
celiotine Jun 6, 2024
2ee526f
Rerun for He stars and rapid mass transfer (CO-HeMS and moderate mass…
Jun 7, 2024
2fbe8ce
fix filenamaes in generated `slurm_submit.sh` for popsynth (#330)
maxbriel Jun 11, 2024
2deae1b
Update posydon-run-pipeline (#329)
mkruckow Jun 13, 2024
cd1052c
Zepei fix interpolator (#325)
ZepeiX Jun 14, 2024
6cb6acc
Add correction for eccentric pre SN orbits for SNflag2 (#316)
mkruckow Jun 15, 2024
d2392c0
step_SN mass check; force manual calculation if not matching (#324)
maxbriel Jun 15, 2024
07f5134
Update termination_flags.py
ZepeiX Jun 15, 2024
25e3af9
Merge pull request #332 from POSYDON-code/Revert-#317
maxbriel Jun 15, 2024
f1a686c
Update common_functions.py
ZepeiX Jun 18, 2024
3f8f2c9
Merge pull request #335 from POSYDON-code/ZepeiX-patch-1
ZepeiX Jun 18, 2024
7e9ab41
put MESA condition back; additional check which star dominates RLO (#…
mkruckow Jun 18, 2024
016a9b1
Update setup.py (#336)
tassos25 Jun 18, 2024
ceacdb2
missing lambda in final values for CO-HeMS grids (#338)
ZepeiX Jun 22, 2024
2862f80
Podsiadlowski spelling + docstring (#349)
mkruckow Jul 5, 2024
88c81f2
replace scipy.integrate.simps call with scipy.integrate.simpson call …
maxbriel Jul 5, 2024
a2fe944
Add user modules (#296)
mkruckow Jul 11, 2024
4d627f1
move creation of export dirs, to make it dynamical (#339)
mkruckow Jul 11, 2024
beb75a9
Update scrubbing.py (#348)
mkruckow Jul 11, 2024
6f72972
Update PISN range in step_SN.py (#352)
mkruckow Jul 11, 2024
7cc150a
IF interpolator `out_nan_keys` as an input (#342)
maxbriel Jul 11, 2024
693c1cd
Keep abundaces in envelope at collapse & M4,mu4 values (#340)
ezapartas Jul 18, 2024
0752c69
replace np.NaN and np.NAN by np.nan (#357)
mkruckow Jul 18, 2024
78540d6
Fixing a small typo in grids IO (#358)
kkovlakas Jul 18, 2024
1fb20c1
matplotlib changes (#322)
ezapartas Aug 8, 2024
488b858
Add POSYDON Warnings (#300)
mkruckow Aug 22, 2024
2093203
new rerun types LBV_wind and LBV_wind+* (#363)
mkruckow Aug 22, 2024
5657878
Suport ZAMS binaries with initial eccentricity (#337)
ka-rocha Aug 29, 2024
120c96b
Fix RLO warnings in detached step (#371)
celiotine Sep 12, 2024
0645493
Reruns with no age limit for low mass stars (#372)
mkruckow Sep 12, 2024
82ecd3c
TransientPopulation overplot crash fix (#374)
maxbriel Sep 12, 2024
f8f5d01
fix get_redshift_from_cosmic_time() function (#381)
celiotine Sep 12, 2024
251b3c6
Replace job_start for running grids (#380)
mkruckow Sep 12, 2024
c35dc95
add missing binary states to flow charts and error catching fo future…
celiotine Sep 17, 2024
6534f34
add verbose block, move return statement
celiotine Sep 18, 2024
dee2183
add an escape option if value cannot be found in the grids (#385)
maxbriel Sep 19, 2024
6303bd2
Population() fix for large memory usage when reading files (#386)
maxbriel Sep 19, 2024
15ef83d
Initial RLO boundary limit (#389)
mkruckow Sep 19, 2024
38b775e
Small Population fixes (#390)
maxbriel Sep 19, 2024
d332c99
add catch to suppress python warning in detached step (#392)
celiotine Sep 19, 2024
5acad13
Add LBV_wind+dedt+hepulse rerun (#393)
Sep 19, 2024
6c3ea7e
remove failed states from flow and raise POSYDON errors instead
celiotine Sep 23, 2024
88c28de
add more info to DCO error message
celiotine Sep 25, 2024
f3cc804
Update independent_sample.py (#394)
mkruckow Sep 26, 2024
215128e
Update posydon-run-pipeline (#396)
Sep 26, 2024
0c2019b
Merge pull request #391 from POSYDON-code/add_missing_flow_states
celiotine Sep 30, 2024
91b8bcd
Relax number formating for mesa inputs (#401)
mkruckow Oct 1, 2024
7072e2e
Update IF_interpolation.py (#399)
philipp-rajah Oct 3, 2024
04d8816
Update setup.py
maxbriel Oct 8, 2024
fb6f708
Merge pull request #410 from POSYDON-code/max_installation_patch
maxbriel Oct 9, 2024
9b203c0
Add "last" to TF12 for stable MT (#405)
mkruckow Oct 14, 2024
13448f0
update profile interpolation for consistency with paper (#397)
elizabethteng Oct 15, 2024
709dcd5
rename "stripped_He_Core_H_burning" state and add to flow chart (#404)
celiotine Oct 17, 2024
ee54c40
allow double He-rich star binaries in RLO to merge (#414)
celiotine Oct 17, 2024
815b484
update star states in step_SN (#416)
celiotine Oct 17, 2024
b334fbc
Automatic testing of installation (#425)
elizabethteng Nov 1, 2024
20f182c
always initialize values for separation and orbital period in BinaryS…
celiotine Nov 7, 2024
52b6913
error catch for He-rich stars in RLO onto H-rich stars (#423)
celiotine Nov 7, 2024
c6c0153
New normalized_pop_mass.py file (#376)
dimsour94 Nov 13, 2024
cb62261
Update README.md (#434)
mkruckow Nov 13, 2024
d64b011
update installation test to include M1 and intel chips for macos (#428)
elizabethteng Nov 13, 2024
713ca61
Add default legend titles based on the termination flag (#432)
mkruckow Nov 22, 2024
7e19735
change to release on publish (#452)
maxbriel Nov 26, 2024
6321eb5
Update publish-to-anaconda.yml (#455)
maxbriel Nov 27, 2024
9eb1d4b
small fix to BBH selection function (#403)
maxbriel Nov 27, 2024
d21c9b4
Tutorial updates with recent PRs + feedback from collaboration meetin…
maxbriel Nov 27, 2024
bd3ede2
Update step_merged.py (#457)
mkruckow Dec 2, 2024
206f5b5
fix log vs log10 typo (#460)
maxbriel Dec 3, 2024
e93bbf4
remove "redirect" steps from history dataframe (#421)
celiotine Dec 4, 2024
14b90a5
Start to get unit tests back: utils (#382)
mkruckow Dec 6, 2024
f432718
period_change_stabe_MT -> period_change_stable_MT (#467)
mkruckow Dec 10, 2024
e8e93ff
PSygrid force int input (#440)
maxbriel Dec 10, 2024
a3761e1
Backpropagate changes on main/max_requirements into development (#456)
maxbriel Dec 12, 2024
2906264
update zenodo url and md5 (#470)
astroJeff Dec 12, 2024
13ec954
error check for undefined states in BinaryStar (#468)
celiotine Dec 12, 2024
1473e73
Update step_merged.py (#480)
mkruckow Jan 16, 2025
2ca491f
No check for WD formation in double CE case (#484)
mkruckow Jan 16, 2025
1468311
handle H-rich RLO binaries and clarify verbosity of detached step (#430)
celiotine Jan 16, 2025
5b7785c
Grid slice plotting system selection fix (#475)
maxbriel Jan 17, 2025
4d05dec
add missing binaries to UNDEFINED_STATES in flow chart (#489)
celiotine Jan 23, 2025
bcb3367
Update issue templates (#491)
astroJeff Jan 27, 2025
a0ec0e2
Update installation-guide.rst to include note about adding conda-forg…
astroJeff Jan 28, 2025
79aab3b
Protect run_psycris_sequence, from misc imports (#436)
ka-rocha Jan 28, 2025
a7c72ca
add more dump_rate info to docs (#500)
celiotine Feb 4, 2025
5969e13
replace scipy interp1d with alternatives (#433)
celiotine Feb 4, 2025
83d7ac8
Add support for unsorted input in new interpolators (#502)
maxbriel Feb 7, 2025
593efb7
replace NaN/None in input chi_eff calculation with 0 (#501)
maxbriel Feb 7, 2025
d7a8bb5
updating the data_download routines slightly (#496)
astroJeff Feb 7, 2025
f4d68ed
Use of `PATH_*` variables (#505)
mkruckow Feb 13, 2025
313315a
Fixes to Troubleshooting & FAQ Docs (#517)
celiotine Feb 27, 2025
bcd7301
Add files to installation (#526)
mkruckow Mar 4, 2025
f84636b
Fix logic flow in matching (#521)
celiotine Mar 5, 2025
a61cac4
add accreted_He_Shell_H_burning stars to flow, detached step (#522)
celiotine Mar 5, 2025
d952aaa
Issues with undefined values of SN_MODELS (#482)
mkruckow Mar 5, 2025
64a7d2b
replace isnan (#527)
mkruckow Mar 6, 2025
7053f24
Fix logic for single star fraction population normalisation (#509)
maxbriel Mar 10, 2025
eed90df
Pulsational Pair-Instability top-down mass loss approach (#417)
maxbriel Mar 10, 2025
61ddf32
Blandford-Znajek jet energy calculation (#429)
maxbriel Mar 10, 2025
67a4fbd
Split popsyn plotting into separate components for future modularity …
maxbriel Mar 10, 2025
7f99001
Use information about dominating star in infer_mass_transfer_case (#532)
mkruckow Mar 11, 2025
ae5f086
Update setup.py (#536)
mkruckow Mar 13, 2025
15b8215
GitHub action fix (#537)
maxbriel Mar 13, 2025
96cb703
Update MESA-grid tutorials (#535)
mkruckow Mar 13, 2025
e8ed342
Modular data download (#507)
mkruckow Mar 13, 2025
2b4dd81
Decouple ECSN treatment from SN_MODELS (#504)
mkruckow Mar 13, 2025
aad8cf3
Add WDs to infer_star_state (#512)
mkruckow Mar 13, 2025
1cb434a
Update setup.py (#541)
mkruckow Mar 18, 2025
e0b7e85
Upgrade setuptools (#542)
mkruckow Mar 18, 2025
8a3f45a
set post SN binary to disrupted in case there is a massless_remnant (…
mkruckow Mar 20, 2025
9155935
Update population_params_default.ini (#544)
maxbriel Mar 20, 2025
5e0646e
new interpolator
philipp-rajah Jun 26, 2025
8af666d
sync
philipp-rajah Jul 31, 2025
e8082e6
mainly syncing / backing up, but rewrote much of the normalization logic
philipp-rajah Jan 15, 2026
70c467b
backing up
philipp-rajah Apr 15, 2026
97d81fc
sync
philipp-rajah Apr 22, 2026
bf57303
Three new magnetic braking prescriptions in step_detached.py (#43)
philipp-rajah Apr 23, 2026
401dae9
visualization for new interpolation
philipp-rajah Apr 23, 2026
6beb4c3
Merge remote-tracking branch 'origin/v2.3' into new_interpolator
philipp-rajah Apr 23, 2026
27a51e3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/posydon-setup-grid
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def find_inlist_from_scenario(source, gitcommit, system_type):
else:
Pwarn("git repository is already there, using that",
"OverwriteWarning")
Pwarn("git repository is already there, using that",
"OverwriteWarning")

inlists_dir = '{0}/.posydon_mesa_inlists'.format(os.environ['HOME'])
branch = gitcommit.split('-')[0]
Expand Down Expand Up @@ -112,6 +114,8 @@ def find_inlist_from_scenario(source, gitcommit, system_type):
else:
Pwarn("git repository is already there, using that",
"OverwriteWarning")
Pwarn("git repository is already there, using that",
"OverwriteWarning")

inlists_dir = '{0}/.user_mesa_inlists'.format(os.environ['HOME'])
branch = gitcommit.split('-')[0]
Expand Down Expand Up @@ -146,6 +150,7 @@ def find_inlist_from_scenario(source, gitcommit, system_type):
stderr = subprocess.PIPE
)
proc.wait()
proc.wait()

# if this is looking at posydon defaults, all posydon defaults build from default common inlists
if source == 'posydon':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,6 @@ def main():

if __name__ == "__main__":
main()

if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions posydon/binary_evol/MESA/step_mesa.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ def load_Interp(self, filename):

# Check if interpolation files exist
if not os.path.exists(filename):
data_download()
data_download() #TODO: specify dataset

# Load interpolator
self._Interp = IFInterpolator()
self._Interp = IFInterpolator(load = True)
self._Interp.load(filename=filename)

def close(self):
Expand Down
21 changes: 20 additions & 1 deletion posydon/binary_evol/SN/profile_collapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ def do_core_collapse_BH(star,
The mass of the disk radiated away in M_sun.
'BZ_jet_power_total' : float
The total Blandford-Znajek jet power in erg/s.

# Additional keys that are not used in the current implementation:
# 'BZ_jet_power_array' : np.array(BZ_jet_power_array),
# Blandford-Znajek jet power at each shell collapse in erg/s
Expand Down Expand Up @@ -645,6 +644,26 @@ def do_core_collapse_BH(star,
BZ_jet_power_array.append(BZ_power)
BZ_jet_power_total += BZ_power

# calculate the potential BZ jet power at this moment of the collapse
# We assume full efficiency for the magnetic flux and a BH spin
# dependence of a^2 for the BH spin efficiency.
# just an energy total per collapse step.
BZ_power = BZ_jet_power(M_dot=dm_disk,
eta_phi=1,
eta_a=a_BH**2)
BZ_jet_power_array.append(BZ_power)
BZ_jet_power_total += BZ_power

# calculate the potential BZ jet power at this moment of the collapse
# We assume full efficiency for the magnetic flux and a BH spin
# dependence of a^2 for the BH spin efficiency.
# just an energy total per collapse step.
BZ_power = BZ_jet_power(M_dot=dm_disk,
eta_phi=1,
eta_a=a_BH**2)
BZ_jet_power_array.append(BZ_power)
BZ_jet_power_total += BZ_power

# Append all quantities to the arrays
J_accreted_array.append(J_BH)
M_BH_array.append(M_BH)
Expand Down
8 changes: 4 additions & 4 deletions posydon/interpolation/IF_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ class relies on the BaseIFInterpolator class to perform the interpolation
find_constraints_to_apply,
sanitize_interpolated_quantities,
)
from posydon.interpolation.data_scaling import DataScaler
from posydon.utils.posydonwarning import Pwarn
from posydon.visualization.plot_defaults import DEFAULT_LABELS


# INITIAL-FINAL INTERPOLATOR
Expand Down Expand Up @@ -273,13 +270,16 @@ def evaluate(self, binary, sanitization_verbose=False):
"""
ynums = {}
ycats = {}

# s = time.time()
for interpolator in self.interpolators:
ynum, ycat = interpolator.evaluate(binary, sanitization_verbose)

ynums = {**ynums, **ynum}
ycats = {**ycats, **ycat}

# e = time.time()
# print(f"Iterated over {len(self.interpolators)} interpolators in {e - s}")

return ynums, ycats


Expand Down
72 changes: 68 additions & 4 deletions posydon/interpolation/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@

import numpy as np

from posydon.utils.common_functions import (
orbital_separation_from_period,
stefan_boltzmann_law,
)
CLASSIFICATION_KEYS = [
"S<*>_state",
"mt_hist",
"S<*>_MOD<n>_SN_type",
"S<*>_MOD<n>_CO_type"
]

N_MODELS = 11 # how many super nova models are there?

# toggle this flag to enable/disable constraints (used for debugging)
INTERPOLATION_CONSTRAINTS_ON = True
Expand Down Expand Up @@ -523,3 +527,63 @@ def sanitize_interpolated_quantities(fvalues, constraints, verbose=False):
constraint["constraint"])

return sanitized


def mt_constraint(classes):

interpolation_class = classes["interpolation_class"]

if interpolation_class == "initial_MT":
classes["mt_hist"] == "ini_RLO"
elif interpolation_class == "no_MT":
classes["mt_hist"] = "no_RLO"
elif interpolation_class == "stable_MT":
pass
elif interpolation_class == "unstable_MT":
pass
elif interpolation_class == "stable_reverse_MT":
pass


CLASS_CONSTRAINTS = {
"S<*>_state": None,
"mt_hist": mt_constraint,
"S<*>_MOD<n>_SN_type": None,
"S<*>_MOD<n>_CO_type": None
}

def apply_class_constraint(key_name, classes):

if key_name not in classes.keys():
return
else:
CLASS_CONSTRAINTS[key_name](classes)

def sanitize_classes(classes, ):

assert(type(classes) == dict)

if "interpolation_class" not in classes.keys():
raise ValueError(
"Interpolation class must be present as a classified quantity to enforce classification constraints!"
)

for key in CLASSIFICATION_KEYS:
if "<*>" in key:

for star in range(2):
key_name = key.replace("<*>", f"{star}")

if "MOD<n>" in key_name:

for model in range(N_MODELS):
key_name = key_name.replace("<n>", f"{model}")

apply_class_constraint(key_name, classes)

else:
apply_class_constraint(key_name, classes)
else:

apply_class_constraint(key, classes)

88 changes: 61 additions & 27 deletions posydon/interpolation/data_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@
]


import sys
import warnings

import numpy as np

# Convert UserWarning to an error
warnings.simplefilter("error", RuntimeWarning)

eps = 1.0e-16

SCALING_OPTIONS = [
"none",
"min_max",
"max_abs",
# "standardize",
"log_min_max", # has
# "neg_log_min_max", # has
"log_max_abs", # has
# "log_standardize", # has
# "neg_log_standardize" # has
]

class DataScaler:
"""Data Normalization class.
Expand Down Expand Up @@ -68,27 +87,28 @@ def fit(self, x, method='none', lower=-1.0, upper=1.0):
if method == 'min_max':
assert upper > lower, "upper must be greater than lower"
self.lower, self.upper = lower, upper
self.params = [x.min(axis=0), x.max(axis=0)]
self.params = [np.nanmin(x, axis=0), np.nanmax(x, axis=0)]
elif method == 'log_min_max':
assert upper > lower, "upper must be greater than lower"
self.lower, self.upper = lower, upper
self.params = [np.log10(x.min(axis=0)), np.log10(x.max(axis=0))]
self.params = [self.log(np.nanmin(x, axis=0)), self.log(np.nanmax(x, axis=0))]

elif method == 'neg_log_min_max':
assert upper > lower, "upper must be greater than lower"
self.lower, self.upper = lower, upper
self.params = [np.log10((-x).min(axis=0)),
np.log10((-x).max(axis=0))]
self.params = [self.log(np.nanmin(-x, axis=0)),
self.log(np.nanmax(-x, axis=0))]
elif method == 'max_abs':
self.params = [np.abs(x).max(axis=0)]
self.params = [np.nanmax(np.abs(x), axis=0)]
elif method == 'log_max_abs':
self.params = [np.abs(np.log10(x)).max(axis=0)]
elif method == 'standarize':
self.params = [x.mean(axis=0), x.std(axis=0)]
elif method == 'log_standarize':
self.params = [np.nanmax(np.abs(self.log(x)), axis=0)]
elif method == 'standardize':
self.params = [np.nanmean(x, axis=0), np.nanstd(x, axis=0)]
elif method == 'log_standardize':
# log will be computed in transform again
self.params = [np.log10(x).mean(axis=0), np.log10(x).std(axis=0)]
elif method == 'neg_log_standarize': # log(-x)
self.params = [np.log10(-x).mean(axis=0), np.log10(-x).std(axis=0)]
self.params = [np.nanmean(self.log(x), axis=0), np.nanstd(self.log(x), axis=0)]
elif method == 'neg_log_standardize': # log(-x)
self.params = [np.nanmean(self.log(-x), axis=0), np.nanstd(self.log(-x), axis=0)]
elif method == 'log':
self.params = []
elif method == 'none': # no transformation
Expand Down Expand Up @@ -124,26 +144,26 @@ def transform(self, x):
x_t = ((x - self.params[0]) / (self.params[1] - self.params[0])
* (self.upper - self.lower) + self.lower)
elif self.method == 'log_min_max':
x_t = ((np.log10(x) - self.params[0])
x_t = ((self.log(x) - self.params[0])
/ (self.params[1] - self.params[0])
* (self.upper - self.lower) + self.lower)
elif self.method == 'neg_log_min_max':
x_t = ((np.log10(-x) - self.params[0])
x_t = ((self.log(-x) - self.params[0])
/ (self.params[1] - self.params[0])
* (self.upper - self.lower) + self.lower)
elif self.method == 'max_abs':
x_t = x / self.params[0]
elif self.method == 'log_max_abs':
x_t = np.log10(x) / self.params[0]
elif self.method == 'standarize':
x_t = self.log(x) / self.params[0]
elif self.method == 'standardize':
x_t = (x - self.params[0]) / self.params[1]
elif self.method == 'log_standarize':
elif self.method == 'log_standardize':
# log will be computed in transform again
x_t = (np.log10(x) - self.params[0]) / self.params[1]
elif self.method == 'neg_log_standarize':
x_t = (np.log10(-x) - self.params[0]) / self.params[1]
x_t = (self.log(x) - self.params[0]) / self.params[1]
elif self.method == 'neg_log_standardize':
x_t = (self.log(-x) - self.params[0]) / self.params[1]
elif self.method == 'log':
x_t = np.log10(x)
x_t = self.log(x)
else: # no transformation
x_t = x

Expand Down Expand Up @@ -201,24 +221,38 @@ def inv_transform(self, x_t):
/ (self.upper - self.lower)
* (self.params[1] - self.params[0]) + self.params[0])
elif self.method == 'log_min_max':
x = 10 ** ((x_t - self.lower) / (self.upper - self.lower)
x = self.unlog((x_t - self.lower) / (self.upper - self.lower)
* (self.params[1] - self.params[0]) + self.params[0])
elif self.method == 'neg_log_min_max':
x = -10 ** ((x_t - self.lower) / (self.upper - self.lower)
x = -self.unlog((x_t - self.lower) / (self.upper - self.lower)
* (self.params[1] - self.params[0]) + self.params[0])
elif self.method == 'max_abs':
x = x_t * self.params[0]
elif self.method == 'log_max_abs':
x = 10 ** (x_t * self.params[0])
x = self.unlog(x_t * self.params[0])
elif self.method == 'standarize':
x = x_t * self.params[1] + self.params[0]
elif self.method == 'log_standarize':
x = 10 ** (x_t * self.params[1] + self.params[0])
x = self.unlog(x_t * self.params[1] + self.params[0])
elif self.method == 'neg_log_standarize':
x = -10 ** (x_t * self.params[1] + self.params[0])
x = -self.unlog(x_t * self.params[1] + self.params[0])
elif self.method == 'log':
x = 10 ** x_t
x = self.unlog(x_t)
else: # no transformation
x = x_t

return x

def log(self, x):
logged = None
try:
logged = np.log10(x + eps)
except RuntimeWarning:
print(self.method)
print(x, np.isinf(x).any(), np.isnan(x).any(), (x < 0).any(), np.nanmin(x))
# sys.exit()

return logged

def unlog(self, x):
return (10 ** x) - eps
Loading
Loading