Skip to content

Commit eaa41c1

Browse files
authored
Merge pull request TopoToolbox#139 from dirkscherler/main
Update to DIVIDEobj etc
2 parents 387769e + e8ab88e commit eaa41c1

9 files changed

Lines changed: 311 additions & 266 deletions

File tree

toolbox/@DIVIDEobj/DIVIDEobj.m

Lines changed: 289 additions & 253 deletions
Large diffs are not rendered by default.

toolbox/@DIVIDEobj/cleanedges.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
% Examples
2525
%
2626
% DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
27-
% FD = FLOWobj(DEM,'preprocess','c');
27+
% FD = FLOWobj(DEM);
2828
% S = STREAMobj(FD,flowacc(FD)>1000);
2929
% D = DIVIDEobj(FD,S);
3030
% subplot(1,2,1)
3131
% plot(D)
32+
% axis image
3233
% D2 = cleanedges(D,FD);
3334
% subplot(1,2,2)
3435
% plot(D2)
36+
% axis image
3537
%
3638
% See also: DIVIDEobj, DIVIDEobj/divnet
3739
%

toolbox/@DIVIDEobj/dist2node.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
% Examples
2929
%
3030
% DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
31-
% FD = FLOWobj(DEM,'preprocess','carve');
31+
% FD = FLOWobj(DEM);
3232
% FA = flowacc(FD);
3333
% ST = STREAMobj(FD,FA>500);
3434
% D = DIVIDEobj(FD,ST);

toolbox/@DIVIDEobj/jctangle.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
% Example
3333
%
3434
% DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
35-
% FD = FLOWobj(DEM,'preprocess','c');
35+
% FD = FLOWobj(DEM);
3636
% ST = STREAMobj(FD,flowacc(FD)>1000);
3737
% D = DIVIDEobj(FD,ST);
3838
% D = divorder(D,'topo');

toolbox/@DIVIDEobj/plot.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
% Example
4848
%
4949
% DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
50-
% FD = FLOWobj(DEM,'preprocess','c');
50+
% FD = FLOWobj(DEM);
5151
% ST = STREAMobj(FD,flowacc(FD)>1000);
5252
%
5353
% figure
@@ -116,6 +116,13 @@
116116
% Parse
117117
parse(p,varargin{:});
118118

119+
if ischar(p.Results.colormap)
120+
cmap = validatecolor(p.Results.colormap);
121+
else
122+
cmap = p.Results.colormap;
123+
end
124+
125+
119126
% default values
120127
if isempty(p.Results.style)
121128
if not(isempty(D.order))
@@ -168,9 +175,9 @@
168175
mindo = min(uqdo);
169176
a = (siz(2)-siz(1))/(maxdo-mindo);
170177
b = siz(1)-a*mindo;
171-
178+
172179
% Colormap
173-
rgb = num2rgb(uqdo,p.Results.colormap,[mindo maxdo]);
180+
rgb = num2rgb(uqdo,cmap,[mindo maxdo]);
174181
end
175182

176183
[x,y] = ind2coord(D,D.IX(ix));

toolbox/@DIVIDEobj/removeshortdivides.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
% Example
2626
%
2727
% DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
28-
% FD = FLOWobj(DEM,'preprocess','c');
28+
% FD = FLOWobj(DEM);
2929
% ST = STREAMobj(FD,flowacc(FD)>1000);
3030
% D = DIVIDEobj(FD,ST);
3131
% D = divorder(D,'topo');

toolbox/@DIVIDEobj/shrink.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
% Example
3535
%
3636
% DEM = GRIDobj('srtm_bigtujunga30m_utm11.tif');
37-
% FD = FLOWobj(DEM,'preprocess','c');
37+
% FD = FLOWobj(DEM);
3838
% ST = STREAMobj(FD,flowacc(FD)>1000);
3939
% D = DIVIDEobj(FD,ST);
4040
% D2 = shrink(D,FD,1000);
4141
% subplot(2,1,1)
42-
% plot(D,'color','k')
42+
% plot(D)
4343
% axis image
4444
% subplot(2,1,2)
45-
% plot(D2,'color','r')
45+
% plot(D2)
4646
% axis image
4747
%
4848
% See also: DIVIDEobj, DIVIDEobj/plot

toolbox/@GRIDobj/dist2curve.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
[X,Y] = getcoordinates(DEM,'matrix');
7676
qz = F(X(:),Y(:));
7777

78-
79-
OUT = GRIDobj(DEM,resize(qz,DEM.size));
78+
OUT = GRIDobj(DEM,'double');
79+
OUT.Z(:) = qz(:);
8080
OUT.Z(OUT.Z>maxdist | OUT.Z<mindist) = nan;
8181

toolbox/@STREAMobj/quantcarve.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195

196196
if options.mingradient~=0
197197
b = zeros(n,1);
198-
b(S.ix) = -p.Results.mingradient;
198+
b(S.ix) = -options.mingradient;
199199
else
200200
b = sparse(n,1);
201201
end

0 commit comments

Comments
 (0)