New code repository on GitHub

Posted on

The CSDMS decided to move its code repository to GitHub. I think that this is a good decision. GitHub is more user-friendly and allows for easier collaboration than the previous system. I had my own account at GitHub before. Thus I forked the CSDMS TopoToolbox repository to my account. Dirk Scherler and I will work on this repository in the future, but we will merge major updates back to CSDMS repository.

Does this matter to you? Yes. If you want to download the latest release, go to /topotoolbox. If you want to download the latest working-copy, go here: /topotoolbox.


Graph theory in the Geosciences

Posted on Updated on

In a recent paper, Tobias Heckmann, I and Jonathan Phillips reviewed applications of graph theory in geomorphology. In a now published paper in Earth-Science Reviews, we take an even broader view by looking at graph theoretical applications in the geosciences in general. Specifically, we reviewed three areas of application: spatially explicit modelling, small-world networks, and structural models of Earth surface systems. We identify several factors that make graph theory especially well suited to the geosciences: inherent complexity of Earth surface systems, the increasing demand for exploration of very large data sets, focus on spatial fluxes and interactions, and the increasing attention to system state transitions.

Phillips, J.D., Schwanghart, W., Heckmann, T. (2014): Graph theory in the geosciences. Earth Science Reviews, 143, 147–160. [DOI: 10.1016/j.earscirev.2015.02.002]

New paper out in The Cryosphere

Posted on Updated on

This is a quick note that Caroline Clason’s discussion paper on supraglacial meltwater transfer is now published in The Cryosphere. Please find the full paper here.

Clason, C.C., Mair, D., Nienow, P., Bartholomew, I., Sole, A., Palmer, S., Schwanghart, W. (2015): Modelling the transfer of supraglacial meltwater to the bed of Leverett Glacier, southwest Greenland. The Cryosphere, 9, 123-138. [DOI: 10.5194/tc-9-123-2015]

Plotting colored stream networks

Posted on Updated on

Visual exploration of stream networks and channel length profiles is a mandatory first step before advancing towards more sophisticated tools such as slope-area plots or chiplots. Taking a look at both planform river patterns and respective channel length profiles will provide a good impression of the three-dimensional river patterns. Here is a quick guide how to visualize a stream network using different colors for each river system (or drainage basin). An underappreciated function comes in handy here: STREAMobj2cell.

DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
FD  = FLOWobj(DEM,'preprocess','carve');
S   = STREAMobj(FD,'minarea',1000);
CS  = STREAMobj2cell(S);

h1 = subplot(1,2,1);
h2 = subplot(1,2,2);
clrs = jet(32);

for r=1:numel(CS);

set(h2,'DataAspectRatio',[1 1/16 1])


I have manually edited the figure to make the figure look nicer. The question, however, is: What is the function STREAMobj2cell doing? This function returns stream networks belonging to an individual drainage basin as separate STREAMobjs in a cell array. Having this cell array, you just need to loop through and index into the cell array to access individual “connected components” of the stream network. Together with other functions for stream network modification such as modify, trunk or klargestconncomps, I think STREAMobj2cell will greatly help you to automate your stream network analysis.

Media coverage of our research in Nepal

Posted on Updated on

One of the current projects of Geohazards group at University of Potsdam is about the young geologic history of the Pokhara basin in Nepal.

In the future, I’ll post some more information on our work there. This post is just a quick reference to a two-part movie (in german) produced by the RBB and which was shown on 08. and 15. December 2014 (part one, part two). The movie mainly covers the research project on airborne acquisition of meteorological and image data undertaken by the RWTH Aachen and the German Space Agency (DLR). At around 36 min of the second part, you’ll see Oliver Korup and me eagerly anticipating the use of this data in our research.

New paper out in Geomorphology

Posted on Updated on

The mathematical branch that deals with networks is called graph theory. No wonder, that TopoToolbox that deals with river and flow networks has strong relations to graph theory. Indeed, many computational tricks adopted in TopoToolbox to increase the speed of deriving flow related terrain attributes (e.g. flow accumulation) are rooted in graph theoretic algorithms such as topological sorting. Yet, there is much more to learn from graph theory for diverse applications in geomorphology. Tobias Heckmann, me and Jonathan D. Phillips have written a review paper about these applications, and the manuscript has just now been accepted by the journal Geomorphology. The manuscript reviews all sorts of graph theory applications in geomorphology including the analysis of system structures and the analysis of spatially explicit networks. Have fun reading. If you don’t have access to the journal, I am happy to send you a pdf-copy.

Heckmann, T., Schwanghart, W., Phillips, J.D. (2014): Graph theory – recent developments of its application in geomorphology. Geomorphology, accepted. [DOI: 10.1016/j.geomorph.2014.12.024]


Distances in drainage basins

Posted on Updated on

What is the location in a catchment being farthest away from the catchment outlet? Clearly, there are several answers to this question. It depends on which distance metric you use. So which metrics might be relevant?

Let’s prepare the data first and load the example DEM, calculate flow directions (FLOWobj), and derive a stream network (STREAMobj) by thresholding upslope area. We extract the largest subgraph of the network (klargestconncomps) and retrieve its outlet pixel (streampoi). We derive the outlet’s coordinates using ind2coord and calculate the drainage basin of this outlet (drainagebasins).

DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
FD = FLOWobj(DEM,'preprocess','carve');
S  = STREAMobj(FD,'minarea',1000);
S  = klargestconncomps(S,1);
ix = streampoi(S,'outlets','ix');
[xout,yout] = ind2coord(DEM,ix);
DB  = drainagebasins(FD,ix);
DB  = DB>0;

As a first measure of distance, you might take the largest euclidean distance within the catchment. Given a catchment outlet ix and its drainage basin, you can calculate this as follows: Use bwdist to do calculate the distance seeded at the catchment outlet. Note that this function is not (yet) overloaded in TopoToolbox. Thus, access to GRIDobjs properties is required. Here is my approach to do this:

% Create a logical seed grid
SEED = GRIDobj(DEM,'logical');
SEED.Z(ix) = true;
% and an empty grid to which we'll write the output of bwdist
D    = GRIDobj(DEM);
D.Z  = bwdist(SEED.Z,'euclidean') * DEM.cellsize;

maxd = max(D.Z(DB.Z(:)));
LOCS = D==maxd & DB;
IX   = find(LOCS.Z);
[x,y] = ind2coord(DEM,IX);

hold on
plot([repmat(xout,size(x)) x]',[repmat(yout,size(y)) y]','k');
hold off


If the drainage basin has a curved shape, however, one might want to constrain distance calculation to a path that runs inside the catchment. This would better represent the true distance when the centerline of the drainage basin is to be approximated by a straight line. This is where bwdistgeodesic comes in:

D.Z = bwdistgeodesic(DB.Z>0,SEED.Z,'q') * DEM.cellsize;
maxd = max(D.Z(DB.Z(:)));
LOCS = D==maxd & DB;
IX   = find(LOCS.Z);
[x,y] = ind2coord(DEM,IX);
hold on
plot([repmat(xout,size(x)) x]',[repmat(yout,size(y)) y]','k');
hold off


In our case, there is no difference between the outputs of bwdist and bwdistgeodesic since the shortest path runs within the mask set by the drainage basin.

In other instances, you might want to derive the farthest distance that a raindrop must take to reach the outlet. This distance refers to the longest distance along the flow network which can be calculated with the TopoToolbox function flowdistance. For comparison, we will plot the longest flowpath(s), too.

D  = flowdistance(FD,ix);
maxd = max(D.Z(DB.Z(:)));
LOCS = D==maxd & DB>0;
IX   = find(LOCS.Z);
[x,y] = ind2coord(DEM,IX);
hold on
plot([repmat(xout,size(x)) x]',[repmat(yout,size(y)) y]','k');
I = influencemap(FD,IX);
S2 = STREAMobj(FD,I);
hold off


Note that flowdistance takes additional parameters that let you define seed pixels other than the outlet pixels. You might, for example, calculate the flow distances upstream of the stream network.

D = flowdistance(FD,S);


In other instance you might want to know at each location the longest flowpath lengths. I use the function dilate here to highlight high distance values as they prevail along the stream network.

D = flowdistance(FD,'downstream');
D = dilate(D,ones(5));


Do you have applications for distance metrics in drainage basin analysis. Let me know and leave a comment.

— edited on 14 August 2015 to remove formatting errors —