1        WAM examples at a glance

1.1      WAM programs with graphical interface


Program Name




A GUI program using Windows Forms to get input from the user and apply a number of WAM operations.

Allows the user to selectively apply a number of WAM operations to a series of images. Includes options for different input and output formats, cutting a sub-area, median filtering, two kinds of overlays, converting to BYTE, remapping, calculating statistics, doing color stretch for the output files.


Finds matches between in situ measurements and a series of satellite images

Creates a CSV text file with match-up statistics of a DX x DY window image statistics corresponding to in situ measurements.


Calculates statistics of masked areas for a series of images

Using a list of images, an image with masked areas or list of stations calculate statistics for the series of images. Output is a CSV file ready for importing into MS Excel.


1.2      Command-line WAM programs


Program Name




Shows how to create a series of images of a selected sub-area, and save as JPEGs, GIFs or HDFs

Example shows how to read all matching HDF files in a folder, cut out a predefined sub-area, stretch the color scale, save each in different formats.


Show how to create composites of a series of CoastWatch images

Reads all matching CoastWatch files in a folder, calculates composites, calculates the maximum pixel composite, the average pixel composite and the count image, stretches the color scales, saves each.


Shows how to calculate a new image using a band ratio algorithm

Reads all matching pairs of image files in HDF (e.g. of 443 and 520 nm bands) in a folder, applies a band ratio algorithm, saves the calculated image as a float HDF, converts to a BYTE image using CHL scaling, stretches colors, saves as a JPEG.


Calculates anomalies relative to the mean monthly annual cycle

Reads all matching images, calculates and saves the mean annual images, then calculates and saves the anomalies relative to the monthly means


Calculates a series of new images using a combination of images and a band ratio algorithm. Includes OC4v4 and SPGANT algorithms.

Reads all matching sets of radiance images (e.g. SeaWiFS 443, 490, 510, 555 nm Lwn bands), applies a band ratio algorithm, and saves the calculated image as a log-scaled Byte image in HDF.


Apply a filter, e.g. Median filter, to a series of images, save the results

Reads all matching HDF files in a folder, cuts out a predefined sub-area, applies the Median filter, and saves each as a JPEG.


Reduces a series of HDF images

Reads all matching HDF files in a folder, reduces the size by a predefined times using a selected reduction type, saves each as HDF.


Remap a series of (MODIS) images, possibly with external geo-referencing to a target projection

Reads all matching HDF files, picks a selected SDS, guesses the respective geo-referencing file, maps each to the target projection, saves the remapped image as HDF.


Remap a series of images with external latitude/longitude array (LLA)to a target projection

Reads a list of 2 filenames (file with image and the file with LLA), picks a SDS, remaps to the target projection and saves in selected folder together with typical timing attributes.


Print the value of an HDF attribute from a series of HDF files

Reads all matching HDF files in a folder, extracts the value of an integer attribute (e.g. “Start Day”), and prints the file name and the attribute value.


Calculate Primary Production according to the Behrenfeld-Falkowski model

Calculates primary production for a selected set of CHLO, PAR and SST images, saves as HDF.


Calculate Behrenfeld-Falkowski primary production for a series of images

Reads a list of CHLO, PAR and SST images, calculates images of Behrenfeld-Falkowski primary production, saves as HDF.


Calculate statistics of a rectangular area

Reads a specified image as HDF, calculates statistics for a specified rectangular area, prints to the screen and saves in a text file.


Extract pixel values of a series of points (stations), calculate statistics for 3 x 3 pixel areas around the stations for a series of images

Reads a list of stations (specified by longitude, latitude, name) and a list of images; calculates statistics for 3x3 pixel areas centered at the station, saves statistics and pixel values in a comma separated text file.


Calculate statistics for latitude/longitude grid for a series of images

Reads a series of images; calculates statistics for a lat/lon grid, saves statistics.


Sort the statistics of masked areas by area instead of by image

Sorts the statistics by mask number of a text file created by wam_statist. The output file sorted.csv is ready to be imported into a spreadsheet like MS Excel.


Calculate integrals of a series of specified irregular areas (masks) of a series of images

Reads a mask image that specifies up to 255 different irregular areas (masks), calculates total integral (pixel value x pixel area) for a list of images from a list file, saves totals for all the images and all the masks in a comma separated text file.


Calculate integrals of a series of 255 latitudinal areas (masks) excluding land and creates a time series of integrals

Reads a land mask image to separate missing pixels due to clouds from land. Automatically generates 255 masks according to latitude, calculates statistics and integrals (pixel value x pixel area) for a list of images from a list file, saves totals for all the images and all the masks in a comma separated text file.


Adds integrals and statistics of masked areas from wam_integ_lat

Adds the integrals of selected range of (latitudinal) masks of a text file created by wam_integ_lat. The output file addmasks.csv is ready to be imported into a spreadsheet like MS Excel.


Calculates POC images from a series of nLw555 images according to Stramski et al. (1999).

A complex example that uses one set of images (nLw555) to calculate another set of images (POC).


Calculates ratio images from two series of images

An example that reads two series of images, calculates pixel by pixel ratio, saves as HDF


Calculates a series of ratio images from a series of image pairs using a list

In contrast to the previous example, gets the image names from a list file. Remaps the second image to the first. This example is used to calculate the ratio of a MODIS image to that of a SeaWiFS image.


Calculates a series of export flux images using input images of primary production, SST and Chl.

Uses Edward Laws’ algorithm to calculate export flux of primary production. Reads a list file with 3 filenames on each line.


Calculates a series of histograms for a specified rectangle

Reads a mask, a list of file filenames, calculates and saves histograms of a rectangle.


Calculates total areas of for a range of values for a masked area

Reads a mask and calculates the total areas within the mask of a series of images, corresponding to a range of values. It assumes that the images are in the global equal angle projection.


Using a quality flag image, screens, i.e. keeps only the high-quality pixels while  replacing others with zeros

Screens Level-3 MODIS (SST or chl) images, converts to Byte with, respectively, SST-Pathfinder or Log-Chl scaling.


Screens AVHRR Pathfinder version 5 files, keeps only the best quality pixels

Uses both SST and quality images, makes all SST pixels with quality flags less than 7 zero, converts to Byte with SST-Pathfinder scaling.


Converts all matching plain raster images in a directory to HDF while adding attributes.

Is useful for creating HDF files from plain raster files. Using filenames as clues for time it tries to add attributes like “Start Year”, “Start Day” that are needed for time series analysis.

wam_composite, wam_composite2

Create an average composite and a count image of a series of HDF images

Reads HDF files listed in a list file, calculates a mean composite and a count image from all valid pixels, saves as HDF files. For SeaWiFS SMI files adjusts the attributes so that the start and end periods correspond to the first and last images, respectively.


Creates composites of ascending and descending orbits of Level-3 QuikSCAT data

Reads all Level-3 QuikSCAT files in the folder, calculates the mean composite of ascending and descending orbits, saves as HDF files


A specific example to remap a series of images to a target projection, overlay an annotation layer with stations, color bar, grid, etc. This can be done more easily with wam_series.

First reads an HDF image in a target projection that has also the features to be overlaid, such as stations, color bar, etc., then reads all matching HDF images in a folder, maps each to the target projection, overlays the overlay image, saves the results in various forms (HDF, JPEG, BMP, etc.).


Simple example for creating series of RGB composite images

Reads all matching image files from a folder, calculates RGB images from selected bands.


Creates accurately co-registered true-color RGB composites from MODIS Level-1B data

Creates true-color RGB images, at 1 km, 500 m or 250 m, does accurate band co-registration, optionally maps to a target projection.


Interpolates 1-km MODIS latitude-longitude array to 250-m resolution

Reads all matching MOD03 or MYD03 files and interpolates the latitude and longitude arrays to 250 m. IT IS VERY SLOW! An optimized version is in development!


Calculates turbidity index from MODIS bands1 and 2, maps to a target projection

Reads a crefl-produced HDF file produced with bands 1 and 2, MOD03 geo-referencing file, saves as HDF and as JPEG.