[GRASS-user] Pre-processing LANDSAT TM Orthorectified images from GLCF

maning sambale emmanuel.sambale at gmail.com
Thu Jun 12 04:10:05 EDT 2008


Hi,
I have created a simple script to automate the pre-processing process
of landsat tm+.  Here it is, if you see it needs improvement (my bash
skill is very rudimentary) please comment:

===============================================
#!/bin/sh -x

# Script to automate pre-processing of LANDSAT ETM+ data
# Requires bands 1-5, 6 & 7 from
ftp://ftp.glcf.umiacs.umd.edu/glcf/Landsat/WRS2 and also a DEM file
# Requires i.landsat.toar, i.topo.corr, i.landsat.acca module from grass addons
# June 12, 2008


# set the following variables

#original band prefix
BANDPREF=lsat7_2000
#path to metadata
METADATA=/home/maning/pfua/map_data/landsat/glcf_met/p111r054_7x20000309.met
#data of image
DATE=2000-03-09
#solar elevation
SUNELV=57.1772505
#sun zenith you can get it from http://www.nrel.gov/midc/solpos/solpos.html
SUNZEN=32.727
#sun azimuth
SUNAZI=112.3801002
#dem file
DEM=dem_90

############## nothing to change below
if  [ -z "$GISBASE" ]
then
	echo ""
	echo "You must be in GRASS GIS to run this program"
	echo ""
	exit 1
fi

g.region rast=${BANDPREF}.1

# calibrate DN values to top of atmosphere radiance
echo "Calibrating to radiance ..."
i.landsat.toar -7 -v band_prefix=${BANDPREF} metfile=${METADATA}
echo "Imported as '${BANDPREF}.toar.bandnumber'"

echo "Correcting topographic effects ..."
i.topo.corr -i base=${DEM} zenith=${SUNZEN} azimuth=${SUNAZI} out=cosi
i.topo.corr base=cosi
input=${BANDPREF}.toar.1,${BANDPREF}.toar.2,${BANDPREF}.toar.3,${BANDPREF}.toar.4,${BANDPREF}.toar.5,${BANDPREF}.toar.61,${BANDPREF}.toar.7
out=tcor zenith=${SUNZEN} method=c-factor

echo "Calculating cloud cover ..."
i.landsat.acca -f2s band=tcor.${BANDPREF}.toar out=${BANDPREF}.acca

echo "Done!"
g.list rast
===============================================
Some notes:
1. Calculation for solar zenith is taken from:
http://www.nrel.gov/midc/solpos/solpos.html
2.  DEM for i.topo.corr is the default SRTM resolution (90m), is this okay?
3. i.landsat.cca gives very good results, however, adding the -s flag
(for cloud shadows), sometimes misclassify water bodies such as
rivers.
image: http://farm4.static.flickr.com/3126/2571893895_0a73dd3380.jpg

cheers,
maning

On 6/2/08, maning sambale <emmanuel.sambale at gmail.com> wrote:
> Markus,
>
>> AFAIK LANDSAT is sun-synchronous, it passes in the local morning time
>> (something like 10:30-11:00).
>>
>> Maybe this helps:
>> http://earthobservatory.nasa.gov/MissionControl/overpass.html
>
> Since it is an overpass predictor, it doesn't provide information on
> previous landsat overpass.  Can I use this as a proxy to the hh:mm for
> i.atcorr (me thinks no)?  Or set an arbitrary time say between 10:30
> to 11:00?
>
>> i.atcorr is the sophisticated correction, i.landsat.dehaze only a simple
>> approach based on image statistics.
>>
>>> 3. correction for topographic/terrain effects (most of my study area
>>> are in maountainous regions)
>>> use book 2nd ed. (page 226) "cosine correction"
>>> using r.sunmask, r.mapcalc
>>> Problem: again, no image acquisition time
>>
>> (see above). "cosine correction" is a simple approach. See also
>> i.topo.corr (from GRASS AddOns).
> Thank you for this one.
>
>>> 4. removal of clouds
>>> use i.landsat.acca
>>> https://svn.osgeo.org/grass/grass-addons/imagery/i.landsat.acca/
>>
>> Never tried, please report back.
> Will do, via wiki.
>
>> I have collected all this now in
>> http://grass.osgeo.org/wiki/Image_processing#Preprocessing
>>
>> Feel free to further improve that Wiki page.
>> Markus
>
> As usual, thank you very much.
>
> cheers,
> maning


More information about the grass-user mailing list