-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
good-first-issueGood first issue for new contributorsGood first issue for new contributorstype: enhancementNew enhancement requestNew enhancement requestwork: obvious
Milestone
Description
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 the get_weights() method can be extended to support other axes:
Lines 246 to 252 in fbf1db6
| Notes | |
| ----- | |
| This method was developed for rectilinear grids only. ``get_weights()`` | |
| recognizes and operate on latitude and longitude, but could be extended | |
| to work with other standard geophysical dimensions (e.g., time, depth, | |
| and pressure). | |
| """ |
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.
datarray.weighted(weights).mean("height")Metadata
Metadata
Assignees
Labels
good-first-issueGood first issue for new contributorsGood first issue for new contributorstype: enhancementNew enhancement requestNew enhancement requestwork: obvious
Type
Projects
Status
In Review