Skip to content

Commit 87e804f

Browse files
committed
Rm field.interpolate option
This produces a smoothed picture that is misleading in terms of how well the run is resolved.
1 parent 0e8e845 commit 87e804f

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

stagpy/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class Field(Section):
104104
doc="shift plot horizontally", in_file=False
105105
)
106106
timelabel: bool = switch_opt(False, None, "add label with time")
107-
interpolate: bool = switch_opt(False, None, "apply Gouraud shading")
108107
colorbar: bool = switch_opt(True, None, "add color bar to plot")
109108
ix: Optional[int] = MaybeEntry(int).entry(
110109
doc="x-index of slice for 3D fields", in_file=False

stagpy/field.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,12 @@ def plot_scalar(
194194
if step.geom.threed and step.geom.spherical:
195195
raise NotAvailableError("plot_scalar not implemented for 3D spherical geometry")
196196

197-
xmesh, ymesh, fld, meta = get_meshes_fld(
198-
step, var, walls=not conf.field.interpolate
199-
)
197+
xmesh, ymesh, fld, meta = get_meshes_fld(step, var, walls=True)
200198
# interpolate at cell centers, this should be abstracted by field objects
201199
# via an "at_cell_centers" method or similar
202200
if fld.shape[0] > max(step.geom.nxtot, step.geom.nytot):
203201
fld = (fld[:-1] + fld[1:]) / 2
204202

205-
if conf.field.interpolate and step.geom.spherical and step.geom.twod_yz:
206-
# add one point to close spherical annulus
207-
xmesh = np.concatenate((xmesh, xmesh[:1]), axis=0)
208-
ymesh = np.concatenate((ymesh, ymesh[:1]), axis=0)
209-
newline = (fld[:1] + fld[-1:]) / 2
210-
fld = np.concatenate((fld, newline), axis=0)
211203
xmin, xmax = xmesh.min(), xmesh.max()
212204
ymin, ymax = ymesh.min(), ymesh.max()
213205

@@ -243,7 +235,7 @@ def plot_scalar(
243235
vmax=conf.plot.vmax,
244236
norm=mpl.colors.LogNorm() if var == "eta" else None,
245237
rasterized=conf.plot.raster,
246-
shading="gouraud" if conf.field.interpolate else "flat",
238+
shading="flat",
247239
)
248240
extra_opts.update(extra)
249241
surf = axis.pcolormesh(xmesh, ymesh, fld, **extra_opts)

0 commit comments

Comments
 (0)