galactic-forensics / iniabu

Python package for automatic handling of solar system initial abundance files
https://iniabu.readthedocs.io
GNU General Public License v2.0
2 stars 3 forks source link

Capability to return abundances as mass fractions #8

Closed trappitsch closed 3 years ago

trappitsch commented 3 years ago

Implement the possibility to return element / isotope abundances as mass fractions.

Maybe put a general mass_fraction toggle in there that can be called like the one for units and then set the mass_fraction bool by default for the future routines from this?

Proposed by: @OClarkson @ubattino

Question: How would the abundance look like in number and in logarithmic space?

Number space:

Logarithmic space:

Would this be reasonable?

OClarkson commented 3 years ago

I don't think anyone ever uses mass fractions in these ways. If you have N_i (sorry, I am changing your notation now) the mass fraction is just X_i = (N_i m_i)/(rho N_A). Where rho = (1/N_A) sum(N_i m_i). That is all we would ever need. Does that make sense? A good way to verify results is NuPPN/frames/mppnp/USEEP/any file there. Thanks!

trappitsch commented 3 years ago

That makes a lot of sense, thanks for the input @OClarkson. Thsi would cover the linear space, any recommendations for the logarithmic return, is that something that is actually used or not?

trappitsch commented 3 years ago

How about this idea:

This way we could avoid having to define a logarithmic mass fraction unit that is not useful for anybody, but would also leave the door open for future extensions.

trappitsch commented 3 years ago

@OClarkson Capability for mass fractions should now be fully included. You can directly start of with mass fractions if you run:

from iniabu import inimf

Documentation is updated too, so there's more details. Enjoy!