Add Z axis support for spatial averaging #596
Labels
good-first-issue
Good first issue for new contributors
type: enhancement
New enhancement request
work: obvious
Milestone
Discussed in #591
Originally posted by tomvothecoder January 29, 2024
Is your feature request related to a problem?
I'm running into a case where I need to average over the Z axis. The CDAT code being used is
cdutil.averager(tvar, axis="z")
, which I need to replace.xCDAT's spatial averager, which is based on
cdutil.averager()
, only supports rectilinear grids ("X" and "Y"). However, we do mention that theget_weights()
method can be extended to support other axes:xcdat/xcdat/spatial.py
Lines 246 to 252 in fbf1db6
Are there are any possible answers you came across?
No response
Describe alternatives you've considered
No response
Additional context
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.
The text was updated successfully, but these errors were encountered: