Skip to content

Support non-NaN nodata values in mosaic #92

@gjoseph92

Description

@gjoseph92

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.

cc @TomAugspurger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions