GithubHelp home page GithubHelp logo

Comments (8)

valeriupredoi avatar valeriupredoi commented on July 24, 2024

can now use the convert_units preprocessor step 🍺

from esmvalcore.

bouweandela avatar bouweandela commented on July 24, 2024

Related to #505

from esmvalcore.

schlunma avatar schlunma commented on July 24, 2024

I don't think we can close this, convert_units (hopefully) doesn't convert units from mol m-3 to mol m -2.

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

why not? It's a valid CF unit, the cube doesn't care if it's cows / vultures as long as they are CF units, it's CMOR that will be barking at you, but you're on your own there

from esmvalcore.

schlunma avatar schlunma commented on July 24, 2024
>>> from cf_units import Unit
>>> a = Unit('kg m-3')
>>> b = Unit('kg m-2')
>>> a.convert(1, b)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/miniconda3/envs/mlr/lib/python3.7/site-packages/cf_units/__init__.py", line 1907, in convert
    (self, other))
ValueError: Unable to convert from 'Unit('kg m-3')' to 'Unit('kg m-2')'.
>>> 

from esmvalcore.

valeriupredoi avatar valeriupredoi commented on July 24, 2024

ValueError: Unable to convert from 'Unit('mol m-3')' to 'Unit('mol m-2')'. 🤦‍♂️

from esmvalcore.

ledm avatar ledm commented on July 24, 2024

We shouldn't be using iris convert here, that isn't what happenning here. Iris convert is for stuff like Celsius to Kelvin, not Celsius to heat. The convert function should not be able to change the dimensions of the units.

The issue here is that the depth_integration preprocessor changes the units, dimensions and the dataset standard name. It's a very simple calculation, but non-trivial to resolve it, as the output may not necessarily exist in the CMOR tables.

For instance, you may want to know the water column total oxygen, in mmol per meter squared. I bet that field doesn't exists a standard variable.

from esmvalcore.

bouweandela avatar bouweandela commented on July 24, 2024

@ledm That should no longer be a problem, because we moved the cmor check to right after the data is loaded in #743, so there is no CMOR check anymore after the depth_integration function is applied.

from esmvalcore.

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.