X inferiority

Posted on

I just need to finish the year with a quick blog entry… And this one is – once again – about chi maps.

I thought about different ways to display chi maps. chi maps are usually plotted using stream networks. However, to this end, chi maps are not so much about stream networks but rather about drainage divides and how they potentially migrate in the future. In addition, the distance of potential divide migration depends on the relative difference of chi values on either side of the divide, not so much on the absolute values. How could we create a map that reflects this information

Here is an idea: First, we create a chi transform of the river network (see function chitransform). Then we map these chi-values to the entire grid. This can be accomplished with the new function mapfromnal which lets you map values from a stream network to its nearest upstream contributing pixels. Then, we will derive some-pixel wide fringes of chi values around the divides and calculate their spatial average. Dividing the chi values by these spatial averages then quantifies the degree to which some part of the divide is either a victim or an aggressor. Since victims have higher values, I call this metric the chi-inferiority.

Now here is the code:

DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
FD  = FLOWobj(DEM);
S   = STREAMobj(FD,'minarea',500);
S   = removeedgeeffects(S,FD);
[~,zb] = zerobaselevel(S,DEM);
A   = flowacc(FD);

c   = zb + chitransform(S,A);
C   = mapfromnal(FD,S,c);
D   = drainagebasins(FD,S);

for r = 1:max(D)
    I = D==r;
    I = erode(I,ones(21)) & I;
    C.Z(I.Z) = nan;

C1 = dilate(C,ones(21));
C2 = erode(C,ones(21));

C  = C/((C1 + C2)/2);
hold on
hold off
Map of chi-inferiority of the Big Tujunga catchment. Coloring is based on the vik colormap of the scientific colormaps of Fabio Crameri.

Happy New Year everone!


8 thoughts on “X inferiority

    Lester Olivares said:
    April 30, 2019 at 3:01 am

    If is necessary to change the baselevel… How could I do that? for example if I want to study hanged basins?

      wschwanghart responded:
      May 6, 2019 at 2:04 pm

      To be able to compare chi values at divides, the stream network should have a common base level. The second output of zerobaselevel is what you need if the extent of the DEM is too small to hold the entire network of streams down to their baselevel.

    Manish Pandey said:
    May 17, 2019 at 9:00 am

    Dear Schwanghart,
    I don’t understand, why does this error, “Undefined function or variable ‘loadcmap’.
    Error in ttscm (line 102)
    cmap = loadcmap(cmaptype); ”
    come when running the above code, “imageschs(DEM,C,’colormap’,ttscm(‘vik’),…
    Where am I committing the fault?

      wschwanghart responded:
      May 17, 2019 at 9:04 am

      Dear Manish, I don’t know. Is it possible that the function ttscm was moved to a different folder? loadcmap is in the private folder that must be in the same directory as ttscm. Best, Wolfgang

        Manish Pandey said:
        May 17, 2019 at 10:35 am

        Thank you so much! I could run it successfully. It’s only with your help it could have become possible.

        One more query….is there any limit for how large area DEM can be computed in one run with this code or is there any area size limitation in Matlab 2018b (or any version of it) to calculate in one run?

          wschwanghart responded:
          May 17, 2019 at 1:29 pm

          MATLAB stores its variables mainly in the main memory. Hence, the maximum DEM size is mainly limited by the available RAM. GRIDobj stores DEMs by default in single precision. The maximum sized DEMs that I work with usually tend to have 20000×30000 pixels. My computer has 64 Gb RAM, though.

    Manish Pandey said:
    May 29, 2019 at 9:11 am

    Dear Wolfgang,
    Please help me export ‘chi’ into shapefile format. I have sliced my entire study area into a number of blocs and have calculated chi values for each bloc. Now the problem is I am unable to have a complete picture of what’s the pattern of chi distribution in my study area until I add the chi maps of all the blocks onto the complete DEM of the area.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.