yt-project / unyt

Handle, manipulate, and convert data with units in Python
https://unyt.readthedocs.io
BSD 3-Clause "New" or "Revised" License
364 stars 49 forks source link

unyt should not have a single hard-coded metallicity value #229

Closed jzuhone closed 1 year ago

jzuhone commented 2 years ago

unyt uses a single value for the conversion from the ratio of metal mass to total mass to the solar value:

https://github.com/yt-project/unyt/blob/eb511a2a2455e1d2d2fbccdbfbff7b142cb5625f/unyt/_physical_ratios.py#L26-L27

Several studies have been carried out of Solar elemental abundances, which have different values. For example, the value used in X-ray astronomy from Anders & Grevesse (1989) is closer to ~0.02. More recent studies have found something similar. Even Cloudy updates its abundance tables as well.

Potential ways to include other options for solar metallicity measurements:

neutrinoceros commented 2 years ago

I agree that this alone doesn't justify adding a configuration system. Supporting a clean way to override a default at runtime seems like a good option.

brittonsmith commented 2 years ago

I would support some sort of set_solar_metallicity function, if that were straightforward to implement. It could perhaps accept a numerical value or one of a list of keywords corresponding to stock values.

ngoldbaum commented 1 year ago

Fixed by #315