GithubHelp home page GithubHelp logo

Comments (10)

JBorrow avatar JBorrow commented on August 26, 2024

Instead of using the built-in ones in unyt?

from swiftsimio.

JBorrow avatar JBorrow commented on August 26, 2024

If you can let me know what use cases we have for this it will make it easier to evaluate this change.

from swiftsimio.

MatthieuSchaller avatar MatthieuSchaller commented on August 26, 2024

@JegerBroxterman what was your case?

from swiftsimio.

JegerBroxterman avatar JegerBroxterman commented on August 26, 2024

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.

JBorrow avatar JBorrow commented on August 26, 2024

You can just use unyt.G, this comes with the symbolic units attached. Is there a reason that this is not viable?

from swiftsimio.

JegerBroxterman avatar JegerBroxterman commented on August 26, 2024

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.

JBorrow avatar JBorrow commented on August 26, 2024

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.

JegerBroxterman avatar JegerBroxterman commented on August 26, 2024

I didn't need the units in the end.

from swiftsimio.

MatthieuSchaller avatar MatthieuSchaller commented on August 26, 2024

ah so we can close?

Using swiftsimio and unyt throughout is the recommended way to go.

from swiftsimio.

JegerBroxterman avatar JegerBroxterman commented on August 26, 2024

I think so, yes.

from swiftsimio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.