1 Star 3 Fork 1

Harold Gan / Geophysical virtual simulation program--undergraduate teaching experiment project

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
m_tba2b.m 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
Harold Gan 提交于 2022-04-28 11:43 . 第一次提交
function m_tba2b(fnam);
% M_TBA2B Converts the ASCII TerrainBase 5-minute bathymetry database
% (size 56Mb) available from
% ftp://ncardata.ucar.edu/datasets/ds759.2/tbase.Z
% into a binary file of 2-byte integers that can be read by
% M_TBASE to provide high-resolution global bathymetry.
%
% To use this file, first
%
% a) get and uncompress the tbase.Z file from the above URL into the
% current directory.
%
% b) run this function:
%
% m_tba2b(PATHNAME)
%
% to store the resulting binary (of size 18Mb) as PATHNAME/tbase.int
%
% c) Edit the PATHNAME setting in M_TBASE to point to the
% location of this file.
%
% d) delete the ASCII file tbase.
%
% Rich Pawlowicz (rich@ocgy.ubc.ca) 2/Oct/1997
%
% This software is provided "as is" without warranty of any kind. But
% it's mine, so you can't sell it.
if nargin==0,
fnam='.';
end;
fnam=[fnam '/tbase.int'];
fid=fopen('tbase','rt');
if fid==-1,
error('Cannot find file called ''tbase'' ');
end;
fidb=fopen(fnam,'w');
if fidb==-1,
error(['Cannot open file ''' fnam '''']);
end;
for k=1:466560,
data=fscanf(fid,'%6d',20);
fwrite(fidb,data,'int16');
if rem(k,2000)==0,
disp([ int2str(k) '/466450 lines processed']);
end;
end;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Matlab
1
https://gitee.com/gan-haodong/geophysical-virtual-simulation-program--undergraduate-teaching-experiment-project.git
git@gitee.com:gan-haodong/geophysical-virtual-simulation-program--undergraduate-teaching-experiment-project.git
gan-haodong
geophysical-virtual-simulation-program--undergraduate-teaching-experiment-project
Geophysical virtual simulation program--undergraduate teaching experiment project
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891