CF units won't let me (it screens lots of exceptions no matter what I try).
How can I do this or bypass the CF?
Cheers
Daniel
import irisfilename = '20110827.oper00.pc000'vars = ['air_temperature']
temperature = iris.load(filename, vars)
t1 = temperature[0] ** 3.5
print(t1)(base) C:\Users\...>python poc_cf_error.pyTraceback (most recent call last): File "poc_cf_error.py", line 7, in <module> t1 = temperature[0] ** 3.5 File "C:\Anaconda\lib\site-packages\iris\analysis\maths.py", line 547, in exponentiate return _math_op_common(cube, power, cube.units ** exponent, new_dtype, File "C:\Anaconda\lib\site-packages\cf_units\__init__.py", line 1701, in __pow__ raise ValueError(msg)ValueError: Cannot raise a unit by a decimal (got 3.5).import irisfilename = '20110827.oper00.pc000'vars = ['air_temperature']
temperature = iris.load(filename, vars)
t1 = temperature[0] ** 0.5
print(t1)(base) C:\Users\...>python poc_cf_error.pyproductRoot(): It's meaningless to take the 2nd root of "K"Traceback (most recent call last): File "poc_cf_error.py", line 7, in <module> t1 = temperature[0] ** 0.5 File "C:\Anaconda\lib\site-packages\iris\analysis\maths.py", line 547, in exponentiate return _math_op_common(cube, power, cube.units ** exponent, new_dtype, File "C:\Anaconda\lib\site-packages\cf_units\__init__.py", line 1695, in __pow__ result = self.root(root) File "C:\Anaconda\lib\site-packages\cf_units\__init__.py", line 1419, in root six.raise_from(value_error, None) File "<string>", line 3, in raise_fromValueError: [UT_MEANINGLESS] Failed to take the root of Unit('K')> an email to scitoo...@googlegroups.com
> <mailto:scitools-iris+unsub...@googlegroups.com>.
> > <mailto:scitools-iris+unsub...@googlegroups.com <javascript:>>.
> > To view this discussion on the web, visit
> >
> https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "SciTools (iris, cartopy, cf_units, etc.) -
> https://github.com/scitools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to scitoo...@googlegroups.com
> <mailto:scitools-iris+unsub...@googlegroups.com>.
> > > <mailto:scitools-iris+unsub...@googlegroups.com
> <javascript:> <javascript:>>.
> > > To view this discussion on the web, visit
> > >
> >
> https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com>>
>
> >
> > >
> >
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com?utm_medium=email&utm_source=footer>
>
> >
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/scitools-iris/7cee1915-96a1-4ae0-a22a-cc58f898c0b2%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
>
> >
> > > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>
> > <https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>>.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "SciTools (iris, cartopy, cf_units, etc.) -
> > https://github.com/scitools" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to scitoo...@googlegroups.com <javascript:>
> > <mailto:scitools-iris+unsub...@googlegroups.com <javascript:>>.
> > To view this discussion on the web, visit
> >
> https://groups.google.com/d/msgid/scitools-iris/60c23a28-8f2d-41b0-9045-88759450ad72%40googlegroups.com
> <https://groups.google.com/d/msgid/scitools-iris/60c23a28-8f2d-41b0-9045-88759450ad72%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/scitools-iris/60c23a28-8f2d-41b0-9045-88759450ad72%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/scitools-iris/60c23a28-8f2d-41b0-9045-88759450ad72%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "SciTools (iris, cartopy, cf_units, etc.) -
> https://github.com/scitools" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to scitoo...@googlegroups.com
> <mailto:scitools-iris+unsub...@googlegroups.com>.