[gdal-dev] Reading a NetCDF file with python (not recognised as a supported dataset name

Etienne Tourigny etourigny.dev at gmail.com
Fri Jun 8 14:17:10 PDT 2012


On Fri, Jun 8, 2012 at 5:56 PM, Rutger <kassies at gmail.com> wrote:
> Hey,
>
> Thank you all for the replies, i really appreciate the help.
>
> @Anton, i have tried many different ways of refering to the file. Full path,
> file only, back and forward slashes, double slashes etc. All have the same
> result. I also would expect this to be platform dependent, but not file
> format dependent. So for a NetCDF file it should be similar as for Geotiff
> etc. The NETCDF prefix and subdataset are format specific, so this might be

probably. there netcdf file argument parser might not be perfect in
windows, especially dealing with python

> an issue. But if this is wrong, i would suspect the commandline utilities to
> be failing as well.

Not necessarily ... the python bindings might behave differently with
quotes, which is probably the root of the problem here.

Can you try with osgeo4w? You can probably just do a minimal install
with gdal+python, then try to run you python script in the osgeo4w
shell.
I got it working that way.

>
> @Etienne, Running gdalinfo with stats gives me exactly the same values as
> you, till the last decimal. This confirms that both the file is fine
> (gdal-proof), and that the pre-build command-line utilities are working as
> supposed to.
>
> Turning on 'CPL_DEBUG' (and adding the -q to supress progress) for the
> previous posted script results in:
> /D:\Projects\Python\TRMM_soilm>python debug.py
> GDAL: GDALOpen(LPRM-TMI_L3_DY_SOILM3_V001-20120503T175233Z_20120501.vrt,
> this=01883C90) succeeds as VRT.
> ERROR 4:
> `NETCDF:LPRM-TMI_L3_DY_SOILM3_V001-20120503T175233Z_20120501.nc:soil_moisture_x'
> does not exist in the file system,
> and is not recognised as a supported dataset name.

Strange that there is no netcdf debugging information.

Please try with the small attached file:

And try this:
gdal_translate -of netcdf
NETCDF:LPRM-TMI_L3_DY_SOILM3_V001-20120503T175233Z_20120501.nc:soil_moisture_x
tmp1.nc
gdalinfo tmp1.nc

and then run your script with tmp1.nc instead (without any vrt stuff),
it might be that netcdf support is not ok in the python build?


You should probably experiment without a vrt file, this might also
cause problems

>
> GDAL: GDALClose(LPRM-TMI_L3_DY_SOILM3_V001-20120503T175233Z_20120501.vrt,
> this=01883C90)
> GDAL:
> GDALClose(NETCDF:LPRM-TMI_L3_DY_SOILM3_V001-20120503T175233Z_20120501.nc:soil_moisture_x,
> this=01884388)/
>
> Besides the earlier error still being present i dont see anything which can
> be an indication of the problem.
>
> If anyone has any other ways of debugging this, i would appreciate it.
>
> Regards,
> Rutger
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/Reading-a-NetCDF-file-with-python-not-recognised-as-a-supported-dataset-name-tp4979943p4980067.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trmm.nc
Type: application/x-netcdf
Size: 8956 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120608/8ce10c8c/attachment-0001.nc>


More information about the gdal-dev mailing list