资源描述
GMT,简介及其常用命令,GMT,简介及其常用命令,王正涛,GMT,(,Generic Mapping Tools,)软件是地球科学中经常使用的绘图软件。是由,Paul,Wessel,and Walter H.F.Smith,开发,的免费工具。其最初版本是,1988,年作者在,Lamont-Doherty Earth Observatory of Columbia University,读研究生时开发,那时就得到了很多科学工作者的青睐。,1991,年,10,月,第,2,版发行,并在,EOS trans,上发表文章进行了说明,从此,,GMT,成为一种标准工具,特别是对地学和海洋科学工作者。后来相继发行了,3.0-3.3,,,3.3.1-6,,,3.4,,,3.4.1-5,和,4.0-1,,以及于,2006,年,3,月的最新版本,4.1.1,。如今,其用户已经超过了,10000,。,一、,GMT,简介,netCDF,3.4,或更高版本,(,www.unidata.edu,),;,C,编辑器,(,www.gnu.org,),;,100 Mb,左右硬盘,(,另外,70 Mb,存储完整的、高分辨率的全球海岸线,),32 Mb,左右内存。,GMT,采用,C,语言编写,无硬件限制。为最大的发挥其灵活性,采用完全命令行形式,主要设计为,UNIX,环境工具,目前也提供,windows,下安装版本,但需要模拟,UNIX,操作环境安装运行。,到现在为止,,GMT,至少包含了,50,个工具箱和,25,个地图投影。能够实现对数据的各种操作和成图,包括数据重采样、滤波、谱估计、时间序列趋势分析、空间离散数据的格网化、,2,维数据在空间域和频率域的数学运算、体积计算和趋势面分析。,利用,GMT,可以实现线性、对数和指数图,矩形直方图,还可以绘制等高线,栅格图,单色或彩色影像图,和三维透视图,以及全球的陆地和海岸线。,二、,GMT,功能,输入数据:,Data tables.,具有固定列数,任意行数,,(,x,y,)or(,x,y,z,),;,1,、,ASCII,2,、,Binary,Gridded,dated sets,;,Color palette table(For imaging,color plots,and contour maps).,输出结果:,PostScript plot commands.,Data,Table(s,).,Gridded,data,set(s,).,Statistics&Summaries.,Warnings and Errors.,Exit status(0 means success,otherwise failure).,基本命令:,gmtdefaults,List the current default settings,gmtset,Change selected parameters in current.,gmtdefaults,file,minmax,Report extreme values in table data files,makecpt,Make color palette tables,gmtmath,Mathematical operations on table data files,三、,GMT,常用命令,格网化命令:,xyz2grd,Convert a table xyz file to a 2-D,gridded,file,nearneighbor,Nearest-neighbor,gridding,scheme,surface,A continuous curvature,gridding,algorithm,triangulate,Perform optimal,Delauney,triangulation on xyz data,常用格网数据处理命令:,grd2xyz,Convert 2-D,gridded,data to table data,grd2cpt,Make color palette table from,gridded,file,grdmath,Reverse Polish Notation(RPN)calculator for,gridded,files,grdcut,Cut a sub-region from a,gridded,file,常用画图命令:,psbasemap,Create a,basemap,frame,psxy,Plot symbols,polygons,and lines in 2-D,psxyz,Plot symbols,polygons,and lines in 3-D,pstext,Plot,textstrings,psscale,Plot grayscale or,colorscale,pscoast,Plot coastlines,filled continents,rivers,and political borders,psclip,Use polygon files as clipping paths,grdcontour,Contouring of 2-D,gridded,data,grdimage,Produce images from 2-D,gridded,data,grdvector,Plot vector fields from 2-D,gridded,data,常用参数设置:,B Defines,tickmarks,annotations,and labels for,basemaps,and axes,J Selects a map projection or coordinate transformation,R Defines the extent of the map/plot region,H Specifies that input/output tables have header,record(s,),P Selects Portrait plot orientation Default is landscape,K Allows more plot code to be appended to this plot later,O Allows this plot code to be appended to an existing plot,U Plots a time-stamp,by default in the lower left corner of page,V Selects verbose operation;reporting on progress,X Sets the x-coordinate for the plot origin on the page,Y Sets the y-coordinate for the plot origin on the page,b Selects binary input and/or output,:Assumes input geographic data are(,lat,lon,)and not(,lon,lat,),-R0/360/-90/90-JX6i/4i-Ba120f60g30/a30g30WSen,psxy,uso.dat,-R1200/2000/21/34,-B100:Day:/2:uso:WSen-JX6i-P,-K,uso.ps,psxy,uso.dat,-R-B-JX6i,-Sc0.15c-G0/0/0-P-K-O,uso.ps,1214 32.7557278630,1215 32.7745764179,1216 32.7315140870,uso.dat,:,#!/bin/bash,#GMT command,#,#$Id:image.bash,2006/04/22 sgg gravity$,#,#Purpose:Make color images based,gridded,data,#GMT,progs,:,gmtset,xyz2cpt,makecpt,grdimage,psscale,#Unix,progs,:,rm,#,gmtset,HEADER_FONT_SIZE 30,gmtset,FRAME_WIDTH 0.1c,xyz2grd,china_mss.dat,-R70/150/0/50-I30m/30m-:-,Gchina_mss.grd,makecpt,-,Crainbow,-T-106/83/0.01,g.cpt,grdimage,china_mss.grd,-R-JQ180/6i-B10g10:.China,MSS:WSen,-P K,-,Cg.cpt,-X1i-Y2i,china_mss.ps,pscoast,-R-JQ180/6i-B-W0.25p-G200-P-K-O,china_mss.ps,psscale,-,Cg.cpt,-D3i/-0.5i/4i/0.3ih-B20/:m:-P-O,china_mss.ps,rm,-f,g.cpt,china_mss.grd,GMT homepage,:,Http:/gmt.soest.hawaii.edu,Thanks!,
展开阅读全文