1
Fork 0

Update colormap and limits for animate & diff

This commit is contained in:
Edgar P. Burkhart 2022-05-18 10:05:49 +02:00
parent 358338af2e
commit 97c856a73c
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
2 changed files with 7 additions and 5 deletions

View File

@ -107,7 +107,7 @@ u_m = axU.imshow(
U[0], U[0],
cmap="BuPu", cmap="BuPu",
vmin=0, 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()), extent=(x0.min(), x0.max(), z0.min(), z0.max()),
zorder=1, zorder=1,
alpha=np.nan_to_num(AW[0]).clip(0, 1), alpha=np.nan_to_num(AW[0]).clip(0, 1),
@ -116,7 +116,7 @@ ur_m = axU.imshow(
U[0], U[0],
cmap="YlOrBr", cmap="YlOrBr",
vmin=0, 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()), extent=(x0.min(), x0.max(), z0.min(), z0.max()),
zorder=1, zorder=1,
alpha=1 - np.nan_to_num(AW[0]).clip(0, 1), alpha=1 - np.nan_to_num(AW[0]).clip(0, 1),

View File

@ -68,13 +68,14 @@ def get_pickle(out):
models = list(map(get_pickle, args.output)) models = list(map(get_pickle, args.output))
fig, (ax,) = plt.subplots( fig, ax_ = plt.subplots(
len(models), len(models),
figsize=(6, 1.5 * len(models)), figsize=(6, 1.5 * len(models)),
dpi=100, dpi=100,
constrained_layout=True, constrained_layout=True,
squeeze=False, squeeze=False,
) )
ax = ax_[:, 0]
if args.timestep is None: if args.timestep is None:
match args.field: match args.field:
@ -90,9 +91,10 @@ if args.timestep is None:
case "U": case "U":
for i, (_ax, _model) in enumerate(zip(ax, models)): for i, (_ax, _model) in enumerate(zip(ax, models)):
_c = _ax.imshow( _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, vmin=0,
cmap="inferno", vmax=20,
cmap="inferno_r",
extent=( extent=(
_model.t.min(), _model.t.min(),
_model.t.max(), _model.t.max(),