本文主要是介绍SmythSandwell地形图调用,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
利用Smyth & Sandwell地形资料,matlab中也有相关的函数为
[latgrat,longrat,z] = satbath
[latgrat,longrat,z] = satbath(scalefactor)
[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim)
[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim,gsize)
可惜需要2min资料,而我千辛万苦拖下来的竟是1min资料,所以资料长度不对无法使用..
使用该资料自带的matlab程序extract_1m.m函数
% Function EXTRACT_1M Read bathymetry data from Sandwell Database
% [image_data,vlat,vlon] = extract_1m(region,iopt)
%
% Original Author: Catherine de Groot-Hedlin,
% August 21, 2007 revised for 1-minute grid.
% October 25, 2007, uncomment 2nd fopen command if using PC windows
%
% program to get bathymetry from topo_10.1.img (Smith and Sandwell bathymetry)
% (values are even numbered if interpolated, odd-numbered if from a ship sounding)
% WARNING 1: change DatabasesDir to the correct one for your machine
% WARNING 2: uncomment 2nd fopen command if using PC windows
% code is a conglomeration of many codes originally written by others
%
% latitudes must be between -80.738 and 80.738;
% input:
% region =[south north west east];
% iopt = 1 for bathymetry (default)
% 2 for ship tracks
% output:
% image_data
% (for iopt = 1) - matrix of sandwell bathymetry/topography
% (for iopt = 2) - matrix of ones and zeros, where 1 represents
% a ship location, 0 represents a depth based on interpolation
% vlat - vector of latitudes associated with image_data
% vlon - vector of longitudes
经度范围:东经为正[-180,180] 或[0, 180]
纬度范围:北纬为正[-80.738, 80.738]
m文件中
修改DatabasesDir = 'd:\study\topo';
对应windows系统,使用第二行fopen 并修改文件名称 topo_11.1.img
修改matlab当前文件夹
================调用=使用时取消%======================
% clear
% clc
% region=[16 21 107 114] ; %region=[-22 -19 115 117.5]
% iopt=1; %表示地形资料
% [image_data, vlat, vlon]=extract_1m(region, iopt);
% image_data(find(image_data>10))=0;
%
% % if iopt ==2
% % imagesc(vlon,vlat,image_data),axis('xy','image'),colormap(1-gray)
% % title('ship track soundings')
% % else
% % imagesc(vlon,vlat,image_data),axis('xy','image'),colormap(jet),colorbar('vert')
% % title('Smith and Sandwell bathymetry')
% % end
% % colormap(gray)
%得到2维matrix image_data ,纬度向量vlat,和经度向量vlon
%绘图用imagesc的不是很合适,彩绘图像太花哨
%改用contourf ,等深线填充图,contour为等深线图
%
% xlabel('longitude'),ylabel('latitude')
% contour3(vlon,vlat,image_data);
% % v = [0 -25 -50 -100 -200 -300 -500 -1000]; %定义等深线向量
% % [C, h] = contourf(vlon,vlat,image_data,v); %绘图,C为各坐标点
% % set (h,'ShowText','on','TextStep',get(h,'LevelStep')*2) %标注等深线
% axis('xy' , 'image') %以左下角为坐标起点,横竖坐标间距相等(适用于真实图像)
% colormap(gray),colorbar;
Reference:
Smith, W. H. F., D. T. Sandwell. Global seafloor topography from satellite altimetry and ship depth soundings. Science, 1997, 277: 1957~1962.
http://topex.ucsd.edu/marine_topo/mar_topo.html
这篇关于SmythSandwell地形图调用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!