Read Global Topographic Data

by

 

29 Apr 2008 (Updated )

Two Matlab functions to extract the data from two global topographic data base, ETOPO2v2 and GEOBEC.

[LON LAT HH]=read_etopo2v2g_f4_nc_v2
function [LON LAT HH]=read_etopo2v2g_f4_nc_v2
% Read ETOPO2v2g data
%
GD=netcdf_PaulSpencer('ETOPO2v2g_f4.nc'); 
LON=GD.VarArray(1).Data;
LAT=flipud(GD.VarArray(2).Data);
 HH=flipud(int16(GD.VarArray(3).Data));
clear GD
 %% Note: The original data comes such that LON(end)==LON(1)+360 is true.
 % This means that HH(:,1) and HH(:, end) actually describe the 
 % topographic data on the same meridian line. We  therefore expect
 % that HH(:,1)==H(:,end) should be true. However this is not the case. 
 % If you uncommend and evaluate the following two lines, 
 
 % j=find(HH(:,1)-HH(:,end)); 
 % length(j)
 
 % you will find that out of the total 5401 points along the same meridian
 % line, HH(:,1) and HH(:, end) disagree for 4774 points, with differences 
 % ranging from 1 m to 2328 m. I am puzzled why the ETOPO2 fellows did not 
 % bother to check out this problem. In this regard, GEOBEC data is much 
 % better; I find only two points there different, with 1 m difference 
 % (see my notes in read_GridOne_v2).
 
 
%% However, we need to discard one of the repetitive mericiand lines anyway. 
 if LON(end)==LON(1)+360
     HH(:,end)=[];
     LON(end)=[];
 end
 
 LON=double(LON);
 LAT=double(LAT);
 HH=double(HH);
 
 %% ETOPO2v2g_f4.nc can be downloaded from 
 % http://www.ngdc.noaa.gov/mgg/global/relief/ETOPO2/ETOPO2v2-2006/ETOPO2v2g/netCDF/

Contact us