-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d375208
commit ebfe15c
Showing
5 changed files
with
116 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
function tf = validatealignment(FD,G) | ||
|
||
%VALIDATEALIGNMENT validates whether instances of FLOWobj and GRIDobj are spatially aligned | ||
% | ||
% Syntax | ||
% | ||
% tf = validatealignment(FD,G) | ||
% validatealignment(FD,G) | ||
% | ||
% Description | ||
% | ||
% returns true if instances of FLOWobj and GRIDobj are spatially | ||
% aligned. When the function returns false and is called without | ||
% output argument, the function returns an error message. | ||
% | ||
% Input arguments | ||
% | ||
% FD instance of FLOWobj | ||
% G instance of GRIDobj | ||
% | ||
% Output arguments | ||
% | ||
% tf true or false | ||
% | ||
% See also: FLOWobj, GRIDobj | ||
% | ||
% Author: Wolfgang Schwanghart (w.schwanghart[at]geo.uni-potsdam.de) | ||
% Date: 4. March, 2016 | ||
|
||
% check if geometric properties of a FLOWobj and GRIDobj instance are equal | ||
if isa(G,'GRIDobj'); | ||
TF = isequal(FD.size,G.size) && isequal(FD.refmat,G.refmat); | ||
else | ||
TF = isequal(FD.size,size(G)); | ||
end | ||
|
||
if nargout == 1; | ||
tf = TF; | ||
else | ||
if ~TF | ||
if isa(G,'GRIDobj') | ||
error('TopoToolbox:incorrectinput',... | ||
['FLOWobj and GRIDobj do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if their properties ''size'' \n' ... | ||
'and ''refmat'' are both equal.']); | ||
else | ||
error('TopoToolbox:incorrectinput',... | ||
['FLOWobj and input matrix do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if the FLOWobj''s property \n' ... | ||
'''size'' and size(A) is equal.']); | ||
end | ||
end | ||
end | ||
function tf = validatealignment(FD,G) | ||
|
||
%VALIDATEALIGNMENT validates whether instances of FLOWobj and GRIDobj are spatially aligned | ||
% | ||
% Syntax | ||
% | ||
% tf = validatealignment(FD,G) | ||
% validatealignment(FD,G) | ||
% | ||
% Description | ||
% | ||
% returns true if instances of FLOWobj and GRIDobj are spatially | ||
% aligned. When the function returns false and is called without | ||
% output argument, the function returns an error message. | ||
% | ||
% Input arguments | ||
% | ||
% FD instance of FLOWobj | ||
% G instance of GRIDobj | ||
% | ||
% Output arguments | ||
% | ||
% tf true or false | ||
% | ||
% See also: FLOWobj, GRIDobj | ||
% | ||
% Author: Wolfgang Schwanghart (w.schwanghart[at]geo.uni-potsdam.de) | ||
% Date: 4. March, 2016 | ||
|
||
% check if geometric properties of a FLOWobj and GRIDobj instance are equal | ||
if isa(G,'GRIDobj') | ||
TF = isequal(FD.size,G.size) && isequal(FD.refmat,G.refmat); | ||
else | ||
TF = isequal(FD.size,size(G)); | ||
end | ||
|
||
if nargout == 1 | ||
tf = TF; | ||
else | ||
if ~TF | ||
if isa(G,'GRIDobj') | ||
error('TopoToolbox:incorrectinput',... | ||
['FLOWobj and GRIDobj do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if their properties ''size'' \n' ... | ||
'and ''refmat'' are both equal.']); | ||
else | ||
error('TopoToolbox:incorrectinput',... | ||
['FLOWobj and input matrix do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if the FLOWobj''s property \n' ... | ||
'''size'' and size(A) is equal.']); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
function tf = validatealignment(GRID1,GRID2) | ||
|
||
%VALIDATEALIGNMENT validates whether instances of GRIDobj are spatially aligned | ||
% | ||
% Syntax | ||
% | ||
% tf = validatealignment(GRID1,GRID2) | ||
% validatealignment(GRID1,GRID2) | ||
% | ||
% Description | ||
% | ||
% returns true if instances of GRIDobj are spatially | ||
% aligned. When the function returns false and is called without | ||
% output argument, the function returns an error message. | ||
% | ||
% Input arguments | ||
% | ||
% GRID1 instance of GRIDobj | ||
% GRID2 instance of GRIDobj or matrix | ||
% | ||
% Output arguments | ||
% | ||
% tf true or false | ||
% | ||
% See also: GRIDobj | ||
% | ||
% Author: Wolfgang Schwanghart (w.schwanghart[at]geo.uni-potsdam.de) | ||
% Date: 8. August, 2015 | ||
|
||
% check if geometric properties of a FLOWobj and GRIDobj instance are equal | ||
if isa(GRID2,'GRIDobj'); | ||
TF = isequal(GRID1.size,GRID2.size) && isequal(GRID1.refmat,GRID2.refmat); | ||
else | ||
TF = isequal(GRID1.size,size(GRID2)); | ||
end | ||
|
||
if nargout == 1; | ||
tf = TF; | ||
else | ||
if ~TF | ||
if isa(GRID2,'GRIDobj') | ||
error('TopoToolbox:incorrectinput',... | ||
['The two GRIDobj instances do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if their properties ''size'' \n' ... | ||
'and ''refmat'' are both equal.']); | ||
else | ||
error('TopoToolbox:incorrectinput',... | ||
['GRIDobj and input matrix do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if the GRIDobj''s property \n' ... | ||
'''size'' and size(A) is equal.']); | ||
end | ||
end | ||
end | ||
function tf = validatealignment(GRID1,GRID2) | ||
|
||
%VALIDATEALIGNMENT validates whether instances of GRIDobj are spatially aligned | ||
% | ||
% Syntax | ||
% | ||
% tf = validatealignment(GRID1,GRID2) | ||
% validatealignment(GRID1,GRID2) | ||
% | ||
% Description | ||
% | ||
% returns true if instances of GRIDobj are spatially | ||
% aligned. When the function returns false and is called without | ||
% output argument, the function returns an error message. | ||
% | ||
% Input arguments | ||
% | ||
% GRID1 instance of GRIDobj | ||
% GRID2 instance of GRIDobj or matrix | ||
% | ||
% Output arguments | ||
% | ||
% tf true or false | ||
% | ||
% See also: GRIDobj | ||
% | ||
% Author: Wolfgang Schwanghart (w.schwanghart[at]geo.uni-potsdam.de) | ||
% Date: 8. August, 2015 | ||
|
||
% check if geometric properties of a FLOWobj and GRIDobj instance are equal | ||
if isa(GRID2,'GRIDobj'); | ||
TF = isequal(GRID1.size,GRID2.size) && isequal(GRID1.refmat,GRID2.refmat); | ||
else | ||
TF = isequal(GRID1.size,size(GRID2)); | ||
end | ||
|
||
if nargout == 1; | ||
tf = TF; | ||
else | ||
if ~TF | ||
if isa(GRID2,'GRIDobj') | ||
error('TopoToolbox:incorrectinput',... | ||
['The two GRIDobj instances do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if their properties ''size'' \n' ... | ||
'and ''refmat'' are both equal.']); | ||
else | ||
error('TopoToolbox:incorrectinput',... | ||
['GRIDobj and input matrix do not align each other. Make sure that \n' ... | ||
'both instances have the same spatial reference. Both variables \n' ... | ||
'are deemed to have the same reference if the GRIDobj''s property \n' ... | ||
'''size'' and size(A) is equal.']); | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters