I'm trying to run gdalwarp from within a python script
start = "gdalwarp -overwrite -ts 22 20 -r average -srcnodata 99 " input_file = filename[12:] output_file = "temp1.tif" print start + input_file + ' ' +output_file subprocess.call([r'%s %s output.tif' % (start, input_file)], shell=True )
filename changes iteratively (i'm batch processing and this is the first step). However when i run the script i get for example:
ERROR 4: `200301.h11v09.tif' not recognised as a supported file format.
But when i run the code on
200301.h11v09.tif in terminal it works perfectly. I feel like it's something to do with python string substitution but don't know enough to figure out myself now.