Skip to content

Commit

Permalink
fixing specification of min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeezley committed May 8, 2012
1 parent a30fb14 commit 7adb302
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wrf2kmz.py
Expand Up @@ -670,9 +670,12 @@ def getRasterFromArray(self,a,istep=None,hsize=3,dpi=300):
# generate a matplotlib figure object # generate a matplotlib figure object
fig=pylab.figure(figsize=(hsize,hsize*float(a.shape[0])/a.shape[1])) fig=pylab.figure(figsize=(hsize,hsize*float(a.shape[0])/a.shape[1]))
ax=fig.add_axes([0,0,1,1]) ax=fig.add_axes([0,0,1,1])


minmax=self.getMinMax(istep)
if minmax is None:
minmax=(a[a==a].min(),a[a==a].max())
# get a color norm instance from the min/max of a # get a color norm instance from the min/max of a
norm=self._norm(a[a==a].min(),a[a==a].max()) norm=self._norm(minmax[0],minmax[1])


# add image to the axis # add image to the axis
ax.imshow(np.flipud(a),cmap=self._cmap,norm=norm,interpolation='nearest') ax.imshow(np.flipud(a),cmap=self._cmap,norm=norm,interpolation='nearest')
Expand Down Expand Up @@ -923,7 +926,7 @@ class FireRasterFile(object):


# define display styles for individual variables # define display styles for individual variables
_varClasses={ _varClasses={
'FGRNHFX':(LogScaleRaster,{}), 'FGRNHFX':(LogScaleRaster,{'minmax':(1,2)}),
'GRNHFX':(LogScaleRaster,{}), 'GRNHFX':(LogScaleRaster,{}),
'FLINEINT':(NegativeMaskedRaster,{}), 'FLINEINT':(NegativeMaskedRaster,{}),
'FLINEINT2':(NegativeMaskedRaster,{}), 'FLINEINT2':(NegativeMaskedRaster,{}),
Expand Down

0 comments on commit 7adb302

Please sign in to comment.