-
Notifications
You must be signed in to change notification settings - Fork 52
Description
From microsoft/PlanetaryComputerExamples#108 (comment).
Support a nodata=np.nan kwarg to stackstac.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.