10.07.2015 Views

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

Finding Potential Sites for Small-Scale Hydro Power in Uganda: a ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9.4 Algorithm SyntaxHEADHUNTERthe softwaremade by Christoffer Malmros & David BergströmMaster Thesis <strong>in</strong> Physical Geography March 2005This algorithm is developed to search through Rasterized Rivers, <strong>in</strong> order to f<strong>in</strong>d a heightdifference (head), of 20 meters over a distance of 100 meters. It is designed to search amaximum of ten connect<strong>in</strong>g cells, which equals 100 meters. If the criteria of 20 meteraccumulated head is fulfilled, these cells will be saved <strong>in</strong>to a output raster.Needed <strong>in</strong>data:a Matrix show<strong>in</strong>g rivers where each river cell conta<strong>in</strong> absolute elevation, extractedfrom an Digital Elevation Model.All values not conta<strong>in</strong><strong>in</strong>g elevation are set to zero.clear;%clears variablesclf;%clears figureclc;%clears command w<strong>in</strong>dowtime1= clock;time3=clock;Input of dataf<strong>in</strong>=fop en ('rivers_elev.flt','r');%opens a file <strong>in</strong> read mode.data = fread(f<strong>in</strong>,[8254 5495],'float32');%reads th e data <strong>in</strong>to a matrix with 4 byte real values.data = dat a';%flips t he matrix to right angle.fclose(f<strong>in</strong>);% closes th e <strong>in</strong>put data file.[row,col] = size(data);%number of rows and columns are given as the variables "row" & "col".74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!