From 97c856a73cc7a8a2fc77ddde92b6c3e570ed5615 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Wed, 18 May 2022 10:05:49 +0200 Subject: [PATCH] Update colormap and limits for animate & diff --- olaflow/processing/animate.py | 4 ++-- olaflow/processing/diff.py | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/olaflow/processing/animate.py b/olaflow/processing/animate.py index 60c5519..bf89e4d 100644 --- a/olaflow/processing/animate.py +++ b/olaflow/processing/animate.py @@ -107,7 +107,7 @@ u_m = axU.imshow( U[0], cmap="BuPu", vmin=0, - vmax=np.nanmax(np.where(AW > 0.5, U, np.nan), initial=0), + vmax=20, extent=(x0.min(), x0.max(), z0.min(), z0.max()), zorder=1, alpha=np.nan_to_num(AW[0]).clip(0, 1), @@ -116,7 +116,7 @@ ur_m = axU.imshow( U[0], cmap="YlOrBr", vmin=0, - vmax=np.nanmax(np.where(AW > 0.5, U, np.nan), initial=0), + vmax=20, extent=(x0.min(), x0.max(), z0.min(), z0.max()), zorder=1, alpha=1 - np.nan_to_num(AW[0]).clip(0, 1), diff --git a/olaflow/processing/diff.py b/olaflow/processing/diff.py index c9a2454..6263143 100644 --- a/olaflow/processing/diff.py +++ b/olaflow/processing/diff.py @@ -68,13 +68,14 @@ def get_pickle(out): models = list(map(get_pickle, args.output)) -fig, (ax,) = plt.subplots( +fig, ax_ = plt.subplots( len(models), figsize=(6, 1.5 * len(models)), dpi=100, constrained_layout=True, squeeze=False, ) +ax = ax_[:, 0] if args.timestep is None: match args.field: @@ -90,9 +91,10 @@ if args.timestep is None: case "U": for i, (_ax, _model) in enumerate(zip(ax, models)): _c = _ax.imshow( - np.linalg.norm(_model.post_fields[args.func][args.field], axis=2).T, + np.where(_model.post_fields[args.func]["alpha.water"] > 0.5, np.linalg.norm(_model.post_fields[args.func][args.field], axis=2), np.nan).T[::-1], vmin=0, - cmap="inferno", + vmax=20, + cmap="inferno_r", extent=( _model.t.min(), _model.t.max(),