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

Facing errors in Land degradation notebook run with different geometry. #154

Closed
click2cloud-SanchitG opened this issue Mar 1, 2024 · 2 comments
Assignees
Labels
local cluster Issues encountered in local cluster notebooks Issues encountered while running the notebooks

Comments

@click2cloud-SanchitG
Copy link

In which step did you encounter the bug?

Notebook execution

Are you using a local or a remote (AKS) FarmVibes.AI cluster?

Local cluster

Bug description

Bug: Scenario 1: Running land degradation with default geometry given in the notebook is working fine.
Scenario 2: Running land degradation with cutomize geometry, its producing the error with the 9th cell of notebook
Below is the 9th cell inputs:

 	request = cimgt.OSM()
 	fig, ax = plt.subplots(figsize=(12,10),
                   subplot_kw=dict(projection=request.crs))

 	ax.add_image(request, 7)
 	clipped[0].plot(ax=ax, alpha=0.9, transform=request.crs, cmap="RdBu")

Output has been provided as an attachment.
[Link of the land degradation notebook](https://github.com/microsoft/farmvibes-ai/blob/main/notebooks/land_degradation/land_degradation.ipynb)

Notebook_9th_cell_error.txt

Steps to reproduce the problem

  1. Run the notebook with below customize geometry and timerange:
    POLYGON ((51.26022142627923 25.40282910148663, 51.26612416152082 25.397875753434136, 51.26315666620698 25.39382551187464, 51.26083427857088 25.393184453989292, 51.25770550633936 25.396447985950743, 51.25906023246108 25.401721900157057, 51.26022142627923 25.40282910148663))
    time_range = (datetime(2017, 1, 1), datetime(2018, 12, 31))

It would be great if we can able to run the notebook with customized geometry.

@click2cloud-SanchitG click2cloud-SanchitG added the bug Something isn't working label Mar 1, 2024
@github-actions github-actions bot added triage Issues still not triaged by team local cluster Issues encountered in local cluster notebooks Issues encountered while running the notebooks labels Mar 1, 2024
@rafaspadilha rafaspadilha self-assigned this Apr 4, 2024
@rafaspadilha rafaspadilha removed the triage Issues still not triaged by team label Apr 4, 2024
@rafaspadilha
Copy link
Contributor

Hello, @click2cloud-SanchitG. Thank you for raising this issue and for the patience in my reply.
I was able to run the notebook with the geometry and time range that you provided and found the same issue.

The problem is not with the workflow or notebook, but with the quality of the output Landsat rasters for this geometry and time range. Below are a few random dates and their landsat and NDVI rasters (I've increased the geometry a bit, to improve the visualization):

Landsat:
image

NDVI:
image

The black/white pixels in Landsat/NDVI rasters show pixels with missing data. This seems to happen in the majority of images. Because of this, the workflow is unable to train the pixel-wise linear trend model. The error that you see happens during plotting the linear trend raster, due to an overflow in the axis definition (because the values in the rasters are very large due to the bad prediction).

To deal with cases like this, a possible workaround is filtering out rasters that have a high percentage of missing data, before feeding it to the NDVI + linear trend ops. You would need to break the landsat_ndvi_trend workflow in two parts: one that downloads Landsat, and another that receives the filtered list of Landsat rasters and perform the remaining tasks of the workflow (NDVI computation + linear trend). In between them, you would filter the bad rasters.

Let me know if you have any doubts or if I can help you with anything else.

@rafaspadilha rafaspadilha removed the bug Something isn't working label Apr 4, 2024
@rafaspadilha
Copy link
Contributor

Closing this issue for now. Let us know if you have any doubts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
local cluster Issues encountered in local cluster notebooks Issues encountered while running the notebooks
Projects
None yet
Development

No branches or pull requests

2 participants