Comments (10)
Instead of using the built-in ones in unyt?
from swiftsimio.
If you can let me know what use cases we have for this it will make it easier to evaluate this change.
from swiftsimio.
@JegerBroxterman what was your case?
from swiftsimio.
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.
from swiftsimio.
You can just use unyt.G, this comes with the symbolic units attached. Is there a reason that this is not viable?
from swiftsimio.
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.
from swiftsimio.
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]).
from swiftsimio.
I didn't need the units in the end.
from swiftsimio.
ah so we can close?
Using swiftsimio and unyt throughout is the recommended way to go.
from swiftsimio.
I think so, yes.
from swiftsimio.
Related Issues (20)
- Non-cubic boxes not supported for slice visualisation HOT 6
- Pickling cosmo_array objects strips attributes HOT 2
- Add support for partilcle bounding boxes in the snapshot meta-data HOT 11
- Projection/slicing returns unyt_array instead of cosmo_array HOT 4
- Projections can be incomplete if a selection in z is made HOT 7
- Segmentation fault on reading named columns with a spatial mask HOT 3
- boxsize in metadata should be cosmo_array, not unyt_array? HOT 1
- cosmo_array initialisation with a list of unyt_array's results in unyt_array HOT 1
- cosmo_array resets extra attributes to defaults when negated HOT 1
- Astropy deprecation warning in conversions.py HOT 2
- cosmo_array multiplication does not return cosmo_array HOT 1
- Smoothing length calculation for non-gas particles returns `unyt_array`
- unyt requires python>=3.8 HOT 3
- `RuntimeError: Unexpected state, please report this error on github.` HOT 2
- Different parameter values in metadata.cosmology and metadata.cosmology_raw HOT 6
- Too much opening and closing files HOT 8
- Support for FOF files HOT 9
- Can't import swiftsimio on certain cosma8 nodes HOT 3
- Negative dimension error when using an empty mask HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftsimio.