indleft = operator.and_(hgrd.mark>0, hgrd.xe < xmin) # all boundaries grd.mark[indleft]=2 indright = operator.and_(hgrd.mark>0, hgrd.xe > xmax) # all boundaries grd.mark[indright]=2 edgefile = suntanspath+'/edges.dat' grd.saveEdges(edgefile) print 'Updated markers written to: %s'%(edgefile) ######################################### # Interpolate the depths onto the grid ######################################### y_hat,idx = grd.find_nearest_boundary(markertype=1) y_hat[grd.yv>b+w]=1e15 grd.dv = calc_depth2(y_hat,hmin,hmax,w) #grd.dv = calc_depth(grd.xv,grd.yv,hmin,hmax,w) grd.saveBathy('%s/depths.dat-voro'%suntanspath) #Load the boundary object from the grid # Note that this zeros all of the boundary arrays bnd = Boundary(suntanspath,(starttime,endtime,dt)) bnd.setDepth(grd.dv) # Try out a linear interpolation #y0 = bnd.ye.min() #y1 = bnd.ye.max()
indleft = operator.and_(hgrd.mark > 0, hgrd.xe < xmin) # all boundaries grd.mark[indleft] = 2 indright = operator.and_(hgrd.mark > 0, hgrd.xe > xmax) # all boundaries grd.mark[indright] = 2 edgefile = suntanspath + '/edges.dat' grd.saveEdges(edgefile) print 'Updated markers written to: %s' % (edgefile) ######################################### # Interpolate the depths onto the grid ######################################### y_hat, idx = grd.find_nearest_boundary(markertype=1) y_hat[grd.yv > b + w] = 1e15 grd.dv = calc_depth2(y_hat, hmin, hmax, w) #grd.dv = calc_depth(grd.xv,grd.yv,hmin,hmax,w) grd.saveBathy('%s/depths.dat-voro' % suntanspath) #Load the boundary object from the grid # Note that this zeros all of the boundary arrays bnd = Boundary(suntanspath, (starttime, endtime, dt)) bnd.setDepth(grd.dv) # Try out a linear interpolation #y0 = bnd.ye.min() #y1 = bnd.ye.max() #du = 0.0 #dy = y1-y0 #Utst = (bnd.ye.ravel()-y0)/dy*du