-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support non-NaN nodata values in mosaic
#92
Comments
Thanks I was debating whether or not to open this :) I'm probably OK with just a keyword. I agree that this really needs to be solved upstream in xarray / NumPy. |
I think a keyword is our best stopgap for now, plus maybe storing the metadata. Do you know if there's been any more activity around missing-value support for xarray/NumPy? I haven't kept track for a while. |
gjoseph92
added a commit
that referenced
this issue
Jan 20, 2022
Closes #92. Copied from microsoft/PlanetaryComputer#17 (comment) mostly.
gjoseph92
added a commit
that referenced
this issue
Jan 20, 2022
Closes #92. Copied from microsoft/PlanetaryComputer#17 (comment) mostly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From microsoft/PlanetaryComputerExamples#108 (comment).
Support a
nodata=np.nan
kwarg tostackstac.mosaic
, so you can specify a different nodata value if that's what you're using.The larger problem here is that we're not storing the nodata value in xarray metadata anywhere—just using the xarray convention that NaN is the standard nodata value. But if you set
fill_value
, that's no longer the case.Broadly related to #50: rioxarray has a convention for storing nodata in attributes, which we could follow, it's just convoluted CF-style. A single
nodata
coordinate might be more sensible to xarray users. (The real answer is native missing-value support in xarray though pydata/xarray#4143 pydata/xarray#3955 pydata/xarray#1194.)If we had this,
mosiac
could automatically use the nodata value stored in the data, not requiring you to keep track of it.cc @TomAugspurger
The text was updated successfully, but these errors were encountered: