I am working on a model that uses pygeoprocssing package. The code is designed to resample all rasters to the scale of dem (about 150m) but I have encountered an error shown below:
(wind_env) document [14:09:26 ~] python code1.py
About to make dirs
Traceback (most recent call last):
File “/home/code1.py”, line 119, in
scaleToRef(rain_days_in_path, scaled_rain_days, dem_file_path)
File “/home/code1.py”, line 63, in scaleToRef
pygp.warp_raster(inputfile_path, [ref_pixel_x,ref_pixel_y],outputfile_path,‘bilinear’, None, None)
File “/home/.conda/envs/wind_env/lib/python3.10/site-packages/pygeoprocessing/geoprocessing.py”, line 1971, in warp_raster
base_raster_info = get_raster_info(base_raster_path)
File “/home/.conda/envs/wind_env/lib/python3.10/site-packages/pygeoprocessing/geoprocessing.py”, line 1604, in get_raster_info
ValueError: Could not open /home/wind_data/2010/month_prcp_day/rain_2010_1.tif as a gdal.OF_RASTER
I don’t know if this error is about the format of the raster “rain_2010_1.tif” or it is a code problem?
I appreciate it if anyone can provide their ideas. Please let me know if you need more information.