GMT Ex03: Part I - 國立臺灣大學 · GMT Ex03: Part I 胡植慶 Jyr-Ching HU Dept. of...
Transcript of GMT Ex03: Part I - 國立臺灣大學 · GMT Ex03: Part I 胡植慶 Jyr-Ching HU Dept. of...
GMT Ex03: Part I
胡植慶 Jyr-Ching HUDept. of Geosciences National Taiwan University
GMT ex03, Part II: location of epicenter
Part III: profile
GMT commands
grdview: Create 3-D perspective grayshaded/colored image or mesh from a 2-D grd file
psxy: Plot lines, polygons, and symbols on mapspstext: Plot textstrings on mapsproject: Project data onto lines/great circles minmax: Report extreme values in table datafilesgrdtrack: Sampling of 2-D data along 1-D track
grdview
• grdview relief_file -Jparameters [ -Btickinfo ] [-Ccptfile] [ -Eview_az/view_el ] [ -Gdrapefile | -Ggrd_r,grd_g,grd_b ] [ -Iintens- file] [ -K ] [ -L[flags] ] [ -Nlevel[/r/g/b]] [ -O ] [ -P ] [ -Qtype[g] ] [ -Rwest/east/south/north/zmin/zmax[r] ] [ -Ssmooth ] [ -T[s][o[pen]] ] [ -U[/dx/dy/][label] ] [ -V] [ -Wtype/pen ] [ -Xx-shift ] [ -Yy- shift ] [ -Zzlevel ] [ -ccopies ]
grdview topo.grd -Jm0.6 -Jz0.0001 -Ctopo4.cpt -Itopo.grd.int -E160/30 -R118/125/19/27/-10000/4000 -Qs -V -N-10001/200/200/200 -B1/1/2500:"meter":SEwnz -P -K > ex03a.ps
grdview
• -E: Sets the view point by specifying azimuth and elevation in degrees. [Default is 180/90].
• -N: Draws a plane at this z-level. If the optional r/g/b is provided, the frontal facade between the plane and the data perimeter is colored.
• -Q: Select one of four settings: 1. Specify m for mesh plot [Default], and optionally append /r/g/b for a different mesh paint [white]. 2. Specify s for surface plot, and optionally append m to have mesh lines drawn on top of surface. 3. Specify i for image plot, and optionally append the effective dpi resolution for the rasterization [100].
gmt2008_ex03agrdview topo.grd -Jm0.6 -Jz0.0001 -Ctopo_rainbow.cpt -Itopo.grd.int -E150/40 -R117/125/18/27/-10000/4000 -Qi -V -N-10001/200/200/200 -B1/1/2500:"meter":SEwnz -K > %filename%psxyz coastline.xyz -Jm -Jz -E150/40 -R -V -K -O -W4.5 -MX >> %filename%pstext title.dat -Jm -R -N -O -K -V >> %filename%pstext whiteword.dat -Jm -R -G255/255/255 -N -O -K -V >> %filename%pstext country.dat -Jm -R -G0/0/0 -N -O -K -V >> %filename%pstext Taiwan.dat -Jm -R -G255/255/255 -W150/150/150 -N -O -V >> %filename%
Standard input: coast.xyz
124.04529 24.35201 0.124.04774 24.34586 0.124.05231 24.34243 0.124.05825 24.33679 0.
X124.08127 24.25673 0.124.09122 24.25111 0.124.10382 24.25118 0.124.11158 24.25344 0.124.11745 24.25742 0.124.12439 24.26141 0.124.12573 24.26240 0.124.13323 24.26244 0.…
X124.15964 24.32500 0.124.15486 24.31658 0.
psxypsxy files -Jparameters -Rwest/east/south/north[r] [ -A ] [ - Btickinfo ] [ - Ccptfile ] [ -E[x][y][cap][/pen] ] [ -Fred/green/blue ] [ -Gfill ] [ -H ] [ -K ] [ -L ] [ -N ] [ - M[flag] ] [ - O ] [ - P ] [ - Ssymbol/size ] [ - U[/dx/dy/][label] ] [ -V ] [ -Wpen ] [ -Xx-shift ] [ - Yy- shift ] [ -: ] [ -ccopies ]
-M Multiple segment file. Segments are separated by a record whose first character is flag. [Default is '>']. -G Select filling of polygons and symbols. Set the shade (0 - 255) or color (r/g/b) [Default is no fill]. -S Plot symbols. size is symbol size in inch.
-Sa, -Sb, -Sc, -Sd, -Se, -Sf, -Sh, -Si, ….
psxy 1.dat -Jx.9 -R0/10/0/10 -Sc -G250/0/0 -K -P -W1 -V -X0.15 -Y > mapcwbc.pspsxy 2.dat -Jx -R -Sc -G255/195/135 -K -O -W1 -P -V >> mapcwbc.ps
pstextpstext textfile -Jparameters -Rwest/east/south/north[r] [ - Btickinfo ] [ -Cdx/dy ] -Ddx/dy ] [ -Eazimuth/elevation ] [ -Gred/green/blue ] [ -H ] [ -K ] [ -L ] [ -N ] [ -O ] [ -P ] [ - Spen ] [ - U[/dx/dy/][label] ] [ - V ] [ -W[red/green/blue][o] ] [ -Xx-shift ] [ - Yy-shift ] [ - Zzlevel ] [ -ccopies ][ -: ]
textfile This file contains 1 or more records with (x, y, size, angle, fontno, justify, text). size is text size in points, angle is measured in degrees counter-clockwise from horizontal, fontno sets the font type, justify sets the alignment. If fontnois not an integer, then it is taken to be a textstring with the desired fontname. See the gmtdefaults man page for names and numbers of avaiable fonts (or run pstext - L). The alignment refers to the part of the textstring that will be mapped onto the (x, y) point. Choose a 2 character combination of L, C, R (for left, center, or right) and T, M, B for top, middle, or bottom. e.g., BL for lower left.
Justification (and corresponding character codes) for text strings.
Standard input: whiteword.dat
119.40 21.70 15 0 20 6 South China Sea 119.40 21.30 15 0 20 6 Basin123.50 19.05 13 50 20 1 West Philippine Basin119.40 20.50 15 30 20 1 Manila Trench123.40 21.20 10 50 20 1 Huatang Basin 125.87 21.63 10 340 20 6 Ryukyu Trench126.50 23.70 15 0 20 6 Okinawa 126.80 23.45 15 0 20 6 Trough122.80 24.50 17 15 20 6 Taiwan Strait
119.40 21.70 15 0 20 CB South China Sea 119.40 21.30 15 0 20 CB Basin123.50 19.05 13 50 20 LT West Philippine Basin119.40 20.50 15 30 20 LT Manila Trench------
pstext Contd.Greek characters, subscript, superscript, and small caps are supported as follows: The sequence @~ toggles between the selected font and Greek (Symbol). @%no% sets the font to no; @%% resets the font to the starting font, @- toggles subscripts on/off, @+ toggles superscript on/off, and @# toggles small caps on/off. @@ prints the @ sign. @e, @o, @a, @E, @O, @A give the accented Scandinavian characters. Composite characters (overstrike) may be indicated with the @!<char1><char2> sequence, which will print the two characters on top of each other. To learn the octal codes for symbols not available on the keyboard and some accented European characters, see Section 4.15 in the GMT Technical Reference and Cookbook. Note that WANT_EURO_FONT must be set to TRUE in your .gmtdefaults file in order to use the accented characters.
Plotting Text Strings
Relationship between the text box and the extra clearance.
Text Escape Sequences.
The standard 35 PostScript fonts recognized by GMT.
gmt2008_ex03b1.bat
Courtesy of Ruey-Juin Rau and Kuo-En Ching
psxy 1.dat -Jx.9 -R0/10/0/10 -Sc -G250/0/0 -K -P -W1 -V -X0.15 -Y > %filename%pstext text01.dat -Jx -R -K -O -P -V >> %filename%psbasemap -B1 -Jm1.6 -R119.5/123/21/25.8 -E180/90 -K -O -P -V -Y1.8 -X1.5 >> %filename%psxy hypo0_15 -Jm -R -Sc -G250/0/0 -W1 -O -K -P -V >> %filename%psxy hypo15_30 -Jm -R -Sc -G255/195/135 -W1 -O -K -P -V >> %filename%pscoast -R -Jm -Dh -W5/0/0/0 -V -K -O -P >> %filename%psxy fault.dat -R -Jm -W3/0/0/0 -V -K -O -P -MX >> %filename%psxy eqsym -Jm -R -Sc -G0/0/200 -W1 -O -K -P -V -MX >> %filename%pstext text02.dat -Jm -R -N -O -P -V >> %filename%
awk and gawk1. The name awk comes from the initials of its designers:
Alfred V. Aho, Peter J. Weinberger and Brian W. Kernighan.
2. The original version of awk was written in 1977 at AT&T Bell Laboratories.
3. Paul Rubin wrote the GNU implementation, gawk, in 1986. Jay Fenlason completed it, with advice from Richard Stallman.
Awk scannes ascii files or standard input. It can search strings easily and then has a lot of possibilities to process the found lines and output them in the new format. It does not change the input file but sends it's results onto standard output.
gmt2008_ex03b2.bat
Data: Central Weather Bureau, Taipei, Taiwan
gawk "{print $1, $2, $4*0.01}"hypo_0_15.txt | psxy -Jm -R -Sc -G250/0/0 -W1 -O -K -P -V >> %filename%
122.03880 23.85300 12.41 3.32121.45750 23.80067 3.21 3.30121.50280 23.76733 3.67 3.08121.33650 23.86133 6.31 3.64
What are possible explanations for aseismiczone in eastern Central
Range of Taiwan?
• Abnormal high heat flow?
• Rheology?• Stiffness?
San Andreas Fault• Schematic diagram showing
variation in strength with rock depth for the San Andreas Fault. Earthquakes occur in the seismogenic zone, where brittle deformation processes control strength. Below the brittle-ductile transition, viscous deform-ationmechanisms limit strength and result in fluidlike, ductile flow. The strength in the ductile regime decreases with depth because increasing temperature enhances viscous deformation processes. (Jack Cook, WHOI)
Depth-Strength diagram
exp( )nA Q RTε σ= −
Experimentally determined flow law for all crust and upper mantle
ε/dt: strain rateσ: the differential stress (σ1-σ3)R: gas constantT: temperatureA, n, Q: material parameters
ε
Depth-Strength diagram
1. Brittle reimge:Byerlee's law with
τ= 0.85σn for σn < 200 MPaand τ= 50 + 0.60σn for σn > 200 MPa
2. Ductile regime: power-law creep in lower crust and upper mantle
Rheology and strength of the Eurasian continental lithosphere in the foreland of the Taiwan collision belt: Constraints from seismicity, flexure, and structural styles
Mouthereau and Petit, JGR2003
gmt2008_ex03c1
set start=118/48set end=129/41project -C%start% -E%end%-G1 -Q > track.datgrdtrack track.dat -Getopo2.grd | gawk "{ print $3,$4 }" > track_profile.datminmax -I5 track_profile.datpsxy -R0/1170/0/1760 track_profile.dat -JX5.5/2 -Ba500f250:"Distance(km)":/a400f200:"H(m)":-W2/red -X0.2i -Y4.5i > %filename%
Project:
• project [ infile ] −Ccx/cy [ −Aazimuth ] [ −Dd|g ] [ −Ebx/by ] [ −Fflags ] [ −Gdist ] [ −H[i][nrec] ] [ −L[w][l_min/l_max] ] [ −M[i|o][flag] ] [ −N ] [ −Q ] [ −S ] [ −Tpx/py ] [ −V ] [ −Ww_min/w_max ] [ −:[i|o] ] [ −b[i|o][s|S|d|D][ncol] ] [ −f[i|o]colinfo ]
project data along a line or great circle, generate a profile track, or translate coordinates
Standard output1
118 48 0118.011 47.9945 1118.021 47.989 2118.032 47.9835 3118.042 47.978 4118.053 47.9724 5118.064 47.9669 6118.074 47.9614 7118.085 47.9559 8118.096 47.9504 9118.106 47.9449 10118.117 47.9394 11118.127 47.9338 12…..128.974 41.0198 1164128.983 41.0134 1165128.991 41.007 1166128.999 41.0006 1167129 41 1167.09
track.dat
grdtrack
• grdtrack xyfile −Ggrdfile [ −H[i][nrec] ] [ −Lflag ] [ −M[i|o][flag] ] [ −Q[value] [ −Rwest/east/south/north[r] ] [ −S ] [ −V ] [ −Z ] [ −:[i|o] ] [ −b[i|o][s|S|d|D][ncol] ] [ −f[i|o]colinfo ]
Sampling of a 2-D grdfile along 1-D trackline (a sequence of x,y points)
grdtrack track.dat -Getopo2.grd | gawk "{ print $3,$4 }" > track_profile.dat
Standard output2
0 6021 602.682 603.1753 603.4694 601.9555 599.9016 601.1917 607.9098 618.169 629.16810 639.40911 649.81612 657.12…..
1164 1567.281165 13641166 1248.671167 1211.261167.09 1209
track_profile.dat
minmax
• minmax [ files] [ −C ] [ −EL|l|H|hcol ] [ −H[i][nrec] ] [ −Idx[/dy[/dz...] ] [ −M[flag] ] [ −Tdz ] [ −:[i|o] ] [ −bi[s|S|d|D][ncol] ] [ −f[i|o]colinfo ]
minmax reads its standard input [or from files] and finds the extreme values in each of the columns. It recognizes NaNsand will print warnings if the number of columns vary from record to record. By default, this output will be in the form −Rw/e/s/nwhich can be used directly in the command line for other programs.
To find the extreme values in the file track.xy to the nearest 5 units and use this region to draw a line using psxy, run
psxy ‘minmax −I5 track.xy‘ track.xy −Jx1 −B5 −P > track.ps
Gmt2008_ex03c2REM Index line1echo 90 25 > temp.lecho 90 40 >> temp.lpsxy temp.l -R -J -O -K -V -W3p/255/0/0 >> %filename%---REM Profile1grdcut C:\gmtwork\grdfiles\etopo2.grd -Gtibet_profile1.grd -R89/91/25/40 -Vgrd2xyz C:\gmtwork\grdfiles\etopo2.grd-R89.99/90.01/25/40 > temp.xyzgrdmath tibet_profile1.grd 90 25 SDIST111.13 MUL = temp.grdgrdtrack temp.xyz -Gtemp.grd > temp.dgawk "{ print $4, $3 }" temp.d > temp1.d
Standard output
0 6021 602.682 603.1753 603.4694 601.9555 599.9016 601.1917 607.9098 618.169 629.16810 639.40911 649.81612 657.12…..
1164 1567.281165 13641166 1248.671167 1211.261167.09 1209
track_profile.dat
Standard output2 temp.xyz
90 40 77390 39.9667 77290 39.9333 76990 39.9 76990 39.8667 76990 39.8333 77090 39.8 77090 39.7667 78290 39.7333 78390 39.7 78790 39.6667 79190 39.6333 79590 39.6 84890 39.5667 83890 39.5333 92590 39.5 1070……
grd2xyz C:\gmtwork\grdfiles\etopo2.grd -R89.99/90.01/25/40 > temp.xyz
Standard output2 temp.xyz
90 40 77390 39.9667 77290 39.9333 76990 39.9 76990 39.8667 76990 39.8333 77090 39.8 77090 39.7667 78290 39.7333 78390 39.7 78790 39.6667 79190 39.6333 79590 39.6 84890 39.5667 83890 39.5333 92590 39.5 1070……
grd2xyz C:\gmtwork\grdfiles\etopo2.grd -R89.99/90.01/25/40 > temp.xyz
grdmath
grdmath tibet_profile1.grd 90 25 SDIST 111.13 MUL = temp.grd
Reverse Polish calculator for grdfiles
SDIST: Spherical (Great circle) distance (in degrees) between grid nodes and stack lon,lat (A, B).
Use grdinfo to see the grid information of temp.grd
Standard output temp.d
grdtrack temp.xyz -Gtemp.grd> temp.dgawk "{ print $4, $3 }" temp.d> temp1.dpsbasemap -R0/1700/0/10000 -Jx0.0035i/0.00009i -Bf50a200:"Distance(km)":/f1000a4000:"H(m)":ES -X0i -Y-1.5i -O -K -P >> %filename%
90 40 773 1666.9590 39.9667 772 1663.2590 39.9333 769 1659.5490 39.9 769 1655.8490 39.8667 769 1652.1490 39.8333 770 1648.4290 39.8 770 1644.7290 39.7667 782 1641.0290 39.7333 783 1637.3190 39.7 787 1633.6190 39.6667 791 1629.9190 39.6333 795 1626.290 39.6 848 1622.590 39.5667 838 1618.890 39.5333 925 1615.09……
Exercise 3
• Draw 3-D view of topo-bathymetry in Taiwan with different view point and shading
Homework 3
Use mixed palettes for topography & bathymetry(NZ blue, wiki-1.20, wiki-1.03 and Caribbean)from Web site of CPT city (http://sview01.wiredworkplace.net/pub/cpt-city/) to draw topography and bathymetry in and around Taiwan (topo.grd).
• Draw a topographic profile across central Taiwan.
CPT City
The most popular palettes
Palettes for Topo
DEM poster, DEM print, DEM screen, UKdem, natrual, neutral, textbook, tv-a, o2-a…..
Topographic profile
Chiang Chieh-ChungInstitute of OceanographyNTU
Assignments
• Project• grdtrack• psxy• pstext• grdview