Version 6 of Analyzing Remote Sensing Data with NAP

Updated 2007-07-05 09:00:17 by arjen

NB (05/07/07), Arjen Markuspost on Analysing geographical data with NAP prompted me to get off my duff and add some of the ways we are using NAP for raster ananlysis.

The example below shows how one can do vegetation analysis, Normalized Difference Vegetation Index (NDVI), using raster maps, which gives an indication of how much green vegetation is present in the photos.

 ####Using ESRI ascii grids as inputs...

 nap "red = get_gridascii('red.ASC')";

 nap "near = get_gridascii('near.ASC')";

 nap_info seconds

 nap "NDVI = (near-red)/(near+red)"

 nap_info seconds

 ###Plot output to a jpeg file

 plot_nao NDVI -print 1 -filename NDVI_asc.jpeg

 ###Ascii grids seem slower to parse, so lets use HDF files

 nap "red = f32 "[nap_get hdf red.hdf "3-dimensional Scientific Dataset"]""

 $red shape
 nap "near = f32 [nap_get hdf near.hdf "3-dimensional Scientific Dataset"]"
 nap "NDVI = (near-red)/(near+red)"
 #nap_info seconds
 ###sanity check, NDVI NAO should have same shape as red or near NAO
 $NDVI shape
 plot_nao NDVI(,,0)

 ########Another approach, using a multi-band hdf, derived from a multiband geotiff using GDAL, 
 nap "all_bands = f32 [nap_get hdf all_bands.hdf "3-dimensional Scientific Dataset"]"
 nap "red = all_bands(,,1)"
 nap "near = all_bands(,,3)"
 nap "NDVI = (near-red)/(near+red)"
 plot_nao red -print 1 -filename red.jpeg
 plot_nao near -print 1 -filename near.jpeg
 plot_nao NDVI -print 1 -filename NDVI.jpeg

Here are the pictures:

http://tclerswiki.googlepages.com/red.jpeg

http://tclerswiki.googlepages.com/near.jpeg

http://tclerswiki.googlepages.com/NDVI.jpeg


[ Category Mathematics ]