Permalink
Browse files

update ex001

  • Loading branch information...
1 parent 91940b0 commit daa73c6bc8825cd83fe518259b28458a1b8109e7 @seisman seisman committed Apr 5, 2016
Showing with 37 additions and 29 deletions.
  1. +18 −5 _includes/ex001.sh
  2. +1 −19 _posts/2016-03-26-ex001.md
  3. +18 −5 ex001/ex001.sh
View
@@ -1,21 +1,34 @@
#!/bin/bash
-# GMT EXAMPLE 01
-# $Id$
+# 利用grdcontour模块绘制等值线图
#
-# Purpose: Make two contour maps based on the data in the file osu91a1f_16.nc
-# GMT progs: gmtset, grdcontour, psbasemap, pscoast
-# Unix progs: rm
+# GMT模块 : gmtset, grdcontour, psbasemap, pscoast
+# Unix命令: rm
#
ps=ex001.ps
gmt gmtset MAP_GRID_CROSS_SIZE_PRIMARY 0 FONT_ANNOT_PRIMARY 10p
+# 绘制图中最外部的边框
gmt psbasemap -R0/6.5/0/7.5 -Jx1i -B0 -P -K > $ps
+
+# 绘制位于下边的等值线图
gmt pscoast -Rg -JH0/6i -X0.25i -Y0.2i -O -K -Bg30 -Dc -Glightbrown -Slightblue >> $ps
+## -C10: 每隔10绘制一条等值线
+## -A50+f7p: 每隔50绘制给等值线加一个标注,标注大小为7p
+## -Gd4i: 同一等值线上的相邻两个标注之间的距离大于4i
+## -L-1000/-1: 只绘制-1000到-1之间的等值线
+## -Wc: 常规等值线的线条属性
+## -Wa: 带标注的等值线的线条属性
+## -T
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1000/-1 -Wcthinnest,- -Wathin,- \
-O -K -T+d0.1i/0.02i >> $ps
+# 使用-L选项限制只绘制正等值线部分
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1/1000 -O -K -T+d0.1i/0.02i >> $ps
+
+# 绘制位于上边的等值线图
gmt pscoast -Rg -JH6i -Y3.4i -O -K -B+t"Low Order Geoid" -Bg30 -Dc -Glightbrown \
-Slightblue >> $ps
+# 使用-L选项限制只绘制负等值线部分
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1000/-1 -Wcthinnest,- -Wathin,- \
-O -K -T+d0.1i/0.02i+l >> $ps
+# 使用-L选项限制只绘制正等值线部分
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1/1000 -O -T+d0.1i/0.02i+l >> $ps
rm -f gmt.*
@@ -8,28 +8,10 @@ figure: ex001.png
data: [osu91a1f_16.nc, ]
---
-We want to create two contour maps of the low order geoid using the
-Hammer equal area projection. Our gridded data file is called `osu91a1f_16.nc` and
-contains a global 1 by 1 gridded geoid. We would like to show one map centered on Greenwich and
-one centered on the dateline. Positive contours should be drawn with a
-solid pen and negative contours with a dashed pen. Annotations should
-occur for every 50 m contour level, and both contour maps should show
-the continents in light brown in the background. Finally, we want a
-rectangular frame surrounding the two maps. This is how it is done:
+网格文件 `osu91a1f_16.nc` 中包含了全球1度乘1度的大地水准线数据。此处绘制了两张全球水准线图,下图以0度经线为绘图中心,上图以180度经线为绘图中心。在每张全球水准线图中,正等值线用实线绘制,负等值线用虚线绘制。每隔50米标注标注一次等值线。
{% highlight bash %}
{% include {{page.script}} %}
{% endhighlight %}
-The first command draws a box surrounding the maps. This is followed by
-two sequences of `pscoast`, `grdcontour`,
-`grdcontour`. They differ in that the
-first is centered on Greenwich; the second on the dateline. We use the
-limit option (**-L**) in `grdcontour`
-to select negative contours only and plot those with a dashed pen, then
-positive contours only and draw with a solid pen [Default]. The **-T**
-option causes tick marks pointing in the downhill direction to be drawn
-on the innermost, closed contours. For the upper panel we also added -
-and + to the local lows and highs. You can find this illustration as
-
![{{page.title}}]({{ page.id }}/{{ page.figure }})
View
@@ -1,21 +1,34 @@
#!/bin/bash
-# GMT EXAMPLE 01
-# $Id$
+# 利用grdcontour模块绘制等值线图
#
-# Purpose: Make two contour maps based on the data in the file osu91a1f_16.nc
-# GMT progs: gmtset, grdcontour, psbasemap, pscoast
-# Unix progs: rm
+# GMT模块 : gmtset, grdcontour, psbasemap, pscoast
+# Unix命令: rm
#
ps=ex001.ps
gmt gmtset MAP_GRID_CROSS_SIZE_PRIMARY 0 FONT_ANNOT_PRIMARY 10p
+# 绘制图中最外部的边框
gmt psbasemap -R0/6.5/0/7.5 -Jx1i -B0 -P -K > $ps
+
+# 绘制位于下边的等值线图
gmt pscoast -Rg -JH0/6i -X0.25i -Y0.2i -O -K -Bg30 -Dc -Glightbrown -Slightblue >> $ps
+## -C10: 每隔10绘制一条等值线
+## -A50+f7p: 每隔50绘制给等值线加一个标注,标注大小为7p
+## -Gd4i: 同一等值线上的相邻两个标注之间的距离大于4i
+## -L-1000/-1: 只绘制-1000到-1之间的等值线
+## -Wc: 常规等值线的线条属性
+## -Wa: 带标注的等值线的线条属性
+## -T
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1000/-1 -Wcthinnest,- -Wathin,- \
-O -K -T+d0.1i/0.02i >> $ps
+# 使用-L选项限制只绘制正等值线部分
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1/1000 -O -K -T+d0.1i/0.02i >> $ps
+
+# 绘制位于上边的等值线图
gmt pscoast -Rg -JH6i -Y3.4i -O -K -B+t"Low Order Geoid" -Bg30 -Dc -Glightbrown \
-Slightblue >> $ps
+# 使用-L选项限制只绘制负等值线部分
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1000/-1 -Wcthinnest,- -Wathin,- \
-O -K -T+d0.1i/0.02i+l >> $ps
+# 使用-L选项限制只绘制正等值线部分
gmt grdcontour osu91a1f_16.nc -J -C10 -A50+f7p -Gd4i -L-1/1000 -O -T+d0.1i/0.02i+l >> $ps
rm -f gmt.*

0 comments on commit daa73c6

Please sign in to comment.