We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flag_meanings
This would be cool and particularly useful with regionmask
regionmask
cc @mathause
The text was updated successfully, but these errors were encountered:
That would be super cool! Would need to decide if the flag_values are kept as well. I assume you would add this in da.cf.groupby(groups)?
flag_values
da.cf.groupby(groups)
A short example (using regionmask - could of course be simplified to only using xarray):
import cf_xarray import regionmask import xarray as xr air = xr.tutorial.open_dataset("air_temperature") mask = regionmask.defined_regions.ar6.land.mask(air) regional_mean = air.air.groupby(mask).mean() regional_mean = regional_mean.assign_coords({mask.name: mask.attrs["flag_values"]}) regional_mean = regional_mean.assign_coords({"flags": mask.attrs["flag_meanings"]}) # or regional_mean = regional_mean.assign_coords({mask.name: mask.attrs["flag_meanings"]})
Sorry, something went wrong.
No branches or pull requests
This would be cool and particularly useful with
regionmask
cc @mathause
The text was updated successfully, but these errors were encountered: