INLAND CATCHMENTS - AML CODE

by Francisco Olivera
Graduate Research Assistant
University of Texas at Austin
Center for Research in Water Resources

April, 1995


/* Program: inland.aml
/* Author: Francisco Olivera
/* Date: April 16, 1995
/* CRWR J.J.Pickle Research Center
/*
/* Input: dem <digital elevation model - grid>
/* area <screen input - real variable>
/* depth <screen input - real variable>
/* Output: demplus <corrected digital elevation model - grid>
/* filplus <corrected filled digital elevation model - grid>
/* fdrplus <corrected flow direction - grid>
/* Promt: Arc
/*
/* This aml corrects the DEM by assigning NODATA to the sink cells.
/* Sink cells are the bottom cells of those fillings with area and
/* depth greater than threshold values specified by the user.
/* ************************************************************************
grid
/* Screen input
&sv area = [response 'Minimum inland catchment area']
&sv depth = [response 'Minimum inland catchment depth']
&sv threshold = [response 'Threshold area for watershed delineation (in grid cells)']
/* ************************************************************************
/* Write your DEM name in the next line
fp01 =
<your DEM path/name>
/* ************************************************************************
/* Filling the DEM
fill fp01 fp02
/* Calculating the filled depths
fp03 = fp02 - fp01
kill fp02 all
/* Assigning the value 1 to all the filled cells and 2 elsewhere
fp04 = con(fp03 > 0, 1, 2)
/* Assigning a label number to each to each pit (filled zone)
fp05 = regiongroup(fp04, #, eight)
kill fp04 all
/* Determining the area of each pit
fp06 = zonalarea(fp05)
/* Determining the depth of each pit
fp07 = zonalmax(fp05, fp03)
kill fp03 all
/* Assigning a label to each inland catchment and the value 0 elsewhere
fp08 = con(fp06 > %area% and fp07 > %depth%, fp05, 0)
kill fp05 all
kill fp06 all
kill fp07 all
/* Assigning the lowest elevation to all cells of each inland catchment
fp09 = zonalmin(fp08, fp01)
/* Assigning the value 0 to the lowest cell of each inland catchment
/* and 1 elsewhere
fp10 = con(fp09 == fp01 and fp08 <> 0, 0, 1)
kill fp08 all
kill fp09 all
/* Assigning NODATA to the lowest cell of each inland catchment
rename fp01 fp11
demplus = fp11 / fp10
kill fp10
kill fp11
/* Delineating streams and watersheds
fill demplus filplus # # fdrplus
facplus = flowaccumulation(fdrplus)
strplus = con(facplus > %threshold%, 1)
lnkplus = streamlink(strplus, fdrplus)
wshplus = watershed(fdrplus, lnkplus)
acsplus = streamline(lnkplus, fdrplus, grid-code)
pcwplus = gridpoly(wshplus)
quit
&return


Please e-mail your questions and comments to folivera@mail.utexas.edu


These materials may be used for study, research, and education, but please credit the authors and the Center for Research in Water Resources, The University of Texas at Austin. All commercial rights reserved. Copyright 1997 Center for Research in Water Resources.


Go to inland catchments methodology

Go to inland catchments exercise

Go to Francisco Olivera's homepage

Go to David Maidment's homepage