NetCDF files downloaded from NASA ocean color website could not be converted to geotiff using gdaltranslate command below:

 gdal_translate -ot float32 -unscale -CO COMPRESS=deflate NETCDF:"A2006001170000.L2_LAC_OC.x.nc":chlor_a fulldisk.tif

The error message is the following:

Warning 1: NetCDF driver detected file type=5, but libnetcdf detected type=3
Warning 1: NETCDF:A2006001170000.L2_LAC_OC.x.nc:chlor_a is a netCDF file, but chlor_a is not a variable.
ERROR 4: `NETCDF:A2006001170000.L2_LAC_OC.x.nc:chlor_a' does not exist in the file system, and is not recognized as a supported dataset name.

Is there any way of fixing the issue?

1 Answer 1



gdal_translate -ot float32 -unscale -CO COMPRESS=deflate HDF5:"A2006001170000.L2_LAC_OC.nc"://geophysical_data/chlor_a fulldisk.tif

enter image description here

  • Thank you! Related to this, is it possible to install netcdf for python on Windows? I am struggling with it.
    – wondim
    Jun 3, 2018 at 4:55
  • I found out that the above script only shows the no data values for me. Could you please advice me what to do? I have tried A2006001170000.L2_LAC_OC.x.tif
    – wondim
    Jun 13, 2018 at 17:49
  • @wondie As there is no chance A2006001170000.L2_LAC_OC.x.tif appears in the process, other than the case you specify it as an output filename, I suspect a typo error in your code. You may want to post your full code.
    – Kazuhito
    Jun 13, 2018 at 22:30
  • There is some improvement since the earlier post. Now, I am able to see the data but the image is inverted in GIS software. This is the file I am using now. oceandata.sci.gsfc.nasa.gov/cgi/getfile/… I am using this updated code below. "gdal_translate" -ot float32 -unscale -co PROFILE=BASELINE -co COMPRESS=deflate -of GTiff -a_nodata -32767.0 -scale 0 100 HDF5:"A2018001180000.L2_LAC_OC.nc"://geophysical_data/chlor_a A2018001180000.L2_LAC_OC.tif
    – wondim
    Jun 14, 2018 at 15:01
  • @wondie Yes, it seems inverted to me, too. Remove -co PROFILE=BASELINE and see what happens.
    – Kazuhito
    Jun 14, 2018 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.