GMT使用手册解析.ppt

上传人:豆**** 文档编号:26987738 上传时间:2022-07-21 格式:PPT 页数:61 大小:1.59MB
返回 下载 相关 举报
GMT使用手册解析.ppt_第1页
第1页 / 共61页
GMT使用手册解析.ppt_第2页
第2页 / 共61页
点击查看更多>>
资源描述

《GMT使用手册解析.ppt》由会员分享,可在线阅读,更多相关《GMT使用手册解析.ppt(61页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、第一部分第一部分 GMT基本介绍及其安装基本介绍及其安装1. GMT简介简介GMT主要是由主要是由Paul Wessel和和Walter H.F.Smith以及以及全球的一群志愿者组织开发并且定时更新的绘图软件。它全球的一群志愿者组织开发并且定时更新的绘图软件。它是国际地学界普遍使用的绘图软件。它是遵循是国际地学界普遍使用的绘图软件。它是遵循GNU(通用(通用许可证)的、并由国际自由软件基金会赞助的完全免费的、许可证)的、并由国际自由软件基金会赞助的完全免费的、完全开放源代码的,功能齐全的绘图软件。它有大约完全开放源代码的,功能齐全的绘图软件。它有大约60种种绘图工具和支持大约绘图工具和支持大

2、约30种地图投影方式。它不仅能生成一种地图投影方式。它不仅能生成一般的平面图和二维等值线图,还能生成三维立体透视图。般的平面图和二维等值线图,还能生成三维立体透视图。另外另外GMT还提供了全球海岸线以及国界、行政区界线、河还提供了全球海岸线以及国界、行政区界线、河流的数据库,更方便的将工作区的位置显示到大的区域背景上。流的数据库,更方便的将工作区的位置显示到大的区域背景上。2. GMT安装安装GMT绘图软件可以从美国夏威夷大学的网站绘图软件可以从美国夏威夷大学的网站(http:/gmt.soest.hawaii.edu)上免费下载得到。上免费下载得到。也可以从西北大学地质学系网站(也可以从西北

3、大学地质学系网站(ftp:/10.0.0.3/Seismic Processing)上下载。上下载。主要包括下面的几个文件:主要包括下面的几个文件: netcdf.tar.Z triangle.tar.gzGMT_suppl.tar.gz install_gmt bzip2.zip GMT_tut.tar.gz GMT_pdf.tar.gz GMT_ps.tar.gz GMT_scripts.tar.gz GMT_progs.tar.gzGMT_man.tar.gz GMT_web.tar.gzGMT_high.tar.gz GMT_full.tar.gzGMT_progs.tar.gz安装过

4、程:安装过程:第一步:再根目录(第一步:再根目录(/)下建立)下建立GMT目录,将从网上下目录,将从网上下载文件复制到载文件复制到/GMT/目录下目录下: cp *.* /GMT/第二步:首先释放第二步:首先释放netcdf.tar.Z文件文件: tar zxvf netcdf.tar.Z 会产生一个会产生一个netcdf3.5.0的目录。的目录。第三步:释放第三步:释放triangle.tar.gz文件,文件, tar zxvf triangle.tar.gz会产生一个会产生一个triangle的目录。的目录。第四步:进入第四步:进入netcdf-3.5.0/src目录,安装目录,安装net

5、cdf: cd netcdf-3.5.0/src 进行预编译:进行预编译: ./configure 进行安装进行安装: make make check make install安装完成后,安装完成后, 会在会在netcdf-3.5.0目录下出现目录下出现bin、man、lib以及以及include的目录。的目录。第五步:安装第五步:安装GMT返回到返回到 GMT目录:目录: cd /GMT/运行运行install_gmt: ./install_gmt之后进入安装提示信息,按提示信息输入安装环境、之后进入安装提示信息,按提示信息输入安装环境、支持包所在的路径、软件中所采用的单位以及支持包所在的路

6、径、软件中所采用的单位以及GMT安装路安装路径等信息。径等信息。在安装完成后,会在在安装完成后,会在/GMT/目录下出现目录下出现GMT3.4.4的目的目录,其中包含录,其中包含 bin、man、lib以及以及include的目录。的目录。第二部分第二部分 GMT的使用的使用一、设置环境变量一、设置环境变量在使用前在使用前GMT要设置一些命令查找路径和软件的环境要设置一些命令查找路径和软件的环境参数。参数。设置命令查找路径:设置命令查找路径:export PATH=$PATH:/GMT/GMT3.4.4/bin/ 设置环境变量:设置环境变量:GMTHOME setenv GMTHOMW /us

7、r/local/GMT export GMTHOME=/usr/local/GMT 环境参数可以通过修改环境参数可以通过修改.gmtdefaults文件里面的参数文件里面的参数来实现,或者通过来实现,或者通过 gmtdefaults =修改后的值修改后的值的命令完成。的命令完成。通过通过gmtset命令我们可以改变命令我们可以改变GMT图形边框标注字体的图形边框标注字体的颜色、样式和大小。颜色、样式和大小。GMT可以使用的单位,包括可以使用的单位,包括cm(c)、)、inch(i)、)、meter(m)和)和ponit四种单位,可以使用两种来设置:四种单位,可以使用两种来设置: 在数字后直接加

8、上单位符号,如:在数字后直接加上单位符号,如:X4c2. 通过设置通过设置MEASURE_UN IT参数来实现。参数来实现。GMTGMT有许多预设的设定,要看有许多预设的设定,要看GMTGMT预设参数,在预设参数,在LinuxLinux环境下打环境下打 gmtdefaults -Dgmtdefaults -D。若要看使用者現正使用的参数,打若要看使用者現正使用的参数,打gmtdefaultsgmtdefaults -L-L。 預在預在jobjob內改参数,內改参数,gmtset + gmtset + 要改的参数,例如:要改的参数,例如:gmtset ANOT_FONT_SIZE 12 gmts

9、et ANOT_FONT_SIZE 12 (字型大小改成(字型大小改成1212)gmtset PAPER_MEDIA A4 (gmtset PAPER_MEDIA A4 (纸张大小设成纸张大小设成A4A4,若要画,若要画A0A0或或A1A1的大图,则改为的大图,则改为A0A0或或A1)A1)gmtset BASEMAP_TYPE FANCY (gmtset BASEMAP_TYPE FANCY (画出的地形图边框为一黑一画出的地形图边框为一黑一白间隔,此为白间隔,此为GMTGMT预设值预设值) )二、命令的基本语法二、命令的基本语法命令名命令名 输入文件名输入文件名 选项选项 !输出文件名输出

10、文件名 命令名命令名 !输出文件名输出文件名命令名命令名 输入文件名输入文件名 选项选项 !输出文件名输出文件名 输入文件与输出文件:输入文件与输出文件: GMT输入数据文件包括:输入数据文件包括:ACSII码文件、二进制文件、码文件、二进制文件、栅格文件以及调色板数据文件。栅格文件以及调色板数据文件。经过经过GMT处理后输出文件包括:处理后输出文件包括:ps图形文、图形文、 ACSII码文码文件、二进制文件、栅格文件、统计图文件以及警告和错误件、二进制文件、栅格文件、统计图文件以及警告和错误信息文件等。信息文件等。三:常用的GMT 函数列表FILTERING OF 1-D AND 2-D D

11、ATA:ublockmean L2 (x,y,z) data filter/decimator ublockmedian L1 (x,y,z) data filter/decimator ufilter1d Filter 1-D data (time series) ugrdfilter Filter 2-D data in space domain PLOTTING OF 1-D and 2-D DATA:ugrdcontour Contouring of 2-D gridded data (等值线图,grd)ugrdimage Produce images from 2-D gridded

12、 datar (彩色等值线图)ugrdvetor Plot vector fields from 2-D gridded data (矢量图)ugrdviewer 3-D perspective imaging of 2-D gridded data upsbasemap Create a basemap frame (画地图)upsclip Use polygon files as clipping paths (填充多边形)upscoast Plot coastlines, filled continents, rivers, and political borders (海岸线)u F:

13、/gmt/GMTmanpscontour.html Direct contouring or imaging of xyz-data by triangulation u F:/gmt/GMTmanpshistogram.html Plot a histogram (柱图)u psmask Create overlay to mask specified regions of a map (创建绘制mask)u F:/gmt/GMTmanpsrose.html Plot sector or rose diagrams (极坐标柱图,玫瑰图) u F:/gmt/GMTmanpsscale.htm

14、lPlot grayscale or colorscale (colorbar)u pstext Plot textstrings (写text到图形)u F:/gmt/GMTmanpswiggle.html Draw anomalies along track u F:/gmt/GMTmanpsxy.html Plot symbols, polygons, and lines in 2-D (二维折线图)u F:/gmt/GMTmanpsxyz.html Plot symbols, polygons, and lines in 3-D (三维折线图) GRIDDING OF (X,Y,Z)

15、ASCII DATA:unearneighbor Nearest-neighbor gridding scheme usurface Continuous curvature gridding algorithm utriangular Perform optimal Delauney triangulation on xyz data SAMPLING OF 1-D AND 2-D DATA:ugrdsample Resample a 2-D gridded data onto new grid ugrdtrack Sampling of 2-D data along 1-D track u

16、sample1d Resampling of 1-D data PROJECTION AND MAP-TRANSFORMATION:ugrdproject Project gridded data onto new coordinate system umapproject Transformation of coordinate systems uproject Project data onto lines/great circles INFORMATION:ugmtdefault List the current default settings ugmtset Edit paramet

17、ers in the .gmtdefaults file ugrdinfo Get information about grd files uminmax Report extreme values in ASCII datafiles CONVERT OR EXTRACT SUBSETS OF DATA:wgrd2xyz Convert 2-D gridded data to ASCII table wgrdcut Cut a sub-region from a grd file wgrdpaste Paste together grdfiles along common edge wgrd

18、reformat Convert from one grdformat to another wsplitxyz Split xyz files into several segments wxyz2grd Convert ASCII table to 2-D grd file MISCELLANEOUS:wpsmegaplot Create poster-size plots from postscript files wmakecpt Create GMT color palette tables wspectrum1d Compute spectral estimates from ti

19、me-series wtriangulate Perform optimal Delauney triangulation on xyz data DETERMINE TRENDS IN 1-D AND 2-D DATA:wfitcircle Finds best-fitting great or small circles wgrdtrend Fits polynomial trends to grdfiles (z = f(x,y) wtrend1d Fits polynomial or Fourier trends to y = f(x) series wtrend 2d Fits po

20、lynomial trends to z = f(x,y) series OTHER OPERATIONS ON 2-D GRIDS:wgrd2cpt Make color palette table from grdfile wgrdclip Limit the z-range in gridded data sets wgrdedit Modify grd header information wgrdfft Operate on grdfiles in frequency domain wgrdgradient Compute directional gradient from grdf

21、iles wgrdhisteg Histogram equalization for grdfiles wgrdlandmask Creates mask grdfile from coastline database wgrdmask Set nodes outside a clip path to a constant wgrdmath Reverse Polish calculator for grdfiles1:-B选项:选项: 设置坐标轴的标注间隔、网格及其大小、坐标轴名称及图设置坐标轴的标注间隔、网格及其大小、坐标轴名称及图名的标注。名的标注。格式为:格式为:Bxinfo/yinf

22、o:.”titlestring”:W|wE|eS|sN|n四:常用选项说明:四:常用选项说明: 其中其中xinfo和和yinfo的格式如下:的格式如下:atickm|cftickm|cgtickm|cl|p:”axis label”:,”unit label”:2 2:c: c: 图划的份数图划的份数 c cnumnum3 3:H: H: 指定文件的头记录数指定文件的头记录数( (几个非数据行,缺省几个非数据行,缺省1) 1) HHn_resc 4 4:J:J:选择地图投影类型选择地图投影类型 MercatorMercator(CYLINDRICALCYLINDRICAL):):JMwidth

23、JMwidth Equidistant Equidistant(CYLINDRICALCYLINDRICAL):):JQlon0/widthJQlon0/width Orthgraphic Orthgraphic(AZIMUTHALAZIMUTHAL):):JGlon0/lat0/widthJGlon0/lat0/width Albers conic Albers conic(CONICALCONICAL):):JBlon0/lat0/lat1/lat2/widthJBlon0/lat0/lat1/lat2/width Eckert Eckert(THEMATICTHEMATIC):):JKf

24、|slon0/widthJKf|slon0/width Linear Linear:JXwidth(d), JXwidth(d), JXwidth/heightJXwidth/height(loglog: JXwidthl/heightlJXwidthl/heightl)5 5 : :K KO: O: 去掉文件头去掉文件头(K)(K)和尾和尾(O) (O) K KO O对于输出对于输出postscrippostscrip文件,每个文件都有文件,每个文件都有headerheader,bodybody和和trailertrailer,几个命令输出到同一个文件,第一个要,几个命令输出到同一个文件,第

25、一个要K K去掉文去掉文件尾,中间的件尾,中间的K KO O去掉头尾,最后一个去掉头尾,最后一个O O去掉文件头去掉文件头。6: 6: P: P: 选择纸张是横向选择纸张是横向(default)(default)还是纵向还是纵向( (P) P) P P7:7:R: R: 设置做图区域设置做图区域( (可以使用可以使用dd:mm:ssdd:mm:ss格式,格式,r r区域区域的左下的左下/ /右上角右上角) ) R Rxmin/xmax/ymin/ymaxxmin/xmax/ymin/ymaxrr8:8:U: U: 在图上显示时间在图上显示时间 UU/dx/dy/dx/dy/labellabel

26、 9:9:V: V: 设置详细的设置详细的(verbose)(verbose)模式模式(default is (default is silently) silently) V V10:10:X XY: Y: 坐标原点的位置坐标原点的位置 X Xxoffxoff Y Yyoffyoff11:11: : 一般数据的第一列一般数据的第一列lonlon,第二列,第二列latlat,: :颠倒颠倒顺序顺序 :12 :S选项选项五五 一些基本命令所对应的选项及其含义:一些基本命令所对应的选项及其含义:1:pscoast: 绘制地图绘制地图2:psxy: 绘制线和符号(绘制线和符号(line and sy

27、mbol)3: makecpt: 制作绘图文件制作绘图文件4:pstext 写字符串写字符串5:grdcontour 绘等值线绘等值线6:psscale 绘制色彩比例尺绘制色彩比例尺7:gedimage 求图形梯度求图形梯度8:grdgradient 绘制彩色图绘制彩色图9:grdview 绘制绘制 mesh-plot 六 GMT PARAMETERS The following is a list of the 55 parameters that are user-definable in GMT. Note that distances and lengths are given in

28、inch.(1in=2.54cm)ANOT_MIN_ANGLE 20 If the angle between the map boundary and the annotation baseline is less than this minimum value (in degrees), the annotation is not plotted (this may occur for certain oblique projections).ANOT_FONT Helvetica Font used for tick mark annotations etc. Specify eithe

29、r the font number or the font name.ANOT_FONT_SIZE 14 !坐标轴标注的字体大小 Font size in points for map annotations. ANOT_OFFSET 0.075 inch !坐标轴标注和tick的距离 Distance from end of tickmark to start of annotation.BASEMAP_AXES WESN !四面坐标轴标是否画出,缺省都画 Sets which axes to draw and annotate. Upper case means both draw and

30、 annotate, lower case means draw axis only.BASEMAP_FRAME_RGB 0/0/0 !map坐标轴标注和框架的颜色 Color used to draw map boundaries and annotations.BASEMAP_TYPE FANCY !坐标轴框架的类型,FANCY:火车道,PLAIN:直线.COLOR_BACKGROUND 0/0/0 !背景色 Color used for the background of images (i.e., when z highest colortable entry).COLOR_IMAGE

31、 ADOBE Selects which operator to use when rendering bit-mapped color images. Due to the many definitions of the colorimage operator, GMT offers 3 different implementations: ADOBE (Adobes colorimage definition) TILES (Plot image as many individual rectangles). SEPARATION (Use 3 image calls for color

32、separation). The last method is only to be used to produce PostScript files for processing with the psto24 application; if submitted to other interpreters the job may crash. It is only intended as a way to create 24bit rasterimages from PostScript on Sun 8bit workstations. COLOR_MODEL RGB !颜色采用RGB定义

33、 Selects if color palette files contain RGB values (r,g,b in 0-255 range) or HSV values (h = 0-360, s,v in 0-1 range).COLOR_NAN 128/128/128 !没有数据定义(NAN)区域的颜色 Color used for the non-defined areas of images (i.e., where z = NaN)D_FORMAT %lg Output format (C language syntax) to be used when printing do

34、uble precision floating point numbers.DOTS_PR_INCH 300 !图形分辨率(缺省300dpi) Resolution of the plotting device (DPI). Note that in order to be as compact as possible, GMT PostScript output uses integer formats only so the resolution should be set depending on what output device you are using.FRAME_PEN 5

35、!以PLAIN绘制边框时,线框的粗细(缺省1.25p) Thickness of pen used to draw PLAIN map frame in DPI units or points (append p). DEGREE_FORMAT 0 !坐标轴经纬度标记的形式0和3比较常用 Output format to be used when annotating map boundaries. Choose between six formats: 0 Longitudes go from 0 to 360, latitudes from -90 to 90 1 Longitudes g

36、o from -180 to 180, latitudes from -90 to 90. 2 Longitudes are unsigned 0 to 180, latitudes unsigned 0 to 90. 3 Same as 2, but with letters W, E, S, or N appended as appropriate. 4 Same as 0, but using decimal degrees instead of degrees, minutes, and seconds. 5 Same as 1, but using decimal degrees i

37、nstead of degrees, minutes, and seconds.FRAME_WIDTH 0.075 inch !以FANCY绘制边框时,线框的宽度 Width of map borders for FANCY map frame. DOTS_PR_INCH 300 !图形分辨率(缺省300dpi) Resolution of the plotting device (DPI). Note that in order to be as compact as possible, GMT PostScript output uses integer formats only so t

38、he resolution should be set depending on what output device you are using.ELLIPSOID WGS-84 The name of the ellipsoid used for the map projections. Choose between : WGS-84 1984 World Geodetic System GRS-80 1980 International Geodetic Reference System WGS-72 1972 World Geodetic System.GLOBAL_X_SCALE 1

39、.0 !指定输出文件X方向缩放比例 Global x-scale to apply to plot-coordinates before plotting. Normally used to shrink the entire output down to fit a specific height/width.GLOBAL_Y_SCALE 1.0 !指定输出文件Y方向缩放比例 Same, but for y-coordinates. GRID_CROSS_SIZE 0 inch !grid线交叉点的大小 Size of grid cross at lon-lat intersections.

40、 0 means draw continuous gridlines instead.GRID_PEN 1 Pen thickness used to draw grid lines in DPI units or points (append p).GRIDFILE_SHORTHAND FALSE If TRUE, all gridfile names are examined to see if they use the file extension shorthand discussed in Section 4.16. If FALSE, no filename expansion i

41、s done.HEADER_FONT Helvetica Font to use when plotting headers. See ANOT_FONT for available fonts.HEADER_FONT_SIZE 36 !指定plot title的字体大小 Font size for header in points.HSV_MIN_SATURATION 1.0 Minimum saturation assigned for most negative intensity value. HSV_MAX_SATURATION 0.1 Maximum saturation assi

42、gned for most positive intensity value.HSV_MIN_VALUE 0.3 Minimum value assigned for most negative intensity value.HSV_MAX_VALUE 1.0 Maximum value assigned for most positive intensity value.INTERPOLANT 1 !选择一维插值方法(0:线性,1:Akima spline,2:natural cubic apline) Determines if linear (0), Akimas spline (1)

43、, or natural cubic spline (2) should be used for 1-D interpolations in various programs.IO_HEADER*(-H) FALSE Specifies whether input/output ASCII files have header record(s) or not. LABEL_FONT Helvetica !label的字体大小 Font to use when plotting labels below axes. See ANOT_FONT for available fonts.N_HEAD

44、ER_RECS 1 Specifies how many header records to expect if - H is turned on.LABEL_FONT_SIZE 24 Font size for labels in points.LINE_STEP 0.1 inch Determines the maximum length of individual straight line-segments when drawing arcuate linesMAP_SCALE_FACTOR 0.9996 Sets the central scale factor used for t

45、he Polar Stereographic and Transverse Mercator projections. Typically, it is set to 0.9996 to minimize areal distortion.MEASURE_UNIT inch !设置unit,缺省inch Sets the unit length. Choose between cm, inch, and m. N_COPIES*(-c) 1 Number of plot copies to make.OBLIQUE_ANOTATION 1 This option only applies to

46、 oblique projections. If set to 0, longitudes will be annotated on the lower and upper boundaries only, and latitudes will be annotated on the left and right boundaries only. 1 plots annotations wherever a gridline crosses the map boundaries.PAGE_COLOR 255/255/255 Sets the color of the imaging backg

47、round, i.e., the paper.PAGE_ORIENTATION*(-P) LANDSCAPE !设置纸张走向. Sets the orientation of the page. Choose PORTRAIT or LANDSCAPE.PAPER_WIDTH 8.5 inch Sets the physical width of the current plot paper. PSIMAGE_FORMAT HEX Determines whether images created in PostScript should use hexadecimal (ascii) or

48、binary format. The latter takes up only half as much space and executes faster but may choke some printers, especially those off serial ports. Select HEX or BIN.TICK_LENGTH 0.075 inch !设置tick的长度,负值指向图里面 The length of a tickmark. Normally, tickmarks are drawn on the outside of the map boundaries. To

49、select interior tickmarks, use a negative tick_length.TICK_PEN 2 !设置tick的粗细 The pen thickness to be used for tickmarks in DPI units or points (append p).UNIX_TIME*(-U) FALSE !是否在左下角显示绘图的时间 Specifies if a UNIX system time stamp should be plotted at the lower left corner of the plot. UNIX_TIME_POS*(-U

50、) -0.75/-0.75 Sets the position of the UNIX time stamp relative to the current plots lower left corner.VECTOR_SHAPE 0 !矢量箭头的形状(0:缺省三角形,1:箭头) Determines the shape of the head of a vector. Normally (i.e., for vector_shape = 0.0), the head will be triangular, but can be changed to an arrow (1.0). Inter

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁