-
Notifications
You must be signed in to change notification settings - Fork 0
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
Discussion: how to handle nodata #31
Comments
Yeah it looks like odc looks for a nodata attribute and rioxarray looks for a I do want to clean up the loaders, they're kind of a mess right now. But part of that is pending this convo |
I'm trying to work through the current handling of nodata values in the It looks like dep-tools/dep_tools/loaders.py Lines 182 to 183 in e2ecdce
But I think this may be used in places, so we should check before removing. So if the metadata exists or the I would like to maintain compatibility with rioxarray, which describes its approach to nodata here. They too keep track of nodata at the DataArray / variable level. Additionally, the |
Another thing to consider is xarray. Officially, xarray only supports An additional concern is propagation of |
There's a mix of compatibility in our current implementation! I know that Xarray is hard to influence... they do a few things that break the work we're doing. Some operations lose the CRS, for example. Being consistent with Maybe it's worth coming up with a consolidated picture between us, and then checking in with others like Robbi and Kirill and influencing in the right place to encourage broader consistency! That's a longer term goal, but will benefit many.
This sounds good to me. |
Right, I intend to take out a lot of our nodata handling, because odc.stac.load (and stackstac, if I ever update that interface) already handle it in a fairly robust manner. In fact, I am planning to take out of a lot of our wrappers around odc.stac.load, because they don't really help. The only operation I'd like to keep is if data are loaded as a float type (potentially non-nan) float values are converted to nan. I may make that optional. Otherwise it's up to us to support propagation of non-nan nodata attribtues. I'll do my best, but I don't really work with non-float xarray objects, until I'm at or very close to writing. |
Good idea :-)
I think we have to in some situations, unfortunately. I really don't want to write intermediate files, and as such, want to keep everything in memory and saving half of a big number of memory makes a significant difference! The GeoMAD for Sentinel-2 for example keeps everything as So, I'm pretty firm on us needing both an |
Well it's a matter of approach too. I almost never bring big float arrays into memory, just chunks. (That was the biggest reason I ended up modifying a lot of the existing coastlines code) |
We currently have a mix of ways of handling
nodata
annotation in xarrays.Some code is using
rio-xarray
and some is using the convention of storing thenodata
value onxr.atts["nodata"
.We should ensure we consume and produce the nodata metadata the same, so we don't need multiple ways of checking, asserting, setting, and consuming nodata values.
The text was updated successfully, but these errors were encountered: