[gdal-dev] HowTo open NetCDF SUBDATASET and write to new file
gaffigan at sfos.uaf.edu
Tue Sep 16 03:05:43 EDT 2008
Hello. Here's an example of reading an entire array for a single subdataset.
[gaffigan at dp2 AEFF]$ gdalinfo latest.nc
Driver: netCDF/Network Common Data Format
ean_sea_level (8-bit integer)
[gaffigan at dp2 AEFF]$ python
>>> from osgeo import gdal
>>> ds = gdal.Open('NETCDF:"latest.nc":TMP_GPML')
>>> data = ds.ReadAsArray().reshape(49,11,78,141)
Using a more generic call of the form below you can get at particular
where, for the above example, i=[1,...,539].
> Hi List,
> I'm would like to use the Python bindings to open a specific SUBDATASET in
> NetCDF file and read the contents. I read in
> http://www.gdal.org/gdal_datamodel.html, under the "SUBDATASETS domain"
> section, that I should be able to pass the "_NAME" parameter into
> in order to do this, but I'm not exactly sure how. Could someone pass me
> couple lines of Python that show how this is done?
> Thanks in advance.
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
More information about the gdal-dev