Skip to content

Commit d40840b

Browse files
committed
Use rprofs_averaged instead of computing by hand
1 parent 16184bc commit d40840b

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

stagpy/plates.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -574,16 +574,9 @@ def set_of_vars(arg_plot):
574574

575575
def main_plates(sdat):
576576
"""Plot several plates information."""
577-
# calculating averaged horizontal surface velocity
578-
# needed for redimensionalisation
579-
rlast = sdat.snaps[-1].rprofs
580-
nprof = 0
581-
uprof_averaged = np.zeros_like(rlast['vhrms'].values)
582-
for step in sdat.walk.filter(rprofs=True):
583-
uprof_averaged += step.rprofs['vhrms'].values
584-
nprof += 1
585-
uprof_averaged /= nprof
586-
radius = rlast['r'].values
577+
# averaged horizontal surface velocity needed for redimensionalisation
578+
uprof_averaged, radius, _ = sdat.walk.filter(rprofs=True)\
579+
.rprofs_averaged['vhrms']
587580
if sdat.par['boundaries']['air_layer']:
588581
dsa = sdat.par['boundaries']['air_thickness']
589582
isurf = np.argmin(abs(radius - radius[-1] + dsa))

0 commit comments

Comments
 (0)