SMU-clusters / ssptools

MIT License
2 stars 0 forks source link

Feature/rewrite mass bins #7

Closed nmdickson closed 1 year ago

nmdickson commented 1 year ago

This branch aims to fix #6 by separating and improving all the logic surrounding the mass bins in EvolvedMF. That includes the creation of the mass bin sizes/locations, the initial filling based on the IMF, the creation of initially empty output quantity arrays, the handling of the y solution in all DE's and the handling of the turned-off bins on the fly.

The main fix for #6 comes from the rethinking of the remnant bins, which were previously grouped together as simply "remnants" and labelled based on the probable types of remnants placed in them. This could at times fail, when the bins and IFMR bounds overlapped in certain ways, so now we completely separate each remnant type into it's own container of mass bins. By default these bins should still largely resemble the original bin sizes/locations, but now have no chance of incorrectly labelling bins or placing two kinds of remnants into one single bin.

The rest of the logic is simply to provide a generally clearer interface to the mass bins.

nmdickson commented 1 year ago

Another key bug, which might also affect the final outputs in many instances, was fixed in 64cd5b6. The bounds being reported for the WDs from the IFMR was incorrectly using the end of the initial mass domain, and not the actual max of the IFMR. This was slightly wrong often, due to the WD IFMR being represented as a polynomial which dropped off a bit near the end. In many cases a small amount of the most massive WDs might have been placed into the NS bin.

This has a small affect on the WDs (adds a tiny bin with a larger mean mass but little actual mass) but given the very small percent mass fraction in NS, the change would be more noticeable there.

nmdickson commented 1 year ago

Tests using this branch in GCfit and fitting on M4 worked fine, this should be good to merge now.