2018-06-19_10-59
/work2/am/2017.LLC.Pacific/HAGIWARA_MASK/MAP.HISTO.CLOUD.V.BIN
am@localhost
$ srcdump.sh OBSP.N.PACIFIC.PL.COLOR.sh
#------------------------------
# List of the following files:
#------------------------------
OBSP.N.PACIFIC.PL.COLOR.sh
#------------------------------
# Machine info
#------------------------------
localhost
/work2/am/2017.LLC.Pacific/HAGIWARA_MASK/MAP.HISTO.CLOUD.V.BIN
Tue Jun 19 10:59:54 JST 2018
#======================
# OBSP.N.PACIFIC.PL.COLOR.sh
#======================
#!/bin/bash
# Description:
#
# Author: am
#
# Host: localhost
# Directory: /work2/am/2017.LLC.Pacific/HAGIWARA_MASK/OBSP.N.PACIFIC
#
# Revision history:
# This file is created by /usr/local/mybin/ngmt.sh at 10:50 on 06-04-2018.
. ./gmtpar.sh
echo "Bash script $0 starts."
range=140/180/30/50
size=Q130/5
xanot=a10f5g5
yanot=a5f5g5
indir=.
infle=OBS.P_20160606-20160625_140-180_030-050.DAY+NIGHT.txt
infle1=OBS.P_20160606-20160625_140-180_030-050.DAY.txt
infle2=OBS.P_20160606-20160625_140-180_030-050.NIGHT.txt
inlist="$infle $infle1 $infle2"
for intemp in $inlist; do
incheck=${indir}/${intemp}
if [ ! -f $incheck ]; then
echo Error in $0 : No such file, $incheck
exit 1
fi
done
indir3=/work2/am/2017.LLC.Pacific/ERA-I.SYNOPTIC
infle3=ERA-I.SYNOPTIC.siteinfo.txt
in3=${indir3}/${infle3}
if [ ! -f $in3 ]; then
echo ERROR in $0
echo NO SUCH FILE, $infle3
echo IN $indir3
exit 1
fi
out=$(basename $infle .DAY+NIGHT.txt).COLOR.ps
cpt=$(basename $0 .sh).cpt
makecpt -Cwysiwyg -T6/25/1 >$cpt
# DAY+NIGHT
in=${indir}/${infle}
awk '{if($1!="#") print $1, $2, substr($3,7,2)}' $in|\
psxy -R$range -J$size -Sc0.01 -C$cpt -K -X1.5 -Y7 -P >$out
# SOUNDING
awk '{if($1!="#") print $8+$9/60., $6+$7/60.,\
" 10 0 0 LT ", substr($3,9,2)}' $in3|\
pstext -D0.02/0.02 -R$range -W255/255/255 -G0 -J$size -O -K >>$out
awk '{if($1!="#") print $8+$9/60.,$6+$7/60.,substr($3,9,2)}' $in3|\
psxy -R$range -J$size -Sa0.1 -W4/255/255/255 -K -O >>$out
awk '{if($1!="#") print $8+$9/60.,$6+$7/60.,substr($3,9,2)}' $in3|\
psxy -R$range -J$size -Sa0.1 -W3 -K -O >>$out
anot=${xanot}/${yanot}:."DAY+NIGHT":WsNe
gmtset HEADER_OFFSET = 0
pscoast -R$range -J$size -B$anot -W1 -G200 -O -K >>$out
# DAY
in1=${indir}/${infle1}
awk '{if($1!="#") print $1, $2, substr($3,7,2)}' $in1|\
psxy -R$range -J$size -Sc0.01 -C$cpt -Y-3 -O -K >>$out
# SOUNDING
awk '{if($1!="#") print $8+$9/60., $6+$7/60.,\
" 10 0 0 LT ", substr($3,9,2)}' $in3|\
pstext -D0.02/0.02 -R$range -W255/255/255 -G0 -J$size -O -K >>$out
awk '{if($1!="#") print $8+$9/60.,$6+$7/60.,substr($3,9,2)}' $in3|\
psxy -R$range -J$size -Sa0.1 -W4/255/255/255 -K -O >>$out
awk '{if($1!="#") print $8+$9/60.,$6+$7/60.,substr($3,9,2)}' $in3|\
psxy -R$range -J$size -Sa0.1 -W3 -K -O >>$out
anot=${xanot}/${yanot}:."DAY":Wsne
gmtset HEADER_OFFSET = -0.3i
pscoast -R$range -J$size -B$anot -W1 -G200 -O -K >>$out
# NIGHT
in2=${indir}/${infle2}
awk '{if($1!="#") print $1, $2, substr($3,7,2)}' $in2|\
psxy -R$range -J$size -Sc0.01 -C$cpt -Y-3 -O -K >>$out
# SOUNDING
awk '{if($1!="#") print $8+$9/60., $6+$7/60.,\
" 10 0 0 LT ", substr($3,9,2)}' $in3|\
pstext -D0.02/0.02 -R$range -W255/255/255 -G0 -J$size -O -K >>$out
awk '{if($1!="#") print $8+$9/60.,$6+$7/60.,substr($3,9,2)}' $in3|\
psxy -R$range -J$size -Sa0.1 -W4/255/255/255 -K -O >>$out
awk '{if($1!="#") print $8+$9/60.,$6+$7/60.,substr($3,9,2)}' $in3|\
psxy -R$range -J$size -Sa0.1 -W3 -K -O >>$out
anot=${xanot}/${yanot}:."NIGHT":WSne
pscoast -R$range -J$size -B$anot -W1 -G200 -O -K >>$out
psscale -D5.5/5/5/0.1 -C$cpt -E -Ba2f1 -O -K >>$out
rm -v $cpt
xoffset=
yoffset=9
export LANG=C
curdir1=$(pwd)
now=$(date)
host=$(hostname)
time=$(ls -l ${in} | awk '{print $6, $7, $8}')
time1=$(ls -l ${in1} | awk '{print $6, $7, $8}')
time2=$(ls -l ${in2} | awk '{print $6, $7, $8}')
pstext <<EOF -JX6/1.5 -R0/1/0/1.5 -N -X${xoffset:-0} -Y${yoffset:-0} -O >> $out
0 1.50 9 0 1 LM $0 $@
0 1.35 9 0 1 LM ${now}
0 1.20 9 0 1 LM ${host}
0 1.05 9 0 1 LM ${curdir1}
0 0.90 9 0 1 LM Indir: ${indir}
0 0.75 9 0 1 LM Input: ${infle} (${time})
0 0.60 9 0 1 LM Input: ${infle1} (${time1})
0 0.45 9 0 1 LM Input: ${infle2} (${time2})
EOF
echo
echo "INPUT: $in"
echo "INPUT: $in1"
echo "INPUT: $in2"
echo "INPUT: $in3"
echo "OUTPUT: $out"
echo
echo "Done $0"
#----------------------
# End of OBSP.N.PACIFIC.PL.COLOR.sh
#----------------------