Ex02: Bathymetry and Topography Part II

胡植慶 國立臺灣大學地質科學系 Jyr-Ching HU Department of Geosciences, NTU

GMT commands grd2cpt - Read a grdfile and make a color palette file grdhisteq - Histogram equalization for grd files makecpt - Make GMT color palette tables grdcontour - Contouring of 2-D gridded data sets grdmath - Reverse Polish Notation calculator for grd files

grd2cpt

grd2cpt: read a grdfile and make a color palette file grd2cpt grdfile [ -Ccptmaster ] [ -Enlevels ] [ -I ] [ Lminlimit/maxlimit ] [ -Q[i|o] ] [ -Rw/e/s/n ] [ Szstart/zstop/zinc ] [ -V ] [ -Z ] grd2cpt mydata.grd -V > /dev/null grd2cpt mydata.grd -Crelief -L0/10000 -S0/200/20 > mydata.cpt

Where can we find the available 22 color palette files? C:\programs\GMT\share\cpt GMT_wysiwyg.cpt GMT_split.cpt GMT_sealand.cpt GMT_globe.cpt GMT_ocean.cpt GMT_gebco.cpt GMT_rainbow.cpt GMT_cyclic.cpt ……

GMT_topo.cpt GMT_seis.cpt GMT_relief.cpt GMT_polar.cpt GMT_gray.cpt GMT_drywet.cpt GMT_copper.cpt GMT_jet.cpt

Master Color Table

ocean: white-green-blue bathymetry scale [-8000/0] polar: Blue via white to red [-1/+1] rainbow: Rainbow colors: magentablue-cyan-green-yellow-red [0/300] red2green : Polar scale from red to green via white [-1/+1] relief: Wessel/Martinez colortable for bathymetry/topography [-8000/+8000] topo: Sandwell-Anderson colors for topography [-7000/+7000] sealand: Smith bathymetry/topography scale [-6000/+3000] seis: R-O-Y-G-B seismic tomography colors [-1/+1] split: Polar scale like polar, but via black instead of white [-1/+1] wysiwyg: 20 RGB colors for openwin cubesize large and waxenvy printer [0/20]

Master Color Table

cool: Linear change from blue to magenta [0/1] copper: Dark to light copper brown [0/1] gebco : Colors for GEBCO bathymetric charts [-7000/0] globe: Colors for global bathy-topo relief [-10000/10000] drywet : Goes from dry to wet colors [0/12] gray : Grayramp from black to white [0/1] haxby: Bill Haxby's colortable for geoid & gravity [0/32] hot: Black through red and yellow to white [0/1] jet: Dark to light blue, white, yellow and red [0/1] no_green: For those who hate green [32/+32]

gmt20011_ex02a set range=118.5/123.5/20/26.5 grd2cpt topo4.grd -Z -Crelief > topo_relief.cpt –V …. psscale -Ctopo_relief.cpt D2.5/-0.5/5/0.15h -P -O B1000:Topo_Bathymetry_rel ief:/:meter: -I -V >> %filename% Take three of the following master cpt files: cool, copper, drywet, gebco, globe, gray, haxby, hot, jet, no_green, ocean, polar, rainbow, red2green, relief, sealand, seis, split, topo, wysiwyg

grdhisteq grdhisteq in_grdfile [ -Gout_grdfile ] [ -Cn_cells ] [ -D ] [ -N[norm] ] [ -Q ] [ -V ]

-N Gaussian output. Use with -G to make an output grdfile with standard normal scores. Append norm to force the scores to fall in the range [Default is standard normal scores]. To find the height intervals that divide the file heights.grd into 16 divisions of equal area: grdhisteq heights.grd -C16 -D > levels.d To make the poorly distributed intensities in the file raw_intens.grd suitable for use with grdimage or grdview grdhisteq raw_intens.grd -Gsmooth_intens.grd -N -V

Grdmath (Reverse Polish Notation) grdmath [ -F ] [ -Ixinc[m|c][/yinc[m|c]] Rwest/east/south/north -V] operand [ operand ] OPERATOR [ operand ] OPERATOR ... = outgrdfile To take log10 of the average of 2 files, use grdmath file1.grd file2.grd ADD 0.5 MUL LOG10 = file3.grd Given the file ages.grd, which holds seafloor ages in m.y., use the relation depth (in m) = 2500 + 350 * sqrt (age) to estimate normal seafloor depths: grdmath ages.grd SQRT 350 MUL 2500 ADD = depths.grd To find the angle a (in degrees) of the largest principal stress from the stress tensor given by the three files s_xx.grd s_yy.grd, and s_xy.grd from the relation tan (2*a) = 2 * s_xy / (s_xx - s_yy), use grdmath 2 s_xy.grd MUL s_xx.grd s_yy.grd SUB DIV ATAN2 2 DIV = direction.grd

grdmath: operators ABS 1 abs (A). ACOS 1 acos (A). ACOSH 1 acosh (A). ADD(+) 2 A + B. AND 2 NaN if A and B == NaN, B if A == NaN, else A. ASIN 1 asin (A). ASINH 1 asinh (A). ATAN 1 atan (A). ATAN2 2 atan2 (A, B). ATANH 1 atanh (A).

gmt2011_ex02b: grdgradient topo4.grd -A310 Gtopo4.grd.int -Ne1.0 –M grdhisteq topo4.grd.int Gtopo4.grd.eq –N grdmath topo4.grd.eq 3.0 / = topo4.grd.intma grd2cpt topo4.grd -Csealand -L8000/4000 -S-8000/4000/500 > topo_sealand.cpt –V psscale -Ctopo_sealand.cpt D2.5/-0.5/5/0.15h -E -S -P -O B1000:Topo_Bathymetry_sealand :/:meter: -I -V >> %filename%

Compare topo_relief.cpt and topo_sealand.cpt

makecpt: make GMT color palette tables makecpt [ -Ctable ] [ -I ] [ -Q[i|o] ] [ -Tz0/z1/dz | -Tztable] [ -V ] [ -Z ] To make a cpt file with z-values from -200 to 200, with discrete color changes every 25, and using a polar bluewhite-red colortable: makecpt -Cpolar -T-200/200/25 > colors.cpt To make an equidistant cpt file from z = -2 to 6, in steps of 1, using continuous default rainbow colors: makecpt -T-2/6/1 -Z > rainbow.cpt To make a GEBCO look-alike cpt file for bathymetry: makecpt -Cgebco > my_gebco.cpt

gmt2011_ex02c: makecpt makecpt -Crainbow -T8000/4000/500 > rainbow_mk.cpt

grdcontour: Contouring of 2-D gridded data sets grdcontour grdfile -Ccont_int - Jparameters [ Aanot_int[ffont_size][aangle][/r/g/b][o]] ] [ -Btickinfo ] [ -Ddumpfile ] [ -Eazimuth/elevation ] [ Fred/green/blue ] [ - Ggap/width ] [ -K ] [ -Llow/high ] [ -M[flag] ] [ -N[unit] ] [ -O ] [ -P ] [ -Qcut ] [ Rwest/east/south/north[r] ] [ -Ssmoothfactor ] [ T[+|-][gap/length][:LH] ] [ - U[/dx/dy/][label] ] [ -V ] [ Wtype[pen] ] [ -Xx-shift ] [ -Yy-shift ] [ -Zfactor[/shift] ] [ -ccopies ]

grdcontour: examples To contour the file hawaii_grav.grd every 25 mGal on a Mercator map at 0.5 inch/degree, annotate every 50 mGal (using fontsize = 10), using 1 degree tickmarks, and draw 30 minute gridlines:

grdcontour hawaii_grav.grd −Jm0.5i −C25 −A50+f10 −B1g30m > hawaii_grav.ps To contour the file image.grd using the levels in the file cont.d on a linear projection at 0.1 cm/x-unit and 50 cm/y-unit, using 20 (x) and 0.1 (y) tickmarks, smooth the contours a bit, use "RMS Misfit" as plot-title, use a thick red pen for annotated contours, and a thin, dashed, blue pen for the rest, and send the output to the default printer:

grdcontour image.grd −Jx0.1c/50.0c −Ccont.d −S4 −B20/0.1:."RMS Misfit": −Wa5/255/0/0 −Wc1/0/0/255ta | lp

gmt2011_02d: grdcontour grdcontour topo4.grd -Jm -R -L8000/-500 -C500 -A1000 Wa5/25 -Wc2/100 -S20 -V -O P -K >> %filename% grdcontour topo4.grd -Jm -R L500/4000 -C500 -Wc2/50 -S20 -V -O -P -K >> %filename% psscale -Csealand_mk.cpt -D3/0.5/6/0.2h -P -O -B1000:"Relief of Taiwan":/:m: -I -O -V >> %filename%

Cut a sub-region from a grd file

gmt2011_02e set range = 60/135/10/55 gmtset ANNOT_FONT_SIZE_PRIMARY = 9p gmtset FRAME_WIDTH = 0.1c grdinfo ETOPO1_Bed_g_gmt4.grd > etopo1_grdinfo.txt type etopo1_grdinfo.txt grdcut gridone.grd -Gchina.grd –R%range% grdgradient china.grd -A310 -Gchina.grd.int -Ne0.8 –M grdimage china.grd -R –JM5 -Cgltopo.cpt -Ichina.grd.int -V -K > %filename% psxy anhui_sheng.gmt -J -R -W0.3p,white -O -P -K -Mx -V >> %filename% pscoast -R -J -Di -N1 -A1000 -B10g10/10g10 -W0.25p -O -K >> %filename% psscale -Cgltopo.cpt -D6.5c/-1c/5i/0.10ih -Bf1000a2000:"Relief Etopo1":/:m: -E -I -V -O >> %filename%

ETOPO2v2 Global Gridded 2-minute Database ETOPO2v2c: Cell Centered (pixel registered, where the cell boundaries are lines of even minutes of latitude and longitude, centered on intersections of lines of odd minutes of latitude and longitude). ETOPO2v2g: Grid Centered (gridline registered, with cell boundaries defined by lines of odd minutes of latitude and longitude, meaning that cells were centered on the integer multiples of 2 minutes [even minutes] of latitude and longitude).

How to Cite ETOPO2? ETOPO2v2 Global Gridded 2-minute Database, National Geophysical Data Center, National Oceanic and Atmospheric Administration, U.S. Dept. of Commerce,

http://www.ngdc.noaa.gov/mgg/global/ etopo2.html

ETOPO1 Global Gridded 1-minute Database 1. ETOPO1 Ice Surface: Grid of Earth's surface depicting the top of the Antarctic and Greenland ice sheets. 2. ETOPO1 Bedrock: Grid of Earth's surface depicting the bedrock underneath the ice sheets.

How to Cite ETOPO1? Amante, C. and B. W. Eakins, ETOPO1 1 Arc-Minute Global Relief Model: Procedures, Data Sources and Analysis. NOAA Technical Memorandum NESDIS NGDC-24, 19 pp, March 2009. ,

http://www.ngdc.noaa.gov/mgg/global/global.html

Exercise 02 1. Put global topography and bathymetry in the Examples of Map Projections 2. Change the forms of color legends created by psscale in your homework 01. 3. See detailed information in M.2 Labeled and nonequidistant color legends in pages 202-203 of GMT Cookbook.

Sinusoidal Projection

Chiang Chieh-Chung Institute of Oceanography, NTU

Lambert conformal conic map projection

Lin Shao-Hsuan Dept. Geosciences, NTU

Interrupted Sinusoidal projection

Liao Shih-Wei Institute of Oceanography, NTU

Eckert IV projection

Huang Jyh-Jaan Dept. Geosciences, NTU

Homework 02 1.

2.

3.

Try to use grd2cpt, makecpt to create your color palette table for topo.grd Create a relief with contours in and around Taiawan by using of topo.grd Import the postscript file by CroelDraw (or any other vector-based drawing software such as Illustrator) and add the geomorphic or tectonic features in Chinese or in English

topo.grd is only for the students in this class.