Dear all,
I am new to Invest model, I tried to install the source code to run in an IDE, but without success for now. As suggested in the github issue tracker I was able to install something and create a script for the model I am interested in: seasonal water yield.
I would like to test it and therefore to be able to debug it, is there a possibility to debug it?
At the present moment I have an error due, I think, on GDAL installation, here is the error:
ValueError: Could not open D:\development\invest-sample-data\Seasonal_Water_Yield as a gdal.OF_RASTER
The script I am trying to run is the following:
# coding=UTF-8
# -----------------------------------------------
# Generated by InVEST 3.9.0.post282+g36cc3d2e on Tue Mar 9 15:49:28 2021
# Model: Seasonal Water Yield
import logging
import sys
import natcap.invest.seasonal_water_yield.seasonal_water_yield
import natcap.invest.utils
LOGGER = logging.getLogger(__name__)
root_logger = logging.getLogger()
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter(
fmt=natcap.invest.utils.LOG_FMT,
datefmt='%m/%d/%Y %H:%M:%S ')
handler.setFormatter(formatter)
logging.basicConfig(level=logging.INFO, handlers=[handler])
args = {
'workspace_dir': 'D:\development\invest-sample-data\Seasonal_Water_Yield\output',
# 'results_suffix': '',
'threshold_flow_accumulation': '1000',
'et0_dir': 'D:\development\invest-sample-data\Seasonal_Water_Yield\ET0_monthly',
'precip_dir': 'D:\development\invest-sample-data\Seasonal_Water_Yield\Precipitation_monthly',
'dem_raster_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield',
'lulc_raster_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\land_use_gura.tif',
'soil_group_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\soil_group_gura.tif',
'aoi_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\watershed_gura.shp',
'biophysical_table_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\\biophysical_table_gura_SWY.csv',
'rain_events_table_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\\rain_events_gura.csv',
'alpha_m': '1/12',
'beta_i': '1',
'gamma': '1',
'user_defined_local_recharge': 'False',
# 'l_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\',
'user_defined_climate_zones': 'True',
'climate_zone_table_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\climate_zone_table_gura.csv',
'climate_zone_raster_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\climate_zones_gura.tif',
'monthly_alpha': 'False',
'monthly_alpha_path': 'D:\development\invest-sample-data\Seasonal_Water_Yield\monthly_alpha.csv',
'n_workers': '1',
}
if __name__ == '__main__':
natcap.invest.seasonal_water_yield.seasonal_water_yield.execute(args)
I am absolutely not used with python so I really do not understand how to fix this error. I installed the invest model with all the dependencies before. I had a problem with GDAL but it seemed to me that it was solved…
Can anyone help me solving this error and trying to debug the script?
Thanks in advance for the help.
Regards
Silvia