#!/usr/bin/env python 3.6 #This code created May 2023 -TG #Converts NOAA weekly SST tif file to a polygonised temperature contour shape file via gdal import sys import os, subprocess input_file = 'C:/Temp/TCData/Weather/SST/sst_io.latest.tif/sst_io.20230517.tif' output_file = 'C:/Temp/TCData/Weather/SST/sst_io.latest.tif/sst_io.20230517.shp' command = ["C:\\OSGeo4W64\\bin\\gdal_contour.exe", "-b", "1", "-amin", "from_temp", "-amax", "to_temp", "-i", "2.0", '-snodata', "-999", '-off', "0", '-p', input_file, output_file] subprocess.check_call(command)