import pygrib
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
for grb in pygrib.open('../sampledata/eta.grb'):
    if grb['parameterName'] == 'Pressure' and grb['typeOfLevel'] == 'surface':
        data = grb['values']
        lats,lons = grb.latlons()
        break
print lats.min(), lats.max()
print lons.min(), lons.max()
print lats[0,0],lons[0,0]
print lats[-1,-1],lons[-1,-1]
llcrnrlon = lons[0,0]
llcrnrlat = lats[0,0]
urcrnrlon = lons[-1,-1]
urcrnrlat = lats[-1,-1]
rsphere = (grb.projparams['a'], grb.projparams['b'])
lon_0 = grb.projparams['lon_0']
lat_1 = grb.projparams['lat_1']
lat_2 = grb.projparams['lat_2']
projection = grb.projparams['proj']
m = Basemap(llcrnrlon=llcrnrlon,llcrnrlat=llcrnrlat,
            urcrnrlon=urcrnrlon,urcrnrlat=urcrnrlat,rsphere=rsphere,lon_0=lon_0,
            lat_1=lat_1,lat_2=lat_2,resolution='l',projection=projection)
x,y = m(lons, lats)
m.scatter(x.flat,y.flat,3,marker='o',color='k',zorder=10)
m.drawcoastlines()
x,y = m(lons,lats)
m.contourf(x,y,data,15)
plt.title('Lambert Conformal Model Grid')
plt.show()

@@ -84,18 +84,14 @@
 map%0A
-for grb in
+grbs =
  pyg
@@ -127,22 +127,27 @@
 rb')
-:%0A    if grb%5B'
+%0Agrb = grbs.select(
 para
@@ -155,22 +155,17 @@
 eterName
-'%5D == 
+=
 'Pressur
@@ -170,18 +170,9 @@
 ure'
- and grb%5B'
+,
 type
@@ -182,14 +182,9 @@
 evel
-'%5D == 
+=
 'sur
@@ -192,18 +192,13 @@
 ace'
-:%0A        
+)%5B0%5D%0A
 data
@@ -207,32 +207,22 @@
  grb
-%5B'
+.
 values
-'%5D%0A        
+%0A
 lats,
+ 
 lons
@@ -242,22 +242,8 @@
 s()%0A
-        break%0A
 prin
@@ -420,16 +420,16 @@
 %5B-1,-1%5D%0A
-
 urcrnrla
@@ -444,16 +444,66 @@
 %5B-1,-1%5D%0A
+print data.min(), data.max()%0Aprint grb.projparams%0A
 rsphere 

use select method.