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

sometimes nodata value is incorrect in the original files e.g. fractional_snow_cover #300

Closed
JeroenVerstraelen opened this issue Jun 4, 2024 · 2 comments · Fixed by Open-EO/openeo-geopyspark-driver#795
Assignees

Comments

@JeroenVerstraelen
Copy link
Contributor

JeroenVerstraelen commented Jun 4, 2024

I had a look:
it happens for sentinelhub based collections, that use the default sampletype, which is uint16.
This sampletype is mapped to the default geotrellis uint16 celltype, with 0 as nodata value.

I'm not sure if sentinelhub supports nodata values at all, but it is perhaps best if we can effectively configure it in layercatalog.json.
The 'quickfix' would be to set the default nodata value to something else (short.maxvalue), but that would suddenly change behaviour for a lot of collections. We would have to go over the list and think about it for each one of them.

Other 'quickfix' is to set sample type of fractional snow cover collection to float, this would solve thing in very short term, so maybe I'll start with that.

@JeroenVerstraelen JeroenVerstraelen self-assigned this Jun 4, 2024
@EmileSonneveld EmileSonneveld self-assigned this Jun 5, 2024
@EmileSonneveld
Copy link
Contributor

import openeo
import sys

url = "https://openeo-dev.vito.be"
connection = openeo.connect(url).authenticate_oidc()

snow_cube = connection.load_collection(
    collection_id="FRACTIONAL_SNOW_COVER",
    spatial_extent={
        "west": 11.58,
        "east": 11.68,
        "south": 46.96,
        "north": 46.98,
    },
    temporal_extent=["2018-02-10", "2018-02-13"],
    bands=["NDSI"],
)

job = snow_cube.create_job(title="FRACTIONAL_SNOW_COVER")
job.start_and_wait()
job.get_results().download_files()

The nodata value should change from 0 to 255 for this layer
image

// unless handled differently, NODATA pîxels are 0 according to
// https://docs.sentinel-hub.com/api/latest/user-guides/datamask/#datamask---handling-of-pixels-with-no-data

EmileSonneveld added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Jun 5, 2024
EmileSonneveld added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Jun 5, 2024
EmileSonneveld added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Jun 5, 2024
EmileSonneveld added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Jun 6, 2024
@EmileSonneveld EmileSonneveld linked a pull request Jun 7, 2024 that will close this issue
@EmileSonneveld
Copy link
Contributor

EmileSonneveld commented Jun 14, 2024

Now on openeo-dev:
image
Note that clouds are marked as 205 an can be manually masked away:
snow_cube = (snow_cube * 1.0).mask(snow_cube == 205)
https://collections.sentinel-hub.com/hrsi-fsc/

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 a pull request may close this issue.

2 participants