Beispiel #1
0
def test_mfd():
    mg = make_grid()
    fa = FlowAccumulator(mg, flow_director='MFD')
    fa.run_one_step()
    fig = plt.figure()
    drainage_plot(mg)
Beispiel #2
0
def test_steepest():
    mg = make_grid()
    fa = FlowAccumulator(mg)
    fa.run_one_step()
    fig = plt.figure()
    drainage_plot(mg)
Beispiel #3
0
def test_steepest():
    mg = make_grid()
    fa = FlowAccumulator(mg)
    fa.run_one_step()
    plt.figure()
    drainage_plot(mg)
Beispiel #4
0
def test_mfd():
    mg = make_grid()
    fa = FlowAccumulator(mg, flow_director="MFD")
    fa.run_one_step()
    plt.figure()
    drainage_plot(mg)
Beispiel #5
0
    Z = mg.at_node[surface].reshape(mg.shape)
    color = cm.gray((Z - Z.min()) / (Z.max() - Z.min()))
    surf = ax.plot_surface(mg.node_x.reshape(mg.shape),
                           mg.node_y.reshape(mg.shape),
                           Z,
                           rstride=1,
                           cstride=1,
                           facecolors=color,
                           linewidth=0.,
                           antialiased=False)
    ax.view_init(elev=35, azim=-120)
    ax.set_xlabel('X axis')
    ax.set_ylabel('Y axis')
    ax.set_zlabel('Elevation')
    plt.title(title)
    plt.show()


mg1 = RasterModelGrid((10, 10), spacing=(1, 1))
_ = mg1.add_field('topographic__elevation', mg1.node_y, at='node')
surf_plot(mg1, title='Grid 1: A basic ramp')
fd = FlowDirectorSteepest(mg1, 'topographic__elevation')

fd.run_one_step()

receivers = fd.direct_flow()

print(receivers)

drainage_plot(mg1, title='Basic Ramp using FlowDirectorSteepest')