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

SENTINEL2_L2A with mask_scl_dilation gives empty data #385

Open
EmileSonneveld opened this issue Mar 31, 2023 · 9 comments
Open

SENTINEL2_L2A with mask_scl_dilation gives empty data #385

EmileSonneveld opened this issue Mar 31, 2023 · 9 comments

Comments

@EmileSonneveld
Copy link
Contributor

An issue raised by Stijn. Requesting this simplified process graph results in an empty data cube.
When giving it a bigger date range, there are correct looking results.

import openeo
import json

connection = openeo.connect("openeo-dev.vito.be").authenticate_oidc()

job_options = {
    "executor-memory": "8G",
    "executor-memoryOverhead": "8G",
    "executor-cores": "4",
}

true = True
false = False
null = None
job = connection.create_job(
    title="Large",
    additional=job_options,
    process_graph={
        "process_graph": {
            "loadcollection1": {
                "arguments": {
                    "bands": [
                        "B04",
                        "B08",
                        "SCL"
                    ],
                    "id": "SENTINEL2_L2A",
                    "properties": {
                        "eo:cloud_cover": {
                            "process_graph": {
                                "lte1": {
                                    "arguments": {
                                        "x": {
                                            "from_parameter": "value"
                                        },
                                        "y": 95
                                    },
                                    "process_id": "lte",
                                    "result": true
                                }
                            }
                        }
                    },
                    "spatial_extent": {
                        "east": 5.080232620239258,
                        "north": 51.234084900561015,
                        "south": 51.20946446493662,
                        "west": 5.034656524658203
                    },
                    "temporal_extent": [
                        # "2021-07-21", # Smaller range gives results 
                        # "2021-08-01"  # Smaller range gives results 
                        "2021-04-12", # Big range gives empty result
                        "2021-10-20"  # Big range gives empty result
                    ]
                },
                "process_id": "load_collection"
            },
            "maskscldilation1": {
                "arguments": {
                    "data": {
                        "from_node": "loadcollection1"
                    },
                    "erosion_kernel_size": 3,
                    "kernel1_size": 17,
                    "kernel2_size": 77,
                    "mask1_values": [2,4,5,6,7],
                    "mask2_values": [3,8,9,10,11],
                    "scl_band_name": "SCL"
                },
                "process_id": "mask_scl_dilation"
            },
            "saveresult1": {
                "arguments": {
                    "data": {
                        "from_node": "maskscldilation1"
                    },
                    "format": "gtiff"
                },
                "process_id": "save_result",
                "result": true
            }
        }
    })
job.start_and_wait()
job.get_results().download_files(job.job_id)
@EmileSonneveld
Copy link
Contributor Author

There is an error message in the empty case: Error communicating with MapOutputTracker. This could be related. I tried running the task with more memory, but the problem is still there.

@jdries
Copy link
Contributor

jdries commented Mar 31, 2023 via email

@EmileSonneveld
Copy link
Contributor Author

Totally not sure about this, but could this be related to the ephemeral-volumes? That some temporary data gets lost before giving the result to the user?

@EmileSonneveld
Copy link
Contributor Author

This might also be the issue. When the code falls back or not to sentinelhub:
image

@jdries
Copy link
Contributor

jdries commented Mar 31, 2023 via email

@jdries
Copy link
Contributor

jdries commented Mar 31, 2023

I didn't know that the user was setting custom params, but without them, I do get results...

@EmileSonneveld
Copy link
Contributor Author

EmileSonneveld commented Mar 31, 2023 via email

@jdries
Copy link
Contributor

jdries commented Apr 3, 2023

It's mostly the kernel1 size and erosion kernel size that trigger the issue.
For fast debuggin:

  • set max cloud cover to a lower value
  • use synchronous jobs
  • reduce to 2 bands (e.g. only B04)

jdries added a commit to Open-EO/openeo-geotrellis-extensions that referenced this issue Apr 3, 2023
@jdries
Copy link
Contributor

jdries commented Apr 3, 2023

Sentinelhub and creodias load sentinel-2 data as unsigned short, while terrascope used signed short.
The scl masking process was depending on being able to have negative values at some point (specific to new erosion feature), which did not work well with unsigned type.

jdries added a commit to Open-EO/openeo-geotrellis-extensions that referenced this issue Apr 4, 2023
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

No branches or pull requests

2 participants