Skip to content
New issue

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

use float32 as mask in rasterize #77

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

martinfleis
Copy link
Member

We certainly don't need to create the mask as float64. To keep the missing values masked using np.nan, switching only to float32. We could, in theory, use something like int16 but then we would need to map missing values to -1 or something and treat them later. If we do that before passing to the groupby, then we need a where mask resulting in another float32 array (once masked), so there's no point. We could also remove -1 after groupby but then we're doing aggregation on stuff we don't care about. So let's stick with float32 for now.

Closes #76

@martinfleis martinfleis merged commit ba7ef28 into xarray-contrib:main Aug 23, 2024
9 checks passed
@martinfleis martinfleis deleted the float32-mask branch August 23, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set output data type in zonal_stats
1 participant