def create_sts_boundary(filename,verbose=False): from Scientific.IO.NetCDF import NetCDFFile from Numeric import asarray,transpose,sqrt,argmax,argmin,arange,Float,\ compress,zeros,fabs fid = NetCDFFile(filename+'.sts', 'r') #Open existing file for read x = fid.variables['x'][:]+fid.xllcorner #x-coordinates of vertices y = fid.variables['y'][:]+fid.yllcorner #y-coordinates of vertices coordinates=transpose(asarray([x.tolist(),y.tolist()])) #find indices of the southernmost gauges #if more than one find gauges furthest left #will fail if domain crosses 180 degrees #i.e. if left most most point is not west i.e x=1 and other points 1701: #find most western gauge for i,south_index in enumerate(south_indices[1:]): if x[south_index]