Skip to content

Instantly share code, notes, and snippets.

@komasaru komasaru/JAPAN_ETOPO1.sh
Last active Aug 29, 2015

Embed
What would you like to do?
Bash script to paint a map with elevation data.
#! /bin/bash
# 各種定数
GRD_SRC="ETOPO1_Bed_g_gmt4.grd"
F_NAME="JAPAN_ETOPO1"
RANGE=126/149/25/46
SIZE=12c
# 用紙サイズ
gmtset PS_MEDIA = Custom_18cx20c
# 範囲抽出
grdcut $GRD_SRC -R${RANGE} -G${F_NAME}.grd
# 配色設定
makecpt -Crelief -T-8000/8000/100 -Z > ${F_NAME}.cpt
# 図描画
grdimage ${F_NAME}.grd -R${RANGE} -JM${SIZE} -C${F_NAME}.cpt -E100 -P -K > ${F_NAME}.ps
# 等高線描画(不要ならコメントアウト)
grdcontour ${F_NAME}.grd -JM${SIZE} -C1000 -W0.1,128/128/128 -L-8000/8000 -A1000tf8 -O -K >> ${F_NAME}.ps
# 海岸線描画(陸域に標高データが不要ならコメント解除)
#pscoast -R${RANGE} -JM${SIZE} -Df -Wthinnest,gray -Gwheat -Lf128/45/35/200k -O -K >> ${F_NAME}.ps
# 海岸線描画(海域に深度データが不要ならコメント解除)
#pscoast -R${RANGE} -JM${SIZE} -Df -Wthinnest,gray -S240/255/255 -Lf128/45/35/100k -O -K >> ${D_IMG}/${F_NAME}.ps
# 縦軸・横軸描画
psbasemap -R${RANGE} -JM${SIZE} -Ba5f5WSne -O -K >> ${F_NAME}.ps
# 凡例描画
psscale -Ba4000g2000f1000 -C${F_NAME}.cpt -D6c/-1c/6c/0.5ch -O >> ${F_NAME}.ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.