[gdal-dev] NetCDF driver getting wrong values if compared to HDF5
Ivan Lucena
ivan.lucena at outlook.com
Tue Jul 30 14:48:45 PDT 2019
Hi,
I am struggling with an issue with the NetCDF file with dealing with data from ESA Copernicus, Proba-V 1KM Level 3.
If I read the data using the HDF5 driver I lose the georeferenced but the values seems to more aceturate, since the pixels values over the ocean are supposed t be flagged as 254. See the Python printout:
from osgeo import gdal
import numpy
ds = gdal.Open('HDF5:"c_gls_NDVI_201907110000_GLOBE_PROBAV_V2.2.1.nc"://NDVI')
bd = ds.GetRasterBand(1)
ar = bd.ReadAsArray(25109,9083,10,10)
print(ar)
ds = None
[[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]
[254 254 254 254 254 254 254 254 254 254]]
ds = gdal.Open('NETCDF:"c_gls_NDVI_201907110000_GLOBE_PROBAV_V2.2.1.nc":NDVI')
bd = ds.GetRasterBand(1)
ar = bd.ReadAsArray(25109,9083,10,10)
print(ar)
ds = None
[[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]
[255 255 255 255 255 255 255 255 255 255]]
By looking at the gdalinfo information it clear that netCDF gathers more information, like I said, georeferenced but both drivers are not capable to show the list of flagged values on the NDVI dataset:
$ gdalinfo HDF5:"c_gls_NDVI_201907110000_GLOBE_PROBAV_V2.2.1.nc"://NDVI
Driver: HDF5Image/HDF5 Dataset
. . .
NDVI_flag_meanings=Missing cloud snow sea background
NDVI_flag_values=√ⁿ²■
$ gdalinfo NETCDF:"c_gls_NDVI_201907110000_GLOBE_PROBAV_V2.2.1.nc":NDVI
Warning 1: NetCDF driver detected file type=5, but libnetcdf detected type=3
Warning 1: Unsupported netCDF datatype (7), treat as Float32.
Driver: netCDF/Network Common Data Format
. . .
NDVI#flag_meanings=Missing cloud snow sea background
NDVI#flag_values={}
There is this warning but that doesn't seems to be affecting the pixels values on the land.
Does anybody has a clue on what is going on here?
Thanks,
Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20190730/90653faf/attachment.html>
More information about the gdal-dev
mailing list