Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions avaframe/ana1Tests/FPtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ def plotProfilesFPtest(cfg, ind_time, relDict, comSol):

ax1.plot(np.linspace(xllc, xllc+(ncols-1)*csz, ncols), relTh[100, :], '--k')
ax1.plot(r, H0-mu*(r-deltaX), '-k', label='initial expected flow thickness')
ax1.set_xlabel('r in [m]')
ax1.set_xlabel('r in (m)')
ax1.set_title('flow thickness, t=%.2f s' % (Tsave))

ax2.plot(r, mu*np.ones(np.shape(r)), '-k', label='friction threashold')
ax2.set_xlabel('r in [m]')
ax2.set_xlabel('r in (m)')
ax2.set_title('Gradient of the flow thickness')
ax1.legend()
ax2.legend()
Expand Down
16 changes: 8 additions & 8 deletions avaframe/ana1Tests/energyLineTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaPr
ax1 = outCom1DFA.addDem2Plot(ax1, dem, what='hillshade', extent=extent)
ax1.plot(avaProfileMass['x'], avaProfileMass['y'], '-y.', zorder=20, label='Center of mass path',
lw=1, path_effects=[pe.Stroke(linewidth=2, foreground='k'), pe.Normal()])
ax1.set_xlabel('x [m]')
ax1.set_ylabel('y [m]')
ax1.set_xlabel('x (m)')
ax1.set_ylabel('y (m)')
ax1.axis('equal')
ax1.set_ylim([rowsMin, rowsMax])
ax1.set_xlim([colsMin, colsMax])
Expand All @@ -124,7 +124,7 @@ def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaPr
scat = ax2.scatter(avaProfileMass['s'], zEne, marker='s', cmap=cmap, s=8*pU.ms, c=u2Path/(2*g),
label='Center of mass velocity altitude')
cbar2 = ax2.figure.colorbar(scat, ax=ax2, use_gridspec=True)
cbar2.ax.set_title('[' + pU.cfgPlotUtils['unitFT'] + ']', pad=10)
cbar2.ax.set_title('(' + pU.cfgPlotUtils['unitFT'] + ')', pad=10)
cbar2.ax.set_ylabel('Center of mass velocity altitude')

# add alpha line
Expand All @@ -143,8 +143,8 @@ def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaPr
color='r', linestyle='--')
ax2.hlines(y=zIntersection, color='b', xmin=0, xmax=sIntersection, linestyle='--')

ax2.set_xlabel('s [m]')
ax2.set_ylabel('z [m]')
ax2.set_xlabel('s (m)')
ax2.set_ylabel('z (m)')
ax2.set_xlim(sLim)
ax2.set_ylim(zLim)
ax2.legend(loc='upper right')
Expand All @@ -168,7 +168,7 @@ def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaPr
scat = ax3.scatter(avaProfileMass['s'], zEne-z0, marker='s', cmap=cmap, s=8*pU.ms, c=u2Path/(2*g),
label='Center of mass velocity altitude extrapolation')
cbar3 = ax3.figure.colorbar(scat, ax=ax3, use_gridspec=True)
cbar3.ax.set_title('[' + pU.cfgPlotUtils['unitFT'] + ']', pad=10)
cbar3.ax.set_title('(' + pU.cfgPlotUtils['unitFT'] + ')', pad=10)
cbar3.ax.set_ylabel('Center of mass velocity altitude')

# add alpha line
Expand Down Expand Up @@ -201,8 +201,8 @@ def generateCom1DFAEnergyPlot(avalancheDir, energyLineTestCfg, com1DFACfg, avaPr
color='r', linestyle='--')
ax3.hlines(y=zIntersection-z0, color='b', xmin=sMin, xmax=sIntersection, linestyle='--')

ax3.set_xlabel('s [m]')
ax3.set_ylabel('$\Delta z$ [m]')
ax3.set_xlabel('s (m)')
ax3.set_ylabel('$\Delta z$ (m)')
ax3.yaxis.set_label_coords(0, 0.9)
ax3.set_xlim([sMin, sMax])
ax3.set_ylim([zMin, zMax])
Expand Down
8 changes: 4 additions & 4 deletions avaframe/com1DFA/debrisFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,10 @@ def outputHydrographPlot(outputHydrographDF, cfgGen, simHash=""):
ax[0].plot(t, discharge, color="brown")
ax[1].plot(t[1:], volume, color="brown")

ax[0].set_xlabel("time [s]")
ax[0].set_ylabel("discharge [m³/s]")
ax[1].set_xlabel("time [s]")
ax[1].set_ylabel("cumulative volume [m³]")
ax[0].set_xlabel("time (s)")
ax[0].set_ylabel("discharge (m³/s)")
ax[1].set_xlabel("time (s)")
ax[1].set_ylabel("cumulative volume (m³)")
ax[1].set_title(f"total cumulative volume = {np.max(volume):.02f} m³")
plt.suptitle(f"Output hydrograph - {station}")

Expand Down
12 changes: 6 additions & 6 deletions avaframe/com1DFA/testSPH.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,21 @@ def plotGrad(ax, x, xx, particles, ind, mark, count):

fig1, ax1 = plt.subplots(figsize=(figW, figH))
ax1.set_title('h(x)')
ax1.set_xlabel('x [m]')
ax1.set_ylabel('h [m]')
ax1.set_xlabel('x (m)')
ax1.set_ylabel('h (m)')
fig2, ax2 = plt.subplots(figsize=(figW, figH))
ax2.set_title('h(y)')
ax2.set_xlabel('y [m]')
ax2.set_ylabel('h [m]')
ax2.set_xlabel('y (m)')
ax2.set_ylabel('h (m)')
fig3, ax3 = plt.subplots(figsize=(figW, figH))
ax3.set_title('Gradh(x)')
ax3.set_xlabel('x [m]')
ax3.set_xlabel('x (m)')
ax3.set_ylabel('Gradh []')
ax3.set_ylim([-0.02, 0.02])
# ax3.set_ylim([-0.016, 0.016])
fig4, ax4 = plt.subplots(figsize=(figW, figH))
ax4.set_title('Gradh(y)')
ax4.set_xlabel('y [m]')
ax4.set_xlabel('y (m)')
ax4.set_ylabel('Gradh []')
# ax4.set_ylim([-0.02, 0.02])
ax4.set_ylim([-0.016, 0.016])
Expand Down
10 changes: 5 additions & 5 deletions avaframe/out1Peak/outPlotAllPeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def plotAllPeakFields(avaDir, cfgFLAGS, modName, demData=""):
# add title, labels and ava Info
title = str("%s" % name)
ax.set_title(title)
ax.set_xlabel("x [m]")
ax.set_ylabel("y [m]")
ax.set_xlabel("x (m)")
ax.set_ylabel("y (m)")
pU.putAvaNameOnPlot(ax, avaDir)

# save and or show figure
Expand Down Expand Up @@ -320,7 +320,7 @@ def addConstrainedDataField(fileName, resType, demField, ax, cellSize, alpha=1.0
plt.text(
0.5,
0.5,
("[%s]" % unit),
("(%s)" % unit),
horizontalalignment="left",
verticalalignment="center",
transform=cax2.transAxes,
Expand Down Expand Up @@ -414,8 +414,8 @@ def plotAllFields(avaDir, inputDir, outDir, unit="", constrainData=True):

title = str("%s" % name)
ax.set_title(title)
ax.set_xlabel("x [m]")
ax.set_ylabel("y [m]")
ax.set_xlabel("x (m)")
ax.set_ylabel("y (m)")

plotName = "%s" % (name)

Expand Down
12 changes: 6 additions & 6 deletions avaframe/out1Peak/outPlotAllPeakDiffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,14 @@ def plotAreaDiff(
cbar.set_label(resType)

# add labels
ax[0].set_xlabel("x [m]")
ax[0].set_ylabel("y [m]")
ax[0].set_xlabel("x (m)")
ax[0].set_ylabel("y (m)")
ax[0].set_title(title)
ax[1].set_xlabel("x [m]")
ax[1].set_ylabel("y [m]")
ax[1].set_xlabel("x (m)")
ax[1].set_ylabel("y (m)")
ax[1].set_title("Simulation %s" % resType)
ax[2].set_xlabel("x [m]")
ax[2].set_ylabel("y [m]")
ax[2].set_xlabel("x (m)")
ax[2].set_ylabel("y (m)")
ax[2].set_title("Reference mask")

pU.saveAndOrPlot({"pathResult": outDir}, "areaIndicatorAnalysis_%s" % simName, fig)
Expand Down
12 changes: 6 additions & 6 deletions avaframe/out3Plot/amaPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def plotPathAngle(dbData, cfgMain, nameEvent, tickOrigin='orig-transit'):
'r+', markersize=20, label='runout pt')
ax1.plot(row['geom_event_pt3d_%s_snapped' % projstr].x, row['geom_event_pt3d_%s_snapped' % projstr].y,
'r*', markersize=14, label='snapped')
ax1.set_xlabel('x [m]')
ax1.set_ylabel('y [m]')
ax1.set_xlabel('x (m)')
ax1.set_ylabel('y (m)')
ax1.legend(loc='center left', bbox_to_anchor=(1, 0.5))
ax1.set_aspect('equal')

# panel 2 plot xy distance and elevation drop and add angle info
ax21 = fig.add_subplot(122)
ax21.set_title('runout length in $S_{xy}$: %.1f [m], altitude drop: %.1f [m]' % (row['%s_Distance' % nameEvent], row['%s_LineAltDrop' % nameEvent]))
ax21.set_title('runout length in $S_{xy}$: %.1f (m), altitude drop: %.1f (m)' % (row['%s_Distance' % nameEvent], row['%s_LineAltDrop' % nameEvent]))

z2coor = np.asarray([coord[2] for coord in row['geom_path_ln3d_%s' % projstr].coords])
ax21.plot(row['%s_PathDist' % nameEvent], z2coor, '--', color='lightgray', label='thalweg')
Expand Down Expand Up @@ -132,8 +132,8 @@ def plotPathAngle(dbData, cfgMain, nameEvent, tickOrigin='orig-transit'):
ax21.set_xticks(xTicks[1:-1])
ax21.set_xticklabels(ticksFromOrigStr[1:-1])

ax21.set_xlabel('$S_{xy}$ [m]')
ax21.set_ylabel('altitude [m]')
ax21.set_xlabel('$S_{xy}$ (m)')
ax21.set_ylabel('altitude (m)')
ax21.set_aspect('equal')
ax21.legend(loc='center left', bbox_to_anchor=(1, 0.5))

Expand Down Expand Up @@ -177,7 +177,7 @@ def plotHist(dbData, name, cfgMain, colorcode=''):
transform=ax3.transAxes, fontsize=12, horizontalalignment='left',
verticalalignment='bottom', alpha=0.8, bbox=dict(boxstyle="round", ec=(1., 1., 1.),
fc=(1., 1., 1.), alpha=0.5))
ax3.set_xlabel('angle [°]')
ax3.set_xlabel('angle (°)')

# save figure
outFile = ('histogram_%s_angle' % (nameAngle))
Expand Down
4 changes: 2 additions & 2 deletions avaframe/out3Plot/outAB.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ def plotProfile(avaProfile, eqParams, saveOutPath):
fig = plt.figure(figsize=(1.5*pU.figW, 1*pU.figH))
titleText = avaProfile['name']
plt.title(titleText)
xlabelText = 'Distance [m]\nBeta: ' + str(round(beta, 1)) + \
xlabelText = 'Distance (m)\nBeta: ' + str(round(beta, 1)) + \
'°' + ' Alpha: ' + str(round(alpha, 1)) + '°'
plt.xlabel(xlabelText, multialignment='center')
plt.ylabel('Height [m]')
plt.ylabel('Height (m)')
plt.plot(s, z, '-', label='DEM')
plt.plot(s, poly(s), ':', label='QuadFit')
plt.axvline(x=s[indSplit], color='0.7',
Expand Down
Loading
Loading