Open josuemtzmo opened 1 year ago
Nice! I just don't see where this flox
is used in the bottom code you wrote up. Did you import it at the top and used an alias?
You import from flox.xarray import xarray_reduce
I'm still having problems in my data since it's a 6000x6000 grid, but I think for a 1/4° sim should be easier to implement.
@aidanheerdegen, @angus-g do we have this flox.xarray
in the conda analysis environment?
@aidanheerdegen, @angus-g do we have this
flox.xarray
in the conda analysis environment?
This is unknowable ...
$ module load conda/analysis3-23.01
$ python -c 'import flox.xarray'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'flox'
I guess one needs to install it? I was asking if it's installed -- you answered :)
I was being snarky. But I only do it to people who I know have an excellent sense of humour .. and you @navidcy
Yeah, you'll need email CMS help to get that installed (cws_help@nci.org.au)
Hello,
I recently started computing the Surface Water-Mass Transformation and I found a more efficient and quicker way to do the binning in density space. It requires
flox
a library that allows to aggregatexr.DataArray
. See flox.xarray.xarray_reduce.The required change on the notebook would simplify the code from:
to:
This same library can be use to more efficiently compute the overturning circulation and other "complex" aggregations. If I have time, I will submit a PR, but I wanted to leave this here in case it's useful for somebody else.