ifflw is a simple routine for adding a Land/Sea mask to an Imager File Format (IFF) file. To do so, we leverage Land/Water dataset in the SDP Toolkit's DEM files, initially created at the University of Maryland. These ancillary files and a README that describes them can both be found at the following NASA FTP location:
Our Land/Sea implementation is intentionally simple, so that it can be applied across multiple instruments with different scan characteristics and at varying resolutions. It requires only the latitude and longitude provided by IFF as input. It then converts that geolocation to a DEM index using a reimplemented version of the same lookup as performed by the SDP Toolkit. We use that index to grab a Land/Sea value from the DEM ancillary data for every imager pixel.
By default we end at this point. However, if the aggregation flag is turned on (SIPS default?), then we perform a smoothing function using ratios pulled from the MODIS Collection 6 Land/Sea calculations. For bordering pixels at the first and last scan line, or the edges of scans, no aggregation can be performed. For all interior pixels, we retrieve a 9 pixel box that uses this pixel at the center. Each pixel is weighted equally, and we recompute the Land/Sea mask using the aggregate_sample function in ifflw.py, which is a reimplementation of the aggregation done for C6, but using different inputs.