Skip to content

Commit 181a930

Browse files
committed
bug fix
a rough bug fix, see code
1 parent e0d2716 commit 181a930

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

code/etopo_get.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
% sourcefile: the source file (.../ETOPO1.nc)
4343
% MODIFICATION HISTORY:
4444
% David N. Bresch, david.bresch@gmail.com, 20140422
45+
% David N. Bresch, david.bresch@gmail.com, 20141022, small fix if requested area ourside limits (just a FIX, not a nice one, see below)
4546
%-
4647

4748
ETOPO=[]; % init output
@@ -115,6 +116,8 @@
115116
% z = ncread(file,'z',[1 3000], [Inf Inf]); % the full dataset
116117

117118
% read the required subset of the global dataset
119+
if isnan(startx),startx=1;end % 20141022, david_bresch@gmail.com
120+
if isnan(countx),countx=1;end % 20141022, david_bresch@gmail.com
118121
ETOPO.h = ncread(etopo_data_file,'z',[startx starty], [countx+1 county+1]);
119122
ETOPO.h=ETOPO.h'; % transpose to fit meshgrid definition (see next line)
120123

0 commit comments

Comments
 (0)