add -p option
This commit is contained in:
parent
f27e997778
commit
755ba86754
@ -13,8 +13,9 @@ labels=("longitude (degree)" "latitude (degree)")
|
|||||||
plot_para=(0 0 0 0)
|
plot_para=(0 0 0 0)
|
||||||
plotgrad=0
|
plotgrad=0
|
||||||
nocpt=0
|
nocpt=0
|
||||||
|
inverseCPT=0
|
||||||
# 从命令行获取参数
|
# 从命令行获取参数
|
||||||
while getopts "hi:r:u:c:a:gv:n" arg
|
while getopts "hi:r:u:c:a:gv:np" arg
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
h)
|
h)
|
||||||
@ -28,6 +29,7 @@ For futher explanations, please look for GMT's manuscripts.\nAuthor: Yi Zhang (z
|
|||||||
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" "-g" "use grdgradient. The default is false."
|
printf "%s\t%s\n" "-g" "use grdgradient. The default is false."
|
||||||
printf "%s\t%s\n" "-n" "disabele the use of grd2cpt."
|
printf "%s\t%s\n" "-n" "disabele the use of grd2cpt."
|
||||||
|
printf "%s\t%s\n" "-p" "inverse the color pattern specified by the -c option, no use if -n option is implemented."
|
||||||
exit 0;;
|
exit 0;;
|
||||||
i)
|
i)
|
||||||
data=$OPTARG;;
|
data=$OPTARG;;
|
||||||
@ -44,6 +46,8 @@ For futher explanations, please look for GMT's manuscripts.\nAuthor: Yi Zhang (z
|
|||||||
plotgrad=1;;
|
plotgrad=1;;
|
||||||
n)
|
n)
|
||||||
nocpt=1;;
|
nocpt=1;;
|
||||||
|
p)
|
||||||
|
inverseCPT=1;;
|
||||||
?)
|
?)
|
||||||
printf "error: unknow argument\nuse -h option to see help information\n"
|
printf "error: unknow argument\nuse -h option to see help information\n"
|
||||||
exit 1;;
|
exit 1;;
|
||||||
@ -93,7 +97,11 @@ else
|
|||||||
if [[ $nocpt == 1 ]]; then
|
if [[ $nocpt == 1 ]]; then
|
||||||
cptfile=${color}
|
cptfile=${color}
|
||||||
else
|
else
|
||||||
gmt grd2cpt ${data} -R${range} -C${color} -Z -D -M > $cptfile
|
if [[ $inverseCPT == 1 ]]; then
|
||||||
|
gmt grd2cpt ${data} -R${range} -C${color} -Z -D -M -I > $cptfile
|
||||||
|
else
|
||||||
|
gmt grd2cpt ${data} -R${range} -C${color} -Z -D -M > $cptfile
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $plotgrad == 1 ]]; then
|
if [[ $plotgrad == 1 ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user