fill values for L2 Rrs data and gdalwarp

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
obdaac_forum_user
Posts: 86
Joined: Wed Jan 27, 2021 1:52 pm America/New_York
Answers: 0

fill values for L2 Rrs data and gdalwarp

by obdaac_forum_user » Tue May 23, 2017 7:14 pm America/New_York

Greetings all

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)

system('gdalwarp HDF5:"A2011202183000.L2_LAC_OC.x.nc"://geophysical_data/Rrs_412 r412.tif -r bilinear -srcnodata -32767 -tr 0.009337697 0.009337697').

Based on what I see for band attributes in SeaDAS and the table at this link
https://oceancolor.gsfc.nasa.gov/docs/format/l2oc_modis/#specs_24

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". 

Thanks,
Dave

Tags:

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

fill values for L2 Rrs data and gdalwarp

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?

Post Reply