Skip to content

Commit

Permalink
Moved files
Browse files Browse the repository at this point in the history
Moved STREAMobj-related files (chiplot, slopearea, etc.) to the
@STREAMobj-folder
  • Loading branch information
wschwanghart committed Nov 4, 2017
1 parent 1a7e9f5 commit 480196d
Show file tree
Hide file tree
Showing 13 changed files with 28,255 additions and 1,271 deletions.
830 changes: 415 additions & 415 deletions flowpathapp.m → @FLOWobj/flowpathapp.m
100755 → 100644

Large diffs are not rendered by default.

32 changes: 26 additions & 6 deletions @GRIDobj/GRIDobj2pm.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
% Syntax
%
% [X,ix,txt,txtname] = GRIDobj2pm(A,B,C,...)
% [t,ix,txt,txtname] = GRIDobj2pm(A,B,C,...,'ds')
%
% Description
%
Expand Down Expand Up @@ -46,17 +47,32 @@
% Date: 17. August, 2017


if ischar(varargin{end});
usetall = true;
nrgrids = nargin - 1;
else
usetall = false;
X = zeros(numel(varargin{1}.Z),nargin);
nrgrids = nargin;
end

X = zeros(numel(varargin{1}.Z),nargin);
txt = cell(1,nargin);
txtname = cell(1,nargin);
for r=1:numel(varargin)
txt = cell(1,nrgrids);
txtname = cell(1,nrgrids);
for r=1:nrgrids

if r>1
validatealignment(varargin{r},varargin{1});
end

X(:,r) = double(varargin{r}.Z(:));
if ~usetall
X(:,r) = double(varargin{r}.Z(:));
else
if r == 1
X = tall(double(varargin{r}.Z(:)));
else
X = [X, tall(double(varargin{r}.Z(:)))];
end
end
txt{r} = inputname(r);
txtname{r} = varargin{r}.name;
end
Expand All @@ -65,4 +81,8 @@
ix = (1:numel(varargin{1}.Z))';

X = X(I,:);
ix = ix(I);
if ~usetall
ix = ix(I);
else
ix = ix(gather(I));
end
File renamed without changes.
9 changes: 8 additions & 1 deletion @STREAMobj/crs.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
% may evaluate faster even without the availability of
% the parallel computing toolbox.
%
%
% Output parameters
%
% zs node attribute list with smoothed elevation values
Expand Down Expand Up @@ -106,10 +105,13 @@
error('DEM or z may not contain any NaNs')
end

% double precision is necessary
z = double(z);

%% Run in parallel
if p.Results.split == 1
% This option processes each connected component of the stream network
% on a separate worker
params = p.Results;
params.split = false;
[CS,locS] = STREAMobj2cell(S);
Expand All @@ -132,6 +134,10 @@
end

elseif p.Results.split == 2
% This option processes each tributary on a separate worker.
% Tributaries are recursively extracted from the stream network,
% starting with the trunk river, then with the longest rivers tributary
% to the trunk river, and so on.

[CS,locb,CID] = STREAMobj2cell(S,'trib');

Expand Down Expand Up @@ -165,6 +171,7 @@
%% CRS starts here
% upstream distance
d = S.distance;

% nr of nodes
nr = numel(S.IXgrid);

Expand Down
Loading

0 comments on commit 480196d

Please sign in to comment.