from anuga.utilities.numerical_tools import ensure_numeric from Scientific.IO.NetCDF import NetCDFFile from Numeric import asarray,transpose,sqrt,argmax,argmin,arange,Float,\ compress,zeros,fabs,allclose,ones from anuga.utilities.polygon import inside_polygon,read_polygon from os import sep from time import localtime, strftime, gmtime from anuga.shallow_water.data_manager import urs2sts,create_sts_boundary import os def create_sts_boundary_order_file(urs_filename,order_filename,sts_filename,verbose=False): """ Note This is not a robust algorithm. Be Careful when applying that polygon does not intersect itself and that resulting boundary actually follows the path it is supposed too. """ from anuga.shallow_water.data_manager import read_mux2_py times, y, x, elevation, quantity, starttime = read_mux2_py([urs_filename],weights=ones(1,Float)) #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]