LWplot_TL
changeset 26 b89d4b01fcc5
parent 22 3bfb89eb67f8
child 27 2053d8de8d6b
equal deleted inserted replaced
25:bd38f8bfb8e6 26:b89d4b01fcc5
     1 #!/bin/ksh
     1 #!/bin/ksh
     2 #======================================================================
     2 #======================================================================
     3 #                    L W P L O T _ T L 
     3 #                    L W P L O T _ T L 
     4 #                    doc: Thu Oct 13 10:51:49 2011
     4 #                    doc: Thu Oct 13 10:51:49 2011
     5 #                    dlm: Sun Apr  5 22:54:26 2015
     5 #                    dlm: Thu Apr 16 08:09:32 2015
     6 #                    (c) 2011 A.M. Thurnherr
     6 #                    (c) 2011 A.M. Thurnherr
     7 #                    uE-Info: 24 0 NIL 0 0 72 2 2 4 NIL ofnI
     7 #                    uE-Info: 57 0 NIL 0 0 72 2 2 4 NIL ofnI
     8 #======================================================================
     8 #======================================================================
     9 
     9 
    10 # HISTORY:
    10 # HISTORY:
    11 #	Oct 13, 2011: - created
    11 #	Oct 13, 2011: - created
    12 #	Oct 14, 2011: - fiddled
    12 #	Oct 14, 2011: - fiddled
    20 #	Oct 16, 2012: - renamed elapsed to elapsed.LADCP
    20 #	Oct 16, 2012: - renamed elapsed to elapsed.LADCP
    21 #	Mar 23, 2013: - adapted to piece-wice time lagging
    21 #	Mar 23, 2013: - adapted to piece-wice time lagging
    22 #   Oct 30, 2103: - got rid of non-portable echo -e
    22 #   Oct 30, 2103: - got rid of non-portable echo -e
    23 #	Apr  5, 2015: - made fixbb optional
    23 #	Apr  5, 2015: - made fixbb optional
    24 #				  - BUG: ps file had not been closed properly (fixbb took care of that)
    24 #				  - BUG: ps file had not been closed properly (fixbb took care of that)
       
    25 #   Apr 16, 2015: - removed copy of input on stdout
    25 
    26 
    26 USAGE="Usage: $0 <eps-file> [in-file]"
    27 USAGE="Usage: $0 <eps-file> [in-file]"
    27 	[ $# -eq 2 ] && exec <"$2" "$0" "$1"
    28 	[ $# -eq 2 ] && exec <"$2" "$0" "$1"
    28 	[ $# -ne 1 ] && { echo $USAGE >&2; exit 1; }
    29 	[ $# -ne 1 ] && { echo $USAGE >&2; exit 1; }
    29 eps_file="$1"
    30 eps_file="$1"
    30 
    31 
    31 while [ -z "$fields" ]
    32 while [ -z "$fields" ]
    32 do
    33 do
    33 	read line
    34 	read line
    34     [ ! -t 1 ] && echo "$line"
       
    35 	[ -z "$out_basename" ] && out_basename=`expr -- "$line" : '#ANTS#PARAMS#.*out_basename{\([^}]*\)}`
    35 	[ -z "$out_basename" ] && out_basename=`expr -- "$line" : '#ANTS#PARAMS#.*out_basename{\([^}]*\)}`
    36 	[ -z "$run_label" ] && run_label=`expr -- "$line" : '#ANTS#PARAMS#.*run_label{\([^}]*\)}`
    36 	[ -z "$run_label" ] && run_label=`expr -- "$line" : '#ANTS#PARAMS#.*run_label{\([^}]*\)}`
    37 	[ -z "$min_elapsed" ] && min_elapsed=`expr -- "$line" : '#ANTS#PARAMS#.*elapsed.min{\([^}]*\)}`
    37 	[ -z "$min_elapsed" ] && min_elapsed=`expr -- "$line" : '#ANTS#PARAMS#.*elapsed.min{\([^}]*\)}`
    38 	[ -z "$max_elapsed" ] && max_elapsed=`expr -- "$line" : '#ANTS#PARAMS#.*elapsed.max{\([^}]*\)}`
    38 	[ -z "$max_elapsed" ] && max_elapsed=`expr -- "$line" : '#ANTS#PARAMS#.*elapsed.max{\([^}]*\)}`
    39 	[ -z "$bot_elapsed" ] && bot_elapsed=`expr -- "$line" : '#ANTS#PARAMS#.*elapsed.bot{\([^}]*\)}`
    39 	[ -z "$bot_elapsed" ] && bot_elapsed=`expr -- "$line" : '#ANTS#PARAMS#.*elapsed.bot{\([^}]*\)}`
    51 eps_file="$PWD/$eps_file"	# make outfile name absolute (hopefully, it is not already...)
    51 eps_file="$PWD/$eps_file"	# make outfile name absolute (hopefully, it is not already...)
    52 mkdir /tmp/$$				# GMT makes tmpfiles and is not reentrant
    52 mkdir /tmp/$$				# GMT makes tmpfiles and is not reentrant
    53 cd /tmp/$$
    53 cd /tmp/$$
    54 
    54 
    55 TMPFILE=/tmp/$$.LWplot_TL
    55 TMPFILE=/tmp/$$.LWplot_TL
    56 if [ ! -t 1 ]
    56 cat > $TMPFILE
    57 then
       
    58 	tee $TMPFILE
       
    59 else
       
    60 	cat > $TMPFILE
       
    61 fi
       
    62 
    57 
    63 [ -f .gmtdefaults4 ] ||
    58 [ -f .gmtdefaults4 ] ||
    64 	gmtset	PAPER_MEDIA letter+ \
    59 	gmtset	PAPER_MEDIA letter+ \
    65 			LABEL_FONT_SIZE 14 ANNOT_FONT_SIZE_PRIMARY 14 \
    60 			LABEL_FONT_SIZE 14 ANNOT_FONT_SIZE_PRIMARY 14 \
    66 			WANT_EURO_FONT true \
    61 			WANT_EURO_FONT true \