From c78aefeb4ea8f2fa5b47befa33d6cb3ad9e7bc82 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 8 Jun 2013 22:54:55 -0400 Subject: [PATCH] More vis fixes --- sumpy/layerpot.py | 1 - sumpy/visualization.py | 22 ++++++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/sumpy/layerpot.py b/sumpy/layerpot.py index 48488e5d..cb0c5d3c 100644 --- a/sumpy/layerpot.py +++ b/sumpy/layerpot.py @@ -219,7 +219,6 @@ class LayerPotential(LayerPotentialBase): """ cknl = self.get_compiled_kernel() - #print cknl.code for i, dens in enumerate(strengths): kwargs["strength_%d" % i] = dens diff --git a/sumpy/visualization.py b/sumpy/visualization.py index 90677359..5f311595 100644 --- a/sumpy/visualization.py +++ b/sumpy/visualization.py @@ -85,7 +85,7 @@ class FieldPlotter: from pytools import product self.npoints = product(npoints) - def show_scalar_in_matplotlib(self, fld, maxval=None, + def show_scalar_in_matplotlib(self, fld, max_val=None, func_name="imshow", **kwargs): if len(self.a) != 2: raise RuntimeError( @@ -94,9 +94,9 @@ class FieldPlotter: if len(fld.shape) == 1: fld = fld.reshape(self.nd_points.shape[1:]) - if maxval is not None: - fld[fld > maxval] = maxval - fld[fld < -maxval] = -maxval + if max_val is not None: + fld[fld > max_val] = max_val + fld[fld < -max_val] = -max_val kwargs["extent"] = ( # (left, right, bottom, top) @@ -126,20 +126,14 @@ class FieldPlotter: write_structured_grid(file_name, self.nd_points_axis_first, point_data=list(separate_by_real_and_imag(data, real_only))) - def show_scalar_in_mayavi(self, fld, maxval=None, **kwargs): - if maxval is not None: - fld[fld > maxval] = maxval - fld[fld < -maxval] = -maxval + def show_scalar_in_mayavi(self, fld, max_val=None, **kwargs): + if max_val is not None: + fld[fld > max_val] = max_val + fld[fld < -max_val] = -max_val if len(fld.shape) == 1: fld = fld.reshape(self.nd_points.shape[1:]) - print self.nd_points[0].shape - print self.nd_points[1].shape - print fld.shape - - print kwargs - from mayavi import mlab mlab.surf(self.nd_points[0], self.nd_points[1], fld, **kwargs) -- GitLab