Re: [gdal-dev] HowTo open NetCDF SUBDATASET and write to new file

2008-09-17 Thread Roger André
Hi Steve, Thanks very much for the code snippet. I figured out the following via experimentation. - 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) - Read in the data one

Re: [gdal-dev] HowTo open NetCDF SUBDATASET and write to new file

2008-09-17 Thread Steve Gaffigan
Roger, Hello. Our examples differ in that you called the ReadAsArray() on a single band, which returns an array with dimensions (ny,nx), and I called it on the subdataset, which returns an array with dimensions (nbands,ny,nx). In my example the array returned has size (539,78,141), where the

Re: [gdal-dev] HowTo open NetCDF SUBDATASET and write to new file

2008-09-16 Thread Steve Gaffigan
Hello. Here's an example of reading an entire array for a single subdataset. [EMAIL PROTECTED] AEFF]$ gdalinfo latest.nc Driver: netCDF/Network Common Data Format ... SUBDATASET_25_NAME=NETCDF:latest.nc:TMP_GPML SUBDATASET_25_DESC=[49x11x78x141] air_temperature_at_constant_altitude_above_m