Closed MatthieuSchaller closed 1 year ago
Instead of using the built-in ones in unyt?
If you can let me know what use cases we have for this it will make it easier to evaluate this change.
@JegerBroxterman what was your case?
It had to do with the neutrino corrections. I think in my case unyt also works but it is nice to directly read the constants in the internal units (for me G in Mpc/(1E10 Msun) km/s). Not sure if this is possible already with swiftsimio, I used h5py in the end.
You can just use unyt.G, this comes with the symbolic units attached. Is there a reason that this is not viable?
It should work but you need to know the units you want to convert to. At first, I wasn't sure what the exact internal units of the simulation were.
Why do you need to know the units? The arrays themselves have symbolic units. So to calculate something like gravitational force I would just do unyt.G data.gas.masses[0] data.gas.masses[1] / np.sum(data.gas.coordinates[0] * data.gas.coordinates[1]).
I didn't need the units in the end.
ah so we can close?
Using swiftsimio and unyt throughout is the recommended way to go.
I think so, yes.
We don't read in the physical constants as part of the meta-data. Should we?