Anybody run into the need to average over Z axis (e.g., cdutil.averager(tvar, axis="z")
), and what did you use?
#591
-
Question criteria
Describe your questionI'm running into a case where I need to average over the Z axis. The CDAT code being used is @xCDAT/core-developers, has anybody else found the need to average over the Z axis? And if so, what package or custom code are you using to do this? xCDAT's spatial averager, which is based on Lines 246 to 252 in fbf1db6 Are there are any possible answers you came across?For the short-term, I might be able to use xarray.DataArray.weighted directly. However, I still need to generate the weights xr.DataArray beforehand. datarray.weighted(weights).mean("height") Minimal Complete Verifiable Example (MVCE)No response Relevant log outputNo response EnvironmentNo response Anything else we need to know?No response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@tomvothecoder – I have not done this recently, but I think the same algorithm would be valid for depth / pressure coordinates (weights should generally scale as the difference between the bound values for each cell). I think it would make sense to extend |
Beta Was this translation helpful? Give feedback.
@tomvothecoder – I have not done this recently, but I think the same algorithm would be valid for depth / pressure coordinates (weights should generally scale as the difference between the bound values for each cell). I think it would make sense to extend
get_weights
to be able to handle vertical axes.