Error "index 15 is out of bounds for axis 0 with size 15" in SWY model

Hello, NatCap’ers,
Hope you are well. Hope too you could help me easily with this, please.

I’m having an issue with SWY (3.8.9) I guess it can be related with my watersheds layer. When I run the whole set of watersheds, I’m having this kind of error " index is out of bounds". But when I run the same databases only changing the watersheds layer (in fact it is an extract of 3 watersheds from the original watershed layer) the SWY model runs perfectly.
I have seen in other topic people facing and resolving similar situations, and tried to learn from (have checked the biophysical table (seems ok), have also checked layers alignement, and have not found NoData pixels overlaping the DEM ) but with no sucess yet for running SWY with the whole watersheds layer.
I have attached the succesful log, but the crashed is too long (too big file) to attach, so I 'm just reproducing the last log lines below.

"2020-11-17 18:27:18,398 utils._log_gdal_errors(68) ERROR [errno 1] LZWDecode:Corrupted LZW table at scanline 8192
2020-11-17 18:27:18,399 utils._log_gdal_errors(68) ERROR [errno 1] TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,399 utils._log_gdal_errors(68) ERROR [errno 1] D:/SAO_PAULO/InVEST_SWY/teste_bauru6\cache_dir\flow_accum_b6.tif, band 1: IReadBlock failed at X offset 32, Y offset 8: TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,400 utils._log_gdal_errors(68) ERROR [errno 1] LZWDecode:Corrupted LZW table at scanline 8192
2020-11-17 18:27:18,401 utils._log_gdal_errors(68) ERROR [errno 1] TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,401 utils._log_gdal_errors(68) ERROR [errno 1] D:/SAO_PAULO/InVEST_SWY/teste_bauru6\cache_dir\flow_accum_b6.tif, band 1: IReadBlock failed at X offset 32, Y offset 8: TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,402 utils._log_gdal_errors(68) ERROR [errno 1] LZWDecode:Corrupted LZW table at scanline 8192
2020-11-17 18:27:18,402 utils._log_gdal_errors(68) ERROR [errno 1] TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,402 utils._log_gdal_errors(68) ERROR [errno 1] D:/SAO_PAULO/InVEST_SWY/teste_bauru6\cache_dir\flow_accum_b6.tif, band 1: IReadBlock failed at X offset 32, Y offset 8: TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,405 utils._log_gdal_errors(68) ERROR [errno 1] LZWDecode:Corrupted LZW table at scanline 8192
2020-11-17 18:27:18,406 utils._log_gdal_errors(68) ERROR [errno 1] TIFFReadEncodedTile() failed.
2020-11-17 18:27:18,407 utils._log_gdal_errors(68) ERROR [errno 1] D:/SAO_PAULO/InVEST_SWY/teste_bauru6\cache_dir\flow_accum_b6.tif, band 1: IReadBlock failed at X offset 32, Y offset 8: TIFFReadEncodedTile() failed.
2020-11-17 18:27:22,000 Task._call(1174) INFO 44.5% complete
2020-11-17 18:27:28,010 Task._call(1174) INFO 69.9% complete
2020-11-17 18:27:34,028 Task._call(1174) INFO 89.0% complete
2020-11-17 18:27:37,507 Task._call(1174) INFO filter out incomplete divergent streams
2020-11-17 18:27:38,020 Task._call(1174) INFO 100.0% complete
2020-11-17 18:27:38,191 seasonal_water_yield._execute(574) INFO quick flow
2020-11-17 18:27:38,191 seasonal_water_yield._execute(588) INFO loading number of monthly events
2020-11-17 18:27:50,486 geoprocessing.raster_calculator(375) INFO starting stats_worker
2020-11-17 18:27:50,486 geoprocessing.raster_calculator(381) INFO started stats_worker <Thread(Thread-699, started daemon 4928)>
2020-11-17 18:27:50,508 geoprocessing.raster_calculator(486) INFO Waiting for raster stats worker result.
2020-11-17 18:27:50,508 threading.run(870) DEBUG payload is None, terminating
2020-11-17 18:27:50,508 threading.run(870) WARNING No valid pixels were received, sending None.
2020-11-17 18:27:50,508 Task.add_task(731) ERROR Something went wrong when adding task calculate curve number (12), terminating taskgraph.
Traceback (most recent call last):

  • File “site-packages\taskgraph\Task.py”, line 697, in add_task*
  • File “site-packages\taskgraph\Task.py”, line 1174, in _call*
  • File “site-packages\natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 1039, in _calculate_curve_number_raster*
  • File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster_calculator*
  • File “site-packages\natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 1031, in cn_op*
    IndexError: index 15 is out of bounds for axis 0 with size 15
    2020-11-17 18:27:50,508 model._logged_target(1632) ERROR Exception while executing <function execute at 0x235954F8>
    Traceback (most recent call last):
  • File “site-packages\natcap\invest\ui\model.py”, line 1629, in _logged_target*
  • File “site-packages\natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 376, in execute*
  • File “site-packages\natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 640, in _execute*
  • File “site-packages\taskgraph\Task.py”, line 697, in add_task*
  • File “site-packages\taskgraph\Task.py”, line 1174, in _call*
  • File “site-packages\natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 1039, in _calculate_curve_number_raster*
  • File “site-packages\pygeoprocessing\geoprocessing.py”, line 424, in raster_calculator*
  • File “site-packages\natcap\invest\seasonal_water_yield\seasonal_water_yield.py”, line 1031, in cn_op*
    IndexError: index 15 is out of bounds for axis 0 with size 15
    2020-11-17 18:27:50,510 model._logged_target(1635) INFO Execution finished
    2020-11-17 18:27:50,513 utils.prepare_workspace(117) INFO Elapsed time: 11m 22.860000000000014s"

If you think it is the case, I can send the whole data package (including the two watersheds layers) through a link for one of you guys to check it all, please.

Many thanks for your attention,

all the best,
João

InVEST-Seasonal-Water-Yield-log-2020-11-18–17_31_09.txt (32.4 KB)

Hi @jguimaraes,

Thanks for posting. This looks like it could be an error that will be fixed in the upcoming 3.9 version of InVEST.

Could you try downloading the development version and seeing if you get the same error?

https://storage.googleapis.com/releases.naturalcapitalproject.org/invest/3.8.9.post885%2Bg4cda085b/InVEST_3.8.9.post885%2Bg4cda085b_x64_Setup.exe

Let us know!

Cheers,

Doug

1 Like

Many thanks for this really quick reply, Doug!
I’ll certainly try it by tomorrow morning, looks like good news, thanks! I’ll let you know about.

all the best!
João

Dear Doug @dcdenu4 ,
Congratulations, you guys have really fixed SWY model with this development version, it ran without problems for the whole set of watersheds!
I’m happy to have such a great support from you, many many thanks!

Cheers,
João

InVEST-Seasonal-Water-Yield-log-2020-11-18–20_49_05.txt (64.3 KB)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.