I have a file now, that I created from a NCEP grib file. I'm trying to get the land sea mask and the veg types into 0.5x0.5 lat/lon regular grids. However, they are still in Gaussian Grids, but at least I have it assembled into netcdf files! I'll follow up on a post about the conversion. but I would be interested in knowing if what I have done below fits the 'Convention 1.4' definitions:
In [64]: vegtype = grbs.select(name='Vegetation Type')[0] In [65]: vlats,vlons = vegtype.latlons() In [67]: vtypes = vegtype.values In [70]: vtypes.shape Out[70]: (880, 1760) In [89]: nco = NetCDFFile('/wrk/jfb/DATASETS_TEMPLATES/JFB_vegtypes.nc','w',format='NETCDF4',zlib=True) In [91]: nco.createDimension('nrows', 880) Out[91]: <netCDF4.Dimension object at 0x8365550> In [92]: nco.createDimension('ncols',1760) Out[92]: <netCDF4.Dimension object at 0x8365b50> In [93]: lat = nco.createVariable('lat','f8',('nrows','ncols'),zlib=True) In [94]: lat[:] = vlats In [95]: lon = nco.createVariable('lon','f8',('nrows','ncols'),zlib=True) In [96]: lon[:] = vlons In [97]: data = nco.createVariable('data','int',('nrows','ncols'),zlib=True) In [98]: data[:] = vtypes In [99]: nco.history="Creating a vegetation types mask from the NCEP ncep.sfluxgrbf03.grb file" In [100]: nco.units="Integer(0-13)" In [101]: nco.close() In [102]: nco = NetCDFFile('/wrk/jfb/DATASETS_TEMPLATES/JFB_vegtypes.nc',format='NETCDF4',zlib=True) In [103]: nco.variables.keys() Out[103]: ['lat', 'lon', 'data'] In [104]: nco.close() I guess officially, I should add something along the lines of: float lat(lat) ; lat:long_name = "latitude" ; lat:units = "degrees_north" ; lat:standard_name = "latitude" ; Thank you, john -- Configuration `````````````````````````` Plone 2.5.3-final, CMF-1.6.4, Zope (Zope 2.9.7-final, python 2.4.4, linux2), Python 2.6 PIL 1.1.6 Mailman 2.1.9 Postfix 2.4.5 Procmail v3.22 2001/09/10 Basemap: 1.0 Matplotlib: 1.0.0 ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users