Created
April 28, 2016 06:25
-
-
Save komasaru/8ce2b221936c40c3158d7d70c027e4fc to your computer and use it in GitHub Desktop.
Bash script to paint a Japan's elevetion map by GMT(Albers).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# 各種定数 | |
GRD_PATH=/path/to/ETOPO1_Bed_g_gmt4.grd | |
IMG_DIR=imgs | |
IMG_FILE=JAPAN_ETOPO1_b | |
T=-10000/10000/100 | |
R=122/148/23/47 | |
J=b135/35/30/40/1:20000000 | |
E=100 | |
W=,darkgreen | |
B=a5f5g5 | |
D=11c/-1c/5c/0.5ch | |
F=+j+a+f12p,Helvetica,black | |
# 用紙サイズ | |
gmtset PS_MEDIA = Custom_15.5cx17c | |
# 範囲抽出 | |
grdcut $GRD_PATH -R$R -G${IMG_FILE}.grd | |
# 配色設定 | |
makecpt -Cglobe -T$T -Z > ${IMG_FILE}.cpt | |
# 陰影データ作成 | |
grdgradient $IMG_FILE.grd -A270 -G${IMG_FILE}.int -Ne0.7 | |
# 図描画 | |
grdimage ${IMG_FILE}.grd -I${IMG_FILE}.int -R -J$J -C${IMG_FILE}.cpt -E$E -X1 -Y2.5 -P -K > ${IMG_DIR}/${IMG_FILE}.ps | |
# 海岸線描画 | |
pscoast -R -J -Dh -W$W -O -K >> ${IMG_DIR}/${IMG_FILE}.ps | |
# 縦軸・横軸描画 | |
psbasemap -R -J -B$B -O -K >> ${IMG_DIR}/${IMG_FILE}.ps | |
# コピーライト描画 | |
echo "132 36 BL 0.0 (c)mk-mode.com" | pstext -R -J -F$F -O -K >> ${IMG_DIR}/${IMG_FILE}.ps | |
# 凡例描画 | |
psscale -Ba4000g2000f1000 -C${IMG_FILE}.cpt -D$D -O >> ${IMG_DIR}/${IMG_FILE}.ps | |
# ps -> png | |
ps2raster ${IMG_DIR}/${IMG_FILE}.ps -Tg -Qt -Qg -E$E | |
# ps -> jpg | |
#ps2raster ${IMG_DIR}/${IMG_FILE}.ps -Qt -Qg -E$E |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment