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

Investigate NaN pixels in DEM #141

Closed
kvantricht opened this issue Aug 30, 2024 · 6 comments · Fixed by Open-EO/openeo-geotrellis-extensions#322
Closed

Investigate NaN pixels in DEM #141

kvantricht opened this issue Aug 30, 2024 · 6 comments · Fixed by Open-EO/openeo-geotrellis-extensions#322
Assignees
Labels
bug Something isn't working

Comments

@kvantricht
Copy link
Contributor

By accident stumbled upon a weird DEM result for a patch extraction in Russia, generated in job j-240830089c57467a8873ee79c0c5a6d2. COP-DEM is a non-temporal band but gets replicated along the t axis. However, some nodata patches appear, but only in the first temporal element. Visually in RGB the first 2 temporal bands look like:

Image

And a timeseries in one of these red patches looks like:

Image

We should find out why this first element is nodata.

@kvantricht kvantricht added the bug Something isn't working label Aug 30, 2024
@kvantricht
Copy link
Contributor Author

Reproduce DEM + S2 for this case without GFMAP and see if the issue persists.

@jdries
Copy link
Contributor

jdries commented Sep 19, 2024

The gaps in the dem seem to coincide with the gaps due to clouds in sentinel-2.
The sentinel-1 bands for first date are also fully nodata, not sure if that is normal.

Joining the DEM cube to the temporal cube will only give results at timesteps where the temporal cube has data, hence the issue.
This is also another side effect of optimizing away tiles that are fully nodata.

Image

@kvantricht
Copy link
Contributor Author

No clue why for S1 this would be the case. For S2: we don't interpolate, because Presto handles missing data natively. However, for DEM this is not the case. By the way:

Joining the DEM cube to the temporal cube will only give results at timesteps where the temporal cube has data, hence the issue.

Is that really true? Because we don't interpolate optical, S2 has more no data timesteps, while DEM only has missing data in the first one. And the real question then is: how can we work around this?

@jdries
Copy link
Contributor

jdries commented Sep 19, 2024

I believe the missing S1 is the real issue, it's a monthly composite, so there should really be data, and also Copernicus Browser seems to confirm this. When that is solved, I expect the DEM to also appear.

The missing S1 is the problem, and it's also normal: the date range starts at 07-30, and first available sentinel-1 is: S1A_IW_GRDH_1SDV_20200802T031408_20200802T031433_033722_03E88C_66C6_COG.SAFE

@jdries
Copy link
Contributor

jdries commented Sep 19, 2024

Ok, I found what we can improve:
https://github.com/Open-EO/openeo-geotrellis-extensions/blob/a201d12defcf6d3558ac18816646d49164c77356/openeo-geotrellis/src/main/scala/org/openeo/geotrellis/OpenEOProcesses.scala#L568

the apply_dimension on bands which is done on the aggregated Sentinel-1 data, will remove all tiles that are fully nodata.
It is actually cleaner to replace them with our internal 'empty tile', allowing subsequent operations to still fill in the nodata if needed.

This might have a small performance impact, but seems better for correctness and not giving unexpected results like this one.

@kvantricht
Copy link
Contributor Author

I believe the missing S1 is the real issue, it's a monthly composite, so there should really be data, and also Copernicus Browser seems to confirm this. When that is solved, I expect the DEM to also appear.

The missing S1 is the problem, and it's also normal: the date range starts at 07-30, and first available sentinel-1 is: S1A_IW_GRDH_1SDV_20200802T031408_20200802T031433_033722_03E88C_66C6_COG.SAFE

this is now fixed on our client side already, where we enforce start date as start of the month.
however, with the recent absence of S1 in some regions, this problem will reoccur, so we can't trust the S1 cube to always have data.

jdries added a commit to Open-EO/openeo-geotrellis-extensions that referenced this issue Sep 19, 2024
… replace them with 'empty' tile. This avoids issues in subsequent merge_cubes with spatial cube or linear interpolation over time.

WorldCereal/worldcereal-classification#141
jdries added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Sep 25, 2024
bossie added a commit to Open-EO/openeo-geopyspark-driver that referenced this issue Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants