From b00d094cfc68bdf846f3e09aef1a082609743942 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Sun, 19 Mar 2023 19:41:55 +0800 Subject: [PATCH] tmp update --- gmt-colorBar.sh | 2 +- gmtsph-JA.sh | 2 +- gmtsph-global.sh | 12 ++++++++---- gmtxy-image2.sh | 4 ++-- gmtxy-texture.sh | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gmt-colorBar.sh b/gmt-colorBar.sh index b6f24c8..562a9ab 100755 --- a/gmt-colorBar.sh +++ b/gmt-colorBar.sh @@ -2,7 +2,7 @@ # 包含GMT自带脚本文件 其中包含了一些有用的功能 比如获取网格文件的范围 . gmt_shell_functions.sh # 包含dispOption脚本 -. dispOptions +. dispOptions.sh #GMT画一个色度条 # 初始化参数 data='null' diff --git a/gmtsph-JA.sh b/gmtsph-JA.sh index b43af32..4ef997f 100755 --- a/gmtsph-JA.sh +++ b/gmtsph-JA.sh @@ -2,7 +2,7 @@ # 包含GMT自带脚本文件 其中包含了一些有用的功能 比如获取网格文件的范围 . gmt_shell_functions.sh # 包含dispOption脚本 -. dispOptions +. dispOptions.sh #GMT显示平面数据脚本,输入文件为网格文件,没有包含网格化语句因为网格化过程中的情况多样化,建议在其他脚本中个别添加再调用此脚本 # 初始化参数 data='null' diff --git a/gmtsph-global.sh b/gmtsph-global.sh index 9643082..77fbc41 100755 --- a/gmtsph-global.sh +++ b/gmtsph-global.sh @@ -2,7 +2,7 @@ # 包含GMT自带脚本文件 其中包含了一些有用的功能 比如获取网格文件的范围 . gmt_shell_functions.sh # 包含dispOption脚本 -. dispOptions +. dispOptions.sh #GMT显示平面数据脚本,输入文件为网格文件,没有包含网格化语句因为网格化过程中的情况多样化,建议在其他脚本中个别添加再调用此脚本 # 初始化参数 data='null' @@ -16,8 +16,9 @@ labels=("longitude (degree)" "latitude (degree)") plotgrad=0 clon=0 polyfile='null' +bartick="a" #色标轴标轴间隔 a表示自动 # 从命令行获取参数 -while getopts "hi:r:u:c:a:G:l:p:g" arg +while getopts "hi:r:u:c:a:G:l:p:v:g" arg do case $arg in h) @@ -30,6 +31,7 @@ For futher explanations, please look for GMT's manuscripts." dispOptionShort "-l" "central longitude value of the plot, the default value is 0" dispOptionShort "-u" "data unit. The default is meter. use 'km+Uk' to append '+Uk' option to the psscale command" dispOptionShort "-c" "color cpt. The default is rainbow." + dispOptionShort "-v" "intervals of color bar's labels. the script will set the intervals automatically if -v option is not set." dispOptionShort "-a" "axis labels. The deafults are x (m) and y (m)." dispOptionShort "-g" "use grdgradient. The default is false." dispOptionShort "-G" "provide a different input grid data for the use of grdgradient. This should be used with the '-g' option at the same time" @@ -46,6 +48,8 @@ For futher explanations, please look for GMT's manuscripts." overwriteRange=$OPTARG;; l) clon=$OPTARG;; + v) + bartick=$OPTARG;; a) labels=(${OPTARG//,/ });; g) @@ -104,9 +108,9 @@ else #-C${cptfile}+Uk 使用km(色标单位除1000 #如果unit等于km则在cptfile后面添加+Uk if [[ ${unit} == 'km+Uk' ]]; then - gmt psscale -Dx0.4i/-0.3i+w1.2i/0.05i+h -C${cptfile}+Uk -Bxa -By+l"km" -O >> $psfile + gmt psscale -Dx0.4i/-0.3i+w1.2i/0.05i+h -C${cptfile}+Uk -Bx${bartick} -By+l"km" -O >> $psfile else - gmt psscale -Dx0.4i/-0.3i+w1.2i/0.05i+h -C${cptfile} -Bxa -By+l${unit} -O >> $psfile + gmt psscale -Dx0.4i/-0.3i+w1.2i/0.05i+h -C${cptfile} -Bx${bartick} -By+l${unit} -O >> $psfile fi gmt psconvert $psfile -A -TEG -E300 # 删除临时文件 使用linux终端rm命令 diff --git a/gmtxy-image2.sh b/gmtxy-image2.sh index fd75e6b..b28dc95 100755 --- a/gmtxy-image2.sh +++ b/gmtxy-image2.sh @@ -2,8 +2,8 @@ # 包含GMT自带脚本文件 其中包含了一些有用的功能 比如获取网格文件的范围 . gmt_shell_functions.sh # 包含dispOption脚本 -. dispOptions -. generic_func +. dispOptions.sh +. generic_func.sh # 定义一个函数 执行输入的语句或者将其显示在屏幕上 RunOrEcho() { diff --git a/gmtxy-texture.sh b/gmtxy-texture.sh index f386343..afb9e46 100755 --- a/gmtxy-texture.sh +++ b/gmtxy-texture.sh @@ -2,7 +2,7 @@ # 包含GMT自带脚本文件 其中包含了一些有用的功能 比如获取网格文件的范围 . gmt_shell_functions.sh # 包含dispOption脚本 -. dispOptions +. dispOptions.sh #GMT绘制纹理图层,输入文件为网格文件 # 初始化参数 data='null'