@@ -2835,7 +2835,7 @@ def pcolor(self,x,y,data,tri=False,**kwargs):
2835
2835
raise ImportError (msg )
2836
2836
# for unstructured grids, toss out points outside
2837
2837
# projection limb (don't use those points in triangulation).
2838
- if hasattr (data , 'mask' ):
2838
+ if ma . isMA (data ):
2839
2839
data = data .filled (fill_value = 1.e30 )
2840
2840
masked = True
2841
2841
else :
@@ -2925,7 +2925,7 @@ def contour(self,x,y,data,*args,**kwargs):
2925
2925
raise ImportError (msg )
2926
2926
# for unstructured grids, toss out points outside
2927
2927
# projection limb (don't use those points in triangulation).
2928
- if hasattr (data , 'mask' ):
2928
+ if ma . isMA (data ):
2929
2929
data = data .filled (fill_value = 1.e30 )
2930
2930
masked = True
2931
2931
else :
@@ -3010,7 +3010,7 @@ def contourf(self,x,y,data,*args,**kwargs):
3010
3010
raise ImportError (msg )
3011
3011
# for unstructured grids, toss out points outside
3012
3012
# projection limb (don't use those points in triangulation).
3013
- if hasattr (data , 'mask' ):
3013
+ if ma . isMA (data ):
3014
3014
data = data .filled (fill_value = 1.e30 )
3015
3015
masked = True
3016
3016
else :
@@ -3955,11 +3955,11 @@ def shiftgrid(lon0,datain,lonsin,start=True,cyclic=360.0):
3955
3955
raise ValueError ('lon0 outside of range of lonsin' )
3956
3956
i0 = np .argmin (np .fabs (lonsin - lon0 ))
3957
3957
i0_shift = len (lonsin )- i0
3958
- if hasattr (datain , 'mask' ):
3958
+ if ma . isMA (datain ):
3959
3959
dataout = ma .zeros (datain .shape ,datain .dtype )
3960
3960
else :
3961
3961
dataout = np .zeros (datain .shape ,datain .dtype )
3962
- if hasattr (lonsin , 'mask' ):
3962
+ if ma . isMA (lonsin ):
3963
3963
lonsout = ma .zeros (lonsin .shape ,lonsin .dtype )
3964
3964
else :
3965
3965
lonsout = np .zeros (lonsin .shape ,lonsin .dtype )
@@ -3982,13 +3982,13 @@ def addcyclic(arrin,lonsin):
3982
3982
"""
3983
3983
nlats = arrin .shape [0 ]
3984
3984
nlons = arrin .shape [1 ]
3985
- if hasattr (arrin , 'mask' ):
3985
+ if ma . isMA (arrin ):
3986
3986
arrout = ma .zeros ((nlats ,nlons + 1 ),arrin .dtype )
3987
3987
else :
3988
3988
arrout = np .zeros ((nlats ,nlons + 1 ),arrin .dtype )
3989
3989
arrout [:,0 :nlons ] = arrin [:,:]
3990
3990
arrout [:,nlons ] = arrin [:,0 ]
3991
- if hasattr (lonsin , 'mask' ):
3991
+ if ma . isMA (lonsin ):
3992
3992
lonsout = ma .zeros (nlons + 1 ,lonsin .dtype )
3993
3993
else :
3994
3994
lonsout = np .zeros (nlons + 1 ,lonsin .dtype )
0 commit comments