Skip to content
Snippets Groups Projects
Commit 8c74831a authored by Andreas Freise's avatar Andreas Freise
Browse files

changing ==None to is None, to make compatible with python 3

parent b184418f
No related branches found
No related tags found
No related merge requests found
...@@ -29,7 +29,7 @@ class surfacemap(object): ...@@ -29,7 +29,7 @@ class surfacemap(object):
self.scaling = scaling self.scaling = scaling
self.__interp = None self.__interp = None
if data == None: if data is None:
self.data = np.zeros(size) self.data = np.zeros(size)
else: else:
self.data = data self.data = data
...@@ -111,10 +111,10 @@ class surfacemap(object): ...@@ -111,10 +111,10 @@ class surfacemap(object):
def z_xy(self, x=None, y=None, wavelength=1064e-9, direction="reflection", nr1=1.0, nr2=1.0): def z_xy(self, x=None, y=None, wavelength=1064e-9, direction="reflection", nr1=1.0, nr2=1.0):
if x == None and y == None: if x is None and y is None:
data = self.scaling * self.data data = self.scaling * self.data
else: else:
if self.__interp == None: if self.__interp is None:
self.__interp = interp2d(self.x, self.y, self.data * self.scaling) self.__interp = interp2d(self.x, self.y, self.data * self.scaling)
data = self.__interp(x, y) data = self.__interp(x, y)
...@@ -201,7 +201,7 @@ class surfacemap(object): ...@@ -201,7 +201,7 @@ class surfacemap(object):
import pylab import pylab
if xlim != None: if xlim is not None:
_x = np.logical_and(self.x<=max(xlim)/100.0, self.x>=min(xlim)/100.0) _x = np.logical_and(self.x<=max(xlim)/100.0, self.x>=min(xlim)/100.0)
xmin = np.min(np.where(_x == True)) xmin = np.min(np.where(_x == True))
xmax = np.max(np.where(_x == True)) xmax = np.max(np.where(_x == True))
...@@ -210,7 +210,7 @@ class surfacemap(object): ...@@ -210,7 +210,7 @@ class surfacemap(object):
xmax = len(self.x)-1 xmax = len(self.x)-1
xlim = [self.x.min()*100, self.x.max()*100] xlim = [self.x.min()*100, self.x.max()*100]
if ylim != None: if ylim is not None:
_y = np.logical_and(self.y<=max(ylim)/100.0, self.y>=min(ylim)/100.0) _y = np.logical_and(self.y<=max(ylim)/100.0, self.y>=min(ylim)/100.0)
ymin = np.min(np.where(_y == True)) ymin = np.min(np.where(_y == True))
ymax = np.max(np.where(_y == True)) ymax = np.max(np.where(_y == True))
...@@ -231,15 +231,15 @@ class surfacemap(object): ...@@ -231,15 +231,15 @@ class surfacemap(object):
pylab.xlabel('x [cm]') pylab.xlabel('x [cm]')
pylab.ylabel('y [cm]') pylab.ylabel('y [cm]')
if xlim != None: pylab.xlim(xlim) if xlim is not None: pylab.xlim(xlim)
if ylim != None: pylab.ylim(ylim) if ylim is not None: pylab.ylim(ylim)
pylab.title('Surface map {0}, type {1}'.format(self.name, self.type)) pylab.title('Surface map {0}, type {1}'.format(self.name, self.type))
cbar = fig.colorbar(axes) cbar = fig.colorbar(axes)
cbar.set_clim(zmin, zmax) cbar.set_clim(zmin, zmax)
if clabel != None: if clabel is not None:
cbar.set_label(clabel) cbar.set_label(clabel)
if show: if show:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment