Open-EO / openeo-community-examples

A community-driven effort to make examples, user-defined processes and code snippets available in a single place.
Apache License 2.0
34 stars 6 forks source link

oilspill example in CDSE #17

Closed Pratichhya closed 7 months ago

Pratichhya commented 9 months ago

In this notebook, we want to showcase a basic methodology for mapping oil spills using openEO.

The methodology adopted in the notebook was shown here.

Additionally, the following references were equally helpful when preparing this usecase:

https://forum.step.esa.int/t/steps-for-oil-spill-detection/7428/6 https://ieeexplore.ieee.org/document/1370264

soxofaan commented 9 months ago

from openeo.processes import log

I would not do an from-import like that. "log" is an too-overloaded word to be a globally imported like that. I would just do import openeo.processes and use openeo.processes.log(x) where you need it

filter_window = (np.ones([601, 601])).tolist()

the tolist() is not necessary I think, the python client does this automatically

factor = 1 / 361201

I would calculate the factor directly from the filter_window numpy array (e.g. 1/filter_window.sum()) instead of hardcoding 361201

Let us plot the result

I'm confused by the image. As far as I understand the notebook, oil_spill is a binary image because if the thresholding, but the image looks like grayscale

jdries commented 9 months ago

nice! You could also add raster_to_vector to try and get vector outline of the spill, if it produces something decent of course.

Pratichhya commented 9 months ago

@soxofaan , Thank you for all the suggestions, changes have been made and indeed, yes, it was supposed to be a binary image.

@jdries I tried to add the raster_to_vector process too; however, it fails with a different error when trying to execute the process with either CSV or NetCDF format, and JSON doesn't give interpretative result(or I wasn't able to understand it). I am not sure if I need to include additional processes to get the vector data.

Pratichhya commented 8 months ago

resolved merge conflict

Pratichhya commented 7 months ago

@soxofaan, as discussed earlier, I will have to share fixed links for a couple of use cases, so I will merge them at this point after first reviewing the version and then changing them when needed. However, it seems like I would need at least one approval to merge 😅

Pratichhya commented 7 months ago

Sure @jdries thank you.

Also, if possible, can you allow for #20 for the initial merge?