Giter Club home page Giter Club logo

Comments (12)

lewisjared avatar lewisjared commented on May 30, 2024

I have used the cfunits package before. It was super easy to integrate. The downside is that it requires the udunits library as an additional dependency.

It is used in https://github.com/NCAR/wrf-python to convert units

from pymagicc.

rgieseke avatar rgieseke commented on May 30, 2024

Pinging @AnnisG as well ...

The main problem is, that there is no accepted, widely used unit solution for Python/Pandas ...

The question is how far from core MAGICC we want to move away ... such functionality might also be something for a generalised SCM wrapper which handles scenarios with arbitrary units and allows calling different SCMs.

from pymagicc.

JGuetschow avatar JGuetschow commented on May 30, 2024

I looked into pint because it has o called "contexts" which allow different conversions depending on the context. This is needed if we want to be able to convert under different GWPs. as of today I actually got custom built contexts to work,but so far I've only tested an example and not emissions conversion under different GWPs. But it should in general work. Most of the units would have to be added though, as the gas needs to by part of the unit. (so the unit would be e.g. GgCH4 not just Gg).

from pymagicc.

rgieseke avatar rgieseke commented on May 30, 2024

Cool, did you also take a look at https://github.com/yt-project/unyt ?

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

Any progress here team? It would be good to know so we can start to build https://github.com/openclimatedata/openscm/ in a units agnostic way

ping @chrisroadmap

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

alright I think we're on the road to somewhere hgrecco/pint#671

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

@chrisroadmap @JGuetschow what are the right units to be using for emissions? Mass per unit time? Or molar mass per unit time to allow easier conversion between e.g. C and CO2?

from pymagicc.

chrisroadmap avatar chrisroadmap commented on May 30, 2024

Mass per unit time is what FAIR uses. Implicitly at the moment as the "per year" part is not specified and an annual timestep is used. For all GHGs except CO2 and N2O there's no conversion to worry about as the emitted compounds are the same as the ones that appear in the concentration and radiative forcing calculations. It would be good for units to be defined by the user on input so that any required conversion can be performed before applying to the forward model.

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

from pymagicc.

znicholls avatar znicholls commented on May 30, 2024

Should be solved by moving to using the openscm API

from pymagicc.

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.