read_etopo2v2g_f4_nc_v2.m
来自「地形数据显示matlab文件包 这是外国人编写的一个工具程序包」· M 代码 · 共 37 行
M
37 行
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/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?