Web Content Display

Web Content Display (CoastWatch User Forum)

The NOAA CoastWatch Forum provides information in several categories.  The information is relevant to CoastWatch products and software (https://coastwatch.noaa.gov)  and vary in technical details.  For questions and issues not addressed here,  start a thread in the appropriate category or contact the CoastWatch HelpDesk (coastwatch.info@noaa.gov).  Please note our Privacy Policy (https://www.noaa.gov/privacy.html) and that this is a public forum.  All information is voluntarily and anonymous submissions are accepted pending review prior to posting. 

Forums

Back

RE: Ocean Color Level-2 nLw data read by Python has values very large

MS
Michael Soracco, modified 1 Year ago.

Ocean Color Level-2 nLw data read by Python has values very large

Youngling Posts: 39 Join Date: 8/11/16 Recent Posts

1)The nLw data read by python does not seem to be the real data, and the value is obviously too large. From the original data, I see that there is a scale_factor=0.001, which seems to be normal when multiplied by this parameter. When the code reads L2 data, does it need to be multiplied by this parameter?

 

2)Is there any documentation on how the Code read L2 data? I did not find it on the coastwatch website.

viirs ocean color level-2 netcdf data format python
MS
Michael Soracco, modified 1 Year ago.

RE: Ocean Color Level-2 nLw data read by Python has values very large

Youngling Posts: 39 Join Date: 8/11/16 Recent Posts
The VIIRS Ocean Color data is stored in NetCDF with Climate-Forecast conventions.  Any reading of these data should include using a NetCDF-CF library to determine any required scaling/offsets that should be applied.  Depending on the language used for programmatic reading,  the variable attributes may be applied automatically  like python's netcdf4 library  (note,  depending on the version used,  this has been an issue).
 
 
You can see the nLw data variable includes specific metadata for each variable:
 
long_name: Normalized Water-leaving Radiance at 411.0 nm
scale_factor: 0.001
add_offset: 0.0
units: mW cm^-2 um^-1 sr^-1
coordinates: time longitude latitude
grid_mapping: coord_ref
standard_name: normalized_surface_upwelling_radiance_in_air_emerging_from_sea_water
_FillValue: -32768
reference: Gordon & Wang (1994), Retrieval of water-leaving radiance and aerosol optical thickness over the oceans with SeaWiFS: A preliminary algorithm, Appl. Opt., 33, 443-452
solar_irradiance: 172.5767
solar_irradiance_units: mW cm^-2 um^-1
_ChunkSizes: 10, 1067
 
You are correct that the value for nLw_411_actual = nLw_411*<scale_factor>+<add_offset>,  and that you should ignore values of -32768.  Other information on NetCDF and CF can be obtained from online searches resulting in links to sites like https://unidata.github.io/python-training/workshop/CF%20Conventions/netcdf-and-cf-the-basics/ (this is not an endorsement of the website or contents therein).  
 
As for documentation on reading the data,  we provide a suite of open source software utilities that will facilitate working with these data that will handle some future issues you may encounter such as the 'bowtie' mask.  Please look at our software https://coastwatch.noaa.gov/cw/user-resources/coastwatch-utilities.html and bundled source code/API for examples of code implementation.
 
Additional information on the data contents (variables, flags,  etc)  is found on the Documentation section of our product page.  The ATBD contains these specific details:
 
Algorithm Theoretical Basis Document (ATBD): Wang, M., X. Liu, L. Jiang and S. Son, "The VIIRS Ocean Color Products", Algorithm Theoretical Basis Document Version 1.0, 68 pp., June 2017.