Skip to content

Latest commit

 

History

History
25 lines (12 loc) · 4.41 KB

README.md

File metadata and controls

25 lines (12 loc) · 4.41 KB

MODIS_L2

The scripts and functions in this repo are designed to ‘fix’ problems associated with the MODIS Aqua L2 SST dataset originally generated by NASA’s Ocean Biology Processing Group (OBPG). Specifically, the cloud screening algorithm used by the OBPG flags as corrupted pixels for which the brightness temperature in a 3 x 3 pixel region centered on each pixel exceeds a given threshold. This flags as bad a significant number of cloud contaminated pixels but it also flags as bad regions with high SST gradients. The main script, build_and_fix_orbits.m, used to correct for this breaks the cloud mask into objects and then, for each object, analyzes the shape of the cloud mask—primarily its aspect ratio—as well as characteristics of the SST values under, and in the vicinity of, the mask, such as the SST values under the mask compared with values to either side. The flags associated with pixels in the masked region are set to uncorrupted depending on the results of these tests. build_and_fix_orbits.m also refines the test based on the difference between the retrieved SST and a reference field; the OBPG used a fixed value independent of location and time of year resulting in a significant number of pixels being flagged as bad in the vicinity of dynamic features. build_and_fix_orbits.m uses a threshold determined from initial retrievals for 2002-2019 binned into climatological month and 5x5 degree squares. Finally, the script regrids the SST field to address the distortion of the L2 field resulting from the bow-tie effect.

Prior to performing the correction outlined above, 5-minute granules of the original dataset are grouped into complete orbits consisting of 1354 x 40,271 pixel arrays; i.e., 40,217 scan lines with 1354 pixels per scan line. The SST fields are then corrected for the cloud screening problem. Following this step, the resulting SST fields are remapped to an L2 grid of the same spatial resolution but corrected for the bow-tie effect. The corrected SST, latitude and longitude arrays are written in one netCDF file for each complete orbit. The resulting dataset consists of approximately 100,000 orbital files for the 20 year period considered.

build_and_fix_orbits.m was developed with data uploaded from the OBPG website but the script may be used to process MODIS L2 SST moved to the Amazon cloud by the Jet Propulsion Laboratories Physical Oceanography Distributed Active Archive Center (PO.DAAC). The archive in Amazon west has been modified by the PO.DAAC to make it GHRSST-compliant. This required the addition of some fields. As part of the process some metadata fields, not required by GHRSST, were eliminated. Unfortunately, these fields are required by build_and_fix_orbits.m. So, the OBPG granules were copied from the OBPG website to the University of Rhode Island and metadata files were created for each granule with the required metadata. These granules, which have the OBPG’s granule name with ‘_OBPG_extras’ appended prior to .nc4, will be moved to Amazon west for final processing.

In addition to the input fields, either from the OBPG website or in Amazon west, build_and_fix_orbits.m requires three other files to perform the various corrections. These are available at: https://doi.org/10.5281/zenodo.7655067, a Zenodo archive. (Note that the Zenodo DOI may change as files are added and/or modified so, go to this site and select the most receent DOI for the dataset.) Also in the dataset are files that may be used to test build_and_fix_orbits.m. The various elements of this data set are described in the DOI.

To test build_and_fix_orbits.m, you will need to make some directories on your system for the files used to test and then to populate these from the landing page of the dataset. This is explained in the script that creates these directories. After you have opened this project in Matlab, enter the following at the Matlab prompt:

[orbits_directory, granules_directory, metadata_directory, fixit_directory, logs_directory, output_file_directory] = ... setup_for_build_fix_test_run('/Users/johnsmith/Desktop/');

where you would repace /Users/johnsmith/Desktop/ with the directory location on your machine.

When you have populated the directories as instructed, run build_and_fix_orbits.m as instructed in the setup file.

Finally, to see if the file you created has the same values as they did when the script was originally run, at the Matlab prompt type:

compare_eastward_gradients(output_file_directory)