cf-xarray icon indicating copy to clipboard operation
cf-xarray copied to clipboard

Support query

Open malmans2 opened this issue 3 years ago • 2 comments

This is kind of inspired by the way we handle weights. The weights must be DataArrays for xarray, but cf_xarray allows strings so we can do cf.weighted('volume').

How about introducing boolean expressions in cf.where similarly to pandas query? That would allow to do ds.cf.where('longitude > 0') or ds.cf.where('sea_binary_mask').

malmans2 avatar Apr 13 '21 14:04 malmans2

Xarray now has query so we could support standard_name in those strings. Also see #199

dcherian avatar Apr 13 '21 16:04 dcherian

Oh nice, I'll give it a go after the next xarray release.

malmans2 avatar Apr 14 '21 09:04 malmans2