Welcome to the Earthdata Forum! Here, the scientific user community and subject matter experts from NASA Distributed Active Archive Centers (DAACs), and other contributors, discuss research needs, data, and data applications.
I hope I don't offend anyone with this question but I am going to risk it. I am trying to use gdalwarp (the command, submitted through R on a Mac is below)
the srcnodata in the option should be -32767 and, if I understand correctly, gdalwarp should give me data for Rrs_412 that are roughly similar to what I would get if I reprojected the nc file in SeaDAS. Is it possible that the fill value/srcnodata value is NOT -32767? When I run the above command on that file I get no Rrs_412 values >0 for a file, based on viewing in SeaDAS, clearly has nonzero Rrs_412 values.
I have attached a png of the result for the command above. Any suggestions on how to make this work would be appreciated, even if it is "try a gdal forum".
by gnwiii » Wed May 24, 2017 7:35 am America/New_York
Using the benchmark file and GDAL 2.2.0 (from maports):
gdalwarp HDF5:"A2006167181000.L2_OC.nc"://geophysical_data/Kd_490 -r bilinear -srcnodata -32767 -tr 0.009337697 0.009337697 A2006167181000.L3M_Kd_490.tif gives a file that has reasonable looking Kd_490 values after settting the no-data value and applying the scale factor of 0.00019999999. The mapping, however, is not correct (see attached). I suspect gdal warp is building a transform based on the corner coordinates rather than using the lon,lat arrays.
It would be nice if we could use the NetCDF4-CF driver, but GDAL only supports NetCDF4-CF with regular grids (Ticket 4513).
Have you considered using the SeaDAS 7 GUI or GPT command-line utility to map the NetCDF4-CF level-2 files?