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

Change nodata from rioxarray default to nan in pyramid_reproject #110

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

maxrjones
Copy link
Contributor

Fixes #93

Rasterio (via rioxarray) uses _FillValue as the value to initialize the numpy array for the reprojected output, rather than just as the value for representing missing data when serializing to disk. As shown in #93, users expect missing data instead to be represented by NaNs when in memory. This PR fills the rioxarray nodata values with np.nan.

The _FillValue used for writing the DataTree is set later in add_metadata_and_zarr_encoding.

@maxrjones maxrjones requested a review from norlandrhagen March 11, 2024 22:44
@maxrjones maxrjones self-assigned this Mar 11, 2024
Copy link

codspeed-hq bot commented Mar 11, 2024

CodSpeed Performance Report

Merging #110 will not alter performance

Comparing reset-fill-value (7d74911) with main (948534a)

Summary

✅ 11 untouched benchmarks

🆕 1 new benchmarks

Benchmarks breakdown

Benchmark main reset-fill-value Change
🆕 test_reprojected_pyramid_fill N/A 14.4 s N/A

@norlandrhagen
Copy link
Contributor

Looks great to me @maxrjones! Excited to give it a try in pyramid generation / maps.

@norlandrhagen norlandrhagen merged commit 9d1d0cd into main Mar 12, 2024
9 checks passed
@norlandrhagen norlandrhagen deleted the reset-fill-value branch March 12, 2024 17:40
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.

pyramid_reproject doesn't put NaNs
2 participants