CoastWatch Utilities: Exercise 2b - Examining Flags in a L2 dataset

This exercise will use Level-2 ocean color products generated from the NOAA MSL12 processing.  Specifically, the near real-time S-NPP VIIRS Level-2 Ocean Color product will be used:

V2022266205808_NPP_NRTNIR_L2.nc

 

Products like these are available at https://coastwatch.noaa.gov/cw/satellite-data-products/ocean-color/near-real-time/viirs.html Links to an external site.

In addition,  we will use the CDAT Overlay group ‘NOAAOceanColorMasksNCgroups.jso’  located in “SampleData2022/ResourceFiles.”  In order to use this layer, it must be placed in your local overlays directory. 

 

Goal:  Load an overlay multilayer mask file and apply bit masking to an image.

 

CDAT stores preferences for each user on the system individually. Depending on the operating system, preferences are stored in a resources directory under your home directory:

Windows 10/7:   [C:]\Users\[User name]\AppData\Roaming\CoastWatch 



Windows 2K/XP/2003:   \Documents and Settings\[User name]\Application Data\CoastWatch

Mac OS X:   ~/Library/Application Support/CoastWatch

Unix:   ~/.coastwatch

The resources directory contains various files and subdirectories as follows:

prefs.xml:  Main preferences file with general and enhancement preferences.

overlays/:   Directory for storing overlay groups from the Overlay Layers tab. Each overlay group is stored as a separate file with a .jso extension for “Java Serialized Object”, a binary format used for saving/restoring a Java object's state. Overlay groups can be copied between computers, even between different operating systems, although some incompatibilities in overlays may exist between different CoastWatch Utilities versions.

palettes/ :  Directory for storing extra user-supplied palettes.

Copy the NOAAOceanColorMasksNCgroups.jso file from the “SampleData2022/ResourceFiles” directory to the corresponding “overlays” directory on your system.  If the overlays directory is not present,  make a new directory for the file.  A ‘prefs.xml’ file should exist from Exercise 1.  If you cannot locate where your CDAT resource directory is,  search for ‘prefs.xml’ to locate the directory.  If you cannot find the location or install the overlay file,  proceed with the exercise and use the values in ( ) when applying masks.

Start CDAT:  From a command window,  type ‘cdat’<enter>  or use your OS Desktop to locate the software and run it.

From the tool bar,  select the ‘Open’ icon:

Navigate to the “SampleData2022/SatelliteData” directory and select Level-2 Ocean Color dataset: 

V2022266205808_NPP_NRTNIR_L2.nc

Once selected,  the metadata is loaded and variables within the file are listed.  Selecting a variable will generate a preview image.  Select ‘chlor_a’ and ‘l2_flags’ concurrently by holding the ‘Crtl’ key.  Click ‘OK’.

With the chlor_a data in the view, use the ‘Palette’ control tab to apply the ‘NCCOS_chla’ palette. 

Using the ‘Enhancement’ control tab, adjust settings to have a minimum and maximum range of 0.001, 100 respectively, and a function of Log10.  [If the enhancement sliders cannot be moved,  open preferences and set a larger range for chlor_a .  CDAT will obtain information from a dataset to determine if suggested ranges are defined.  Overriding these settings is possible by using the prefs.xml file.  Restart CDAT for the changes to become effective.]

 

Using the ‘Overlay’ control tab,  load the ‘NOAAOceanColorMasksNCgroups’ overlay.

Double-click the ‘Multilayer-1’ layer and manipulate the flags. (If you do not have the overlay group installed,  select ‘Mask=>Multilayer’ from Add Overlay and set Mask variable to l2_flags and Mask size to 32 bits). 

Use the mapping (on right) to see which flags correspond to each bit. 

Definitions of the flagging names are included in Algorithm Theoretical Basis Document available on the website (Note,  bits listed in the ATBD are 00-31):

 

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
    

Links to an external site., 68 pp., June 2017.

 

Apply ‘cloud’  (Bit 10) and ‘land’ (Bit 2).  Modify the mask colors and zoom to the Channel Islands. Export to PNG. 

 

 

Optional/Advanced:  Experiment with ‘Expression masking’ or perform a quick mapping of the data to orthographic,  load and use the View=>Copy/Paste View Zoom to facilitate comparing data.