def on_ok_clicked(self): path = self.lineEdit.text() fmt = self.fmt() print "Would be saving to ", path grid = self.umbra.current_grid() if grid is None: print "No grid selected?!" return if fmt["name"] == "SUNTANS": grid.write_suntans(path) elif fmt["name"] == "pickle": grid.write_pickle(path) elif fmt["name"] == "UGRID": grid.write_ugrid(path) elif fmt["name"] == "DFM": dfm_grid.write_dfm(grid, path) elif fmt["name"] == "UnTRIM": grid.write_untrim08(path)
fname[0]!='_'): for c in other.valid_cell_iter(): old_val=other.cells[fname][c] if fname=='edges': for i in range(len(old_val)): if old_val[i]>=0: old_val[i]=edge_map[old_val[i]] self.cells[fname][node_map[n]]=old_val merge_grid(ug,ug2) ## plt.clf() #ug.plot_edges() ug.plot_cells() plt.axis('equal') ## # ug.renumber() ## dfm_grid.write_dfm(ug,'/home/rusty/models/delft/nms/nms_03/merge_to_stitch_net.nc',overwrite=True)
#coll.set_clim([-50,0]) coll_e=gg.plot_edges(ax=ax,color='0.5',lw=0.2) sel=np.isnan(gg.nodes['depth']) coll_n=gg.plot_nodes(ax=ax,lw=0,mask=sel) coll_n.set_clim([-50,0]) # coll=g.plot_cells(values=g.interp_node_to_cell(g.nodes['depth']),lw=0) ax1.axis('equal') ## if 0: # write without any south bay bathy: # ah, but delta shell does not care for nans. g.nodes['depth'][ np.isnan(g.nodes['depth']) ] = -9999 dfm_grid.write_dfm(g,"SFEI_SSFB_fo_net.nc",overwrite=True) ## import field dem=field.MultiRasterField(['/home/rusty/data/bathy_dwr/gtiff/*.gtiff']) missing=np.isnan(g.nodes['depth']) # This is probably in cm! bathy_missing=dem( g.nodes['x'][missing] ) g.nodes['depth'][missing]=0.01*bathy_missing ## plt.figure(1).clf() colle=g.plot_edges(lw=0.2,color='k')