2021-04-20 m_map的几个地形水深数据库安装步骤

MATLAB的地图工具包m_map的几个地形水深数据库安装步骤

在m_map的官方页面M_Map: A Mapping package for Matlab的userguide页面(M_Map Users Guide)指出了m_map可以安装高精度地形/水深数据库(一是Sandwell and Smith Bathymetry,二是TerrainBase 5-minute global bathymetry/topography ,三是ETOPO 2 or 1-minute global bathymetry/topography )。这三个数据库由于m_map的作者希望m_map的工具包不要太大,所以希望使用者自行安装,其中第二种TerrainBase的分辨率为5分,作者指出这一个数据库因为历史原因而保留,在本文我们不讨论。另外两个数据库的安装步骤如下:

一. Sandwell and Smith

点击Satellite Geodesy, IGPP, SIO, UCSD | Global Topography | Measured and estimated seafloor topography, 点击下方页面的[NEW! Global Topography       V19.1                November 29, 2014]的Global Topography(注意部分浏览器可能点Global Topography不跳转,可以换一个浏览器,本人换的火狐浏览器),跳转到下图

点击最新年份的[topo_20.1.img],浏览器将自动下载。下载之后不必解压,比如我们的下载路径是F:/topo_20.1.img.

接下来打开m_map工具包的mygrid_sand2.m文件,改变下图[ssfname]的路径(即是上面我们下载的topo_20.1.img的路径,注意ssfname的几个示例路径使用了“/”斜号,而非“\”,此处完全依照示例输入斜号),并且指定对应的版本号ssversion 20.1. 保存并关闭此m文件,步骤全部完成。

接下来,示例使用mygrid_sand2.m提取对应区域的地形或水深数据。

%% 绘制 using mygrid_sand 函数 提取经纬度范围内的水深
% [Sele,Sla,Slo] = mygrid_sand2([west east south north])
% [west east south north]
Ulo1 = [-90,-68];                          % 经纬度范围大致是美国东海岸的地形水深范围
Ula1 = [30,42];
m_proj('mercator','long',Ulo1,'lat',Ula1); % 绘图前需指定投影方式与范围

[Sele,Sla,Slo] = mygrid_sand2([-90 -68 30 42]);
figure()
%m_contour(Slo-360,Sla,Sele); % 西半球270转化为-90度,以此类推
m_contourf(Slo-360,Sla,Sele); % 西半球270转化为-90度,以此类推{contourf效果更好}
m_grid('box','fancy','tickdir','in','gridlines','no','fontsize',12)

colorbar

二. TerrainBase (本文忽略,请参考M_Map Users Guide的安装步骤)

三. Etopo2 或Etopo1 地形水深的安装(Etopo2和Etopo1的2和1数字是分辨率,分别是2弧分和1弧分的分辨率,1弧分分辨率更高,下面以此为例说明M_Map Users Guide给出了几个时段安装步骤,本文只考虑最新的安装步骤)

  1. (2004-2014 instructions: now obsolete), there is a corrected higher-resolution (2 minute) database ETOPO2. Download http://rda.ucar.edu/dsszone/ds759.3/etopo2_2006apr/etopo2_2006apr.raw.gz (a gzipped binary), gunzip it into a 116Mb file, edit the PATHNAME setting in m_etopo2 to point to the location of this file, and then use it in the same way as m_tbase and m_elev. UCAR requires users to register and the second link won't work without you doing this (go to first link and follow instructions).

  2. (2014-2017 instructions: mostly obsolete) In 2014, it was pointed out to me that the above is obsolete. First, there is a corrected 2-minute ETOPO database - ETOPO2v2 which you should be using instead. Now, ETOPO2v2 is a little more complicated, because it comes in 4 version - big-endian and little-endian, in both cell-centered and grid-centered versions.

    It doesn't particularly matter if you get big- or little-endian since you can modify the fopen line in m_etopo2 to account for this. I recommend getting the grid-centered version, since it works "better" when you are contouring the elevations (it will be more likely to extend all the way up to the map edge without weird little 'gaps').

    In any case, download one of the zipped binaries, unzip it, and then edit 4 lines in m_etopo2 to set the PATHNAME, the filename in the fopen line, as well as setting the last option to 'b' or 'l' for big-endian or little-endian formats. Then make sure the grid and resolution parameters are set appropriately. If you forget (or get them wrong), code may run but it won't give the right bathymetry!

  3. If you want even higher resolution bathymetry, you can also use the 1-minute ETOPO1. This appears to come in two versions: grid or cell-referenced, both little-endian. Again, I recommend the grid-referenced version etopo1_ice_g_i2.bin. Modify the relevant lines in m_etopo2 in the same way as for ETOPO2v2.

  4. (2017-present instructions: use these) As of 2017, notice that the file you want for ETOPO1etopo1_ice_g_i2.bin is not available as a link from that page - instead they just reference a netCDF and a geo-referenced tiff version. Also, you will see two different versions that handle differences between the true surface and the top of the permanent icepacks in Greenland and Antarctica. Fear not! If you click on one of those, you fall into a directory page - click PARENT DIRECTORY, then binary, and you get into the place you want! For example, Index of /mgg/global/relief/ETOPO1/data/ice_surface/grid_registered/binary for the top-of-the-ice data.

点击下载上图的[etopo1_ice_g_i2.zip]蓝色链接,自动下载数据,下载之后解压,然后打开m_map工具包的m_etopo2函数,像一的改变路径步骤一样更改路径。确保路径用/斜号而不是\

注意: m_etopo2函数同样可以提取水深数据{请打开此函数}

%        [ELEV,LONG,LAT]=M_ETOPO2([LONG_MIN LONG_MAX LAT_MIN LAT_MAX])
%        extracts elevation data for the given lat/long limits (without 
%        plotting).

总结: 一Sandwell and Smith和三Etopo1是两种不同的地形水深数据库,使用对应的mygrid_sand2.m和m_etopo2.m函数可以提取对应区域的地形水深数据。本文以上内容介绍了这些数据库的下载与安装。

  • 2
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值