Skip to content

Commit d74f5b3

Browse files
committed
Improve plots in vzcheck mode of plates
1 parent 3c649a6 commit d74f5b3

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

stagpy/plates.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -770,25 +770,23 @@ def cmd():
770770
time.append(step.timeinfo.loc['t'])
771771
istart = step.isnap if istart is None else istart
772772
iend = step.isnap
773+
phi = step.geom.p_centers
773774
limits, nphi, dvphi, vphi_surf = detect_plates_vzcheck(step)
774775
limits.sort()
775-
sizeplates = [limits[0] + nphi - limits[-1]]
776+
sizeplates = [phi[limits[0]] + 2 * np.pi - phi[limits[-1]]]
776777
for lim in range(1, len(limits)):
777-
sizeplates.append(limits[lim] - limits[lim - 1])
778-
lim = len(limits) * [max(dvphi)]
779-
fig = plt.figure()
780-
plt.subplot(311)
781-
plt.axis([0, nphi,
782-
np.min(vphi_surf) * 1.2, np.max(vphi_surf) * 1.2])
783-
plt.plot(vphi_surf)
784-
plt.subplot(312)
785-
plt.axis(
786-
[0, nphi,
787-
np.min(dvphi) * 1.2, np.max(dvphi) * 1.2])
788-
plt.plot(dvphi)
789-
plt.scatter(limits, lim, color='red')
790-
plt.subplot(313)
791-
plt.hist(sizeplates, 10, (0, nphi / 2))
778+
sizeplates.append(phi[limits[lim]] - phi[limits[lim - 1]])
779+
phi_lim = [phi[i] for i in limits]
780+
dvp_lim = [dvphi[i] for i in limits]
781+
fig, axes = plt.subplots(nrows=3, sharex=True, figsize=(6.4, 9.6))
782+
axes[0].plot(step.geom.p_walls, vphi_surf)
783+
axes[0].set_ylabel(r"Horizontal velocity $v_\phi$")
784+
axes[1].plot(step.geom.p_walls, dvphi)
785+
axes[1].set_ylabel(r"$dv_\phi/d\phi$")
786+
axes[1].scatter(phi_lim, dvp_lim, color='red')
787+
axes[2].hist(sizeplates, 10, (0, np.pi))
788+
axes[2].set_ylabel("Number of plates (size)")
789+
axes[2].set_xlabel(r"$\phi$")
792790
saveplot(fig, 'plates', step.isnap)
793791

794792
nb_plates.append(len(limits))

0 commit comments

Comments
 (0)