Gdal and netCDF

May 9, 2011 at 12:04 PM

It seems GDAL can deal with this format and dotspatial uses GDAL but I don't really understand how it all interacts.

If i want say to see information about a netCDF file or read data for a particular variable i must know the variable name and the band in which it actually stored in depending on the variable dimensions  ( ex. height=1 time=1).

NetCDF files when read by gdal are split into bands (the slice i want will be exposed as one of many bands). So the only problem is to figure out which band i am intrested in.

It seems that the dimensions are listed as band metadata.

- Open specific layer by using:
layer = gdal.Open('netCDF:"annual_mean.nc":temp')

- Then get at the layer data data using the following:
netcdf_band = layer.GetRasterBand(1)

I am trying to create a provider for netCDF with Gdal and i cannot get information about the variables and projections. 
Any ideas on this?