add -n option
This commit is contained in:
parent
9b3cdb2a57
commit
1cd852b265
14
gmtsph-JA.sh
14
gmtsph-JA.sh
@ -12,12 +12,13 @@ overwriteRange='null'
|
|||||||
overwrite=0
|
overwrite=0
|
||||||
labels=("longitude (degree)" "latitude (degree)")
|
labels=("longitude (degree)" "latitude (degree)")
|
||||||
plotgrad=0
|
plotgrad=0
|
||||||
|
nocpt=0
|
||||||
plotsun=0
|
plotsun=0
|
||||||
clon=("0/0/115" "180/0/115")
|
clon=("0/0/115" "180/0/115")
|
||||||
polyfile='null'
|
polyfile='null'
|
||||||
bartick="a" #色标轴标轴间隔 a表示自动
|
bartick="a" #色标轴标轴间隔 a表示自动
|
||||||
# 从命令行获取参数
|
# 从命令行获取参数
|
||||||
while getopts "hi:r:u:c:a:v:G:l:p:gs" arg
|
while getopts "hi:r:u:c:a:v:G:l:p:gsn" arg
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
h)
|
h)
|
||||||
@ -29,6 +30,7 @@ For futher explanations, please look for GMT's manuscripts.\nAuthor: Yi Zhang (z
|
|||||||
printf "%s\t%s\n" "-l" "central longitude and latitude values of the plot, the default value is 0/0/115,180/0/115. "
|
printf "%s\t%s\n" "-l" "central longitude and latitude values of the plot, the default value is 0/0/115,180/0/115. "
|
||||||
printf "%s\t%s\n" "-u" "data unit. The default is meter. use 'km+Uk' to append '+Uk' option to the psscale command"
|
printf "%s\t%s\n" "-u" "data unit. The default is meter. use 'km+Uk' to append '+Uk' option to the psscale command"
|
||||||
printf "%s\t%s\n" "-c" "color cpt. The default is 'rainbow -Z' in which '-Z' tells the grd2cpt to make a continuous cpt-file, remove it to disable the function."
|
printf "%s\t%s\n" "-c" "color cpt. The default is 'rainbow -Z' in which '-Z' tells the grd2cpt to make a continuous cpt-file, remove it to disable the function."
|
||||||
|
printf "%s\t%s\n" "-n" "disable the use of grd2cpt."
|
||||||
printf "%s\t%s\n" "-s" "plot the day-night terminator. The default is false."
|
printf "%s\t%s\n" "-s" "plot the day-night terminator. The default is false."
|
||||||
printf "%s\t%s\n" "-a" "axis labels. The deafults are x (m) and y (m)."
|
printf "%s\t%s\n" "-a" "axis labels. The deafults are x (m) and y (m)."
|
||||||
printf "%s\t%s\n" "-v" "intervals of color bar's labels. the script will set the intervals automatically if -v option is not set."
|
printf "%s\t%s\n" "-v" "intervals of color bar's labels. the script will set the intervals automatically if -v option is not set."
|
||||||
@ -42,6 +44,8 @@ For futher explanations, please look for GMT's manuscripts.\nAuthor: Yi Zhang (z
|
|||||||
unit=$OPTARG;;
|
unit=$OPTARG;;
|
||||||
c)
|
c)
|
||||||
color=$OPTARG;;
|
color=$OPTARG;;
|
||||||
|
n)
|
||||||
|
nocpt=1;;
|
||||||
s)
|
s)
|
||||||
plotsun=1;;
|
plotsun=1;;
|
||||||
r)
|
r)
|
||||||
@ -92,7 +96,13 @@ else
|
|||||||
MAP_FRAME_AXES=WESnZ \
|
MAP_FRAME_AXES=WESnZ \
|
||||||
MAP_LABEL_OFFSET=2.5p
|
MAP_LABEL_OFFSET=2.5p
|
||||||
|
|
||||||
gmt grd2cpt ${data} -R${range} -C${color} -D > $cptfile
|
# 设置色标文件
|
||||||
|
if [[ $nocpt == 1 ]]; then
|
||||||
|
cptfile=${color}
|
||||||
|
else
|
||||||
|
gmt grd2cpt ${data} -R${range} -C${color} -D -M > $cptfile
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $plotgrad == 1 ]]; then
|
if [[ $plotgrad == 1 ]]; then
|
||||||
gradfile=${data%.*}Grad.nc
|
gradfile=${data%.*}Grad.nc
|
||||||
if [[ $gridData == 'null' ]]; then
|
if [[ $gridData == 'null' ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user