Comments (12)
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.
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.
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.
Cool, did you also take a look at https://github.com/yt-project/unyt ?
from pymagicc.
from pymagicc.
from pymagicc.
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.
alright I think we're on the road to somewhere hgrecco/pint#671
from pymagicc.
@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.
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.
from pymagicc.
Should be solved by moving to using the openscm
API
from pymagicc.
Related Issues (20)
- Move e.g. `diagnose_tcr_ecs_tcre` method out of core
- Update URLs
- Fix Windows CI HOT 9
- Switch to ScmRun
- Raise exception for certain log message level
- Use ScmRun's metadata handling
- Switch to RCMIP names
- Document MAGICC's input and output formats more carefully
- Install broken with Pandas 1.2 HOT 4
- License change HOT 7
- increase GHG response outside of scen HOT 21
- f90nml 1.3 HOT 6
- Fix citation.cff file
- README contradicts itself regarding licensing HOT 1
- pymagicc.run of MAGICC7 isn't generating dat_*.out HOT 3
- How to get the probabilistic distrubution of 600 runs?
- Adapt the mapping for DAT_SURFACE_TEMP towards 'Surface Air Temperature Change' HOT 2
- Unable to run on up-to-date Mac HOT 3
- error in pymagicc.run using magicc7 HOT 2
- Upgrade to pandas 2.0
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 pymagicc.