Ejemplo n.º 1
0
def test_catch_areas():
    fig, ax = plt.subplots()
    gdir = init_hef()
    graphics.plot_catchment_areas(gdir, ax=ax)
    fig.tight_layout()
    return fig
Ejemplo n.º 2
0
Archivo: test.py Proyecto: Nirav11/oggm
list_talks = [
         tasks.compute_centerlines, #Compute the centerlines following Kienholz et al., (2014).
         tasks.initialize_flowlines, #Computes more physical Inversion Flowlines from geometrical Centerlines
         tasks.compute_downstream_line, #Computes the Flowline along the unglaciated downstream topography
         tasks.catchment_area, #Compute the catchment areas of each tributary line.
         tasks.catchment_width_geom, #Compute geometrical catchment widths for each point of the flowlines
         tasks.catchment_width_correction, #Corrects for NaNs and inconsistencies in the geometrical widths.
         tasks.compute_downstream_bedshape #The bedshape obtained by fitting a parabola to the line's normals and downstream altitude
         ]
 
for task in list_talks:
        workflow.execute_entity_task(task, gdirs)

for agdir in gdirs:
    graphics.plot_centerlines(agdir, figsize=(8, 7), use_flowlines=True, add_downstream=True)
    graphics.plot_catchment_areas(agdir, figsize=(8, 7))
    graphics.plot_catchment_width(agdir, corrected=True, figsize=(8, 7))

# Location of Monthly Climate Data for the Glacier
#fpath = gdir.get_filepath('climate_monthly')
#print(fpath)

#ds = xr.open_dataset(fpath)
#print(ds)
# Data is in hydrological years
# -> let's just ignore the first and last calendar years
#ds.temp.resample(time='AS').mean()[1:-1].plot()

plt.show() 

#workflow.execute_entity_task(tasks.local_t_star, gdirs);
Ejemplo n.º 3
0
h2 = h2 / np.sum(h2)

f, axs = plt.subplots(2, 2, figsize=(9, 8))
axs = np.asarray(axs).flatten()

llkw = {'interval': 0}
letkm = dict(color='black',
             ha='right',
             va='top',
             fontsize=18,
             bbox=dict(facecolor='white', edgecolor='black'))
xt, yt = 109.3, 1.5

im = graphics.plot_catchment_areas(gdir,
                                   ax=axs[0],
                                   title='',
                                   lonlat_contours_kwargs=llkw,
                                   add_scalebar=True)

axs[0].text(xt, yt, 'a', **letkm)

graphics.plot_catchment_width(gdir,
                              ax=axs[1],
                              title='',
                              add_colorbar=False,
                              lonlat_contours_kwargs=llkw,
                              add_scalebar=False)
axs[1].text(xt, yt, 'b', **letkm)

graphics.plot_catchment_width(gdir,
                              ax=axs[2],
Ejemplo n.º 4
0
f, axs = plt.subplots(2, 2, figsize=(8.5, 7))
axs = np.asarray(axs).flatten()

llkw = {'interval': 0}
letkm = dict(color='black',
             ha='right',
             va='top',
             fontsize=12,
             bbox=dict(facecolor='white', edgecolor='black'))
xt, yt = 109, 2.

im = graphics.plot_catchment_areas(gdir,
                                   ax=axs[0],
                                   title='',
                                   lonlat_contours_kwargs=llkw,
                                   add_scalebar=True,
                                   lines_cmap=LCMAP,
                                   mask_cmap=MCMAP)

axs[0].text(xt, yt, 'a', **letkm)

graphics.plot_catchment_width(gdir,
                              ax=axs[1],
                              title='',
                              add_colorbar=False,
                              lonlat_contours_kwargs=llkw,
                              add_scalebar=False,
                              lines_cmap=LCMAP)
axs[1].text(xt, yt, 'b', **letkm)
Ejemplo n.º 5
0
def test_catch_areas():
    fig, ax = plt.subplots()
    gdir = init_hef()
    graphics.plot_catchment_areas(gdir, ax=ax)
    fig.tight_layout()
    return fig