SMByC / CCD-Plugin

The CCD-Plugin uses Google Earth Engine to get Landsat or Sentinel2 datasets and run the Continuous Change Detection (CCDC) algorithm to analyze the trends and breakpoints of change over multi-year time series at a given coordinate.
GNU General Public License v3.0
39 stars 4 forks source link

Issue in CCD Plugin #11

Closed 21Sraboni closed 6 months ago

21Sraboni commented 6 months ago

I am getting this error when I am trying to get the surface reflectance value of any band using Sentinel 2. But there is no error in case of Landsat. I have reinstalled it, still it is creating issues. The error is given below: "Traceback (most recent call last): File "C:\Users/srabo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\CCD_Plugin\utils\system_utils.py", line 35, in wrapper return func(*args, *kwargs) File "C:\Users/srabo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\CCD_Plugin\utils\system_utils.py", line 91, in wrapper obj_returned = func(args, **kwargs) File "C:\Users/srabo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\CCD_Plugin\gui\CCD_Plugin_dockwidget.py", line 170, in new_plot self.html_file = generate_plot(ccdc_result_info, timeseries, date_range, dataset, band_or_index, CCD_Plugin.tmp_dir) File "C:\Users/srabo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\CCD_Plugin\core\plot.py", line 64, in generate_plot nsegments = len(ccdc_result_info['tBreak'][0]) IndexError: list index out of range"

Thank you.

21Sraboni commented 6 months ago

I used it a few days ago, it was working then, but today it is not working with Sentinel 2.

Screenshot 2024-03-10 163606 Screenshot 2024-03-10 163744
danielm09 commented 6 months ago

Hi @21Sraboni. Thanks for bringing up this malfunction.

I can confirm that the same is happening on my machine.

We did not make any changes to the plugin code recently, so I suspect something is wrong on Google Earth Engine's side.

Upon a brief investigation, I concluded that the Sentinel-2 cloud masking process (s2cloudless) may be causing the error. I'm not sure what is happening exactly, but essentially the masking function seems to be masking all pixels.

I opened an issue in the Earth Engine community repository. As soon as I have some update I'll let you know.

Cheers.

21Sraboni commented 6 months ago

Thank you.

XavierCLL commented 6 months ago

That is weird, Landsat is working like a charm, Sentinel not, it is as if they did some changes in the API for Sentinel ... but not idea, they released a new version of google earth API 3 days ago Thanks @danielm09 for testing it too, where did you open the issue?

danielm09 commented 6 months ago

Hi @XavierCLL. I opened it on the Earth Engine community, but maybe that was not the right place. I also submitted a ticket to GEE support.

I was digging a bit more into this problem and I found that maybe the cause is related to the .select() and .getRegion() functions.

I created this notebook on Colab to showcase the unexpected behavior that I found. I attached it to my ticket to Google.

However, I think it would be good to open an issue on the earth engine api repo.

Update: apparently, it's not possible to create an issue on the ee api repo. Not sure why. I think I'll wait a few more days to see if we get a response from the gee community or Google support. If not, I'll try to figure out a workaround to the problem.

XavierCLL commented 6 months ago

Awesome @danielm09 thanks, good to have a reproducible test code of the problem, let me know any news.

danielm09 commented 6 months ago

Hi @21Sraboni and @XavierCLL.

They rolled back some changes on Google's side and everything seems to be working now.

I executed the Plugin on a couple of sites and it worked fine.

I'm closing the issue.

XavierCLL commented 6 months ago

I just tested and it is working again, definitely, was something related with the API version v0.1.393, and everything is working with the new one v0.1.394. Thanks @danielm09 and @21Sraboni for reporting it.