Stack modis ls brdf.bash

From Open Foris Wiki

Jump to: navigation, search

This script converts modis and landsat hdf files into Erdas imagine .img

  • Motivation is to use the output(s) for calibrating the LS values over large areas with gdal_gapfill
  • Since modis does not contain thermal band, only reflective region bands are used from LS
  • LS 1 2 3 4 5 7 and Modis 3 4 1 2 6 7 correspond; the stacks are arranged using LS order
  • Modis is re-projected from sinusoidal into LS projection, then cut into same size and resampled into 30 m pixel size
  • Modis brdf-corrected surface reflectance files with ca. 500 m resolution are used (MCD43A4)
  • Landsat must be converted to SR, using products from NASA's LEDAPS project
  • Input is given as hdf file names or paths, the LS hdr file must exist in the same location
  • OGC SRS makes the output compatible with Erdas Imagine
  • requires ~/ogcwkt, which can be created by running
  • Modis is assumed to be in sinusoidal projection
  • The output is 12-band stack starting with 6 Modis bands and ending with 6 LS bands
  • Also creates NDVI images for both LS and Modis. NDVI alues are multiplied by 100 in order to keep the image as integer.
  • Also creates a 0-3 mask of both images for classification etc. purposes: 0 = background, 1 = clouds, shadows, gaps, 2 = ok, 3 = do not process, bad data in both images
  • Mask is based on the Ledaps QA layer and Modis image zero values, trimming is done with LS band4
  • ...and a combined mask, where value 2 is given to pixels where both images have NDVI over certain threshold and the area is not cloud/shadow
  • The idea is to find areas with vegetation for the calibration
  • Also outputs a mask, where the MODIS 500 m pixels must contain somewhat homogeneous vegetation
  • This is assessed by computing std's of LS NDVI values within the pixels (actually segments of similar modis pixels).
  • Only Modis pixels with smaller-than-median std are accepted. The NDVI threshold holds as well.

Usage: stack_modis_ls_brdf.bash <landsat.hdf> <modis.hdf> <NDVI_threshold>

  • Give the Landsat and Modis hdf (MCD43A4) files or their paths
  • Suitable NDVI thresholds are somewhere between 0.2 and 0.5, coarsely, depending on the region

Back to Open Foris Toolkit Main Page

Back to Tools & Exercises

Personal tools