[cig-commits] r18858 - mc/2D/ConMan/trunk/visual/gmt

becker at geodynamics.org becker at geodynamics.org
Sat Aug 27 11:13:39 PDT 2011


Author: becker
Date: 2011-08-27 11:13:39 -0700 (Sat, 27 Aug 2011)
New Revision: 18858

Modified:
   mc/2D/ConMan/trunk/visual/gmt/split_field_out
Log:
*** empty log message ***

Modified: mc/2D/ConMan/trunk/visual/gmt/split_field_out
===================================================================
--- mc/2D/ConMan/trunk/visual/gmt/split_field_out	2011-08-26 19:44:47 UTC (rev 18857)
+++ mc/2D/ConMan/trunk/visual/gmt/split_field_out	2011-08-27 18:13:39 UTC (rev 18858)
@@ -1,11 +1,17 @@
 #!/bin/bash
 #
-# splits conman ascii output into GMT/netcdf grd files
+# splits CIG ConMan version ascii output into GMT/netcdf grd files and plot 
 #
+# Thorsten Becker, twb at usc.edu
+#
+# $Id$
+#
 model=${1-new}			# model name
-plot=${2-3}			# 0: produce grids 1: grids and plot 2: plot and remove grids 3: convert to GIF
-
-
+plot=${2-3}			# 0: produce grids 1: grids and plot 2: plot and remove grids 3: convert to PNG or GIF and make movies, 
+                                # depending on make_movie setting
+addvel=${3-0}			# add velocity vectors
+make_movie=${4-1}		# make a gif movie, or leave PNGs for plot mode 3
+#
 if=field.$model			# input file
 op=grd.$model			# output prefix
 
@@ -16,6 +22,7 @@
 trap "rm -f $tmpn.* ; exit" 0 1 2 15
 
 
+
 pname=`basename $0`
 
 
@@ -69,22 +76,33 @@
     if [ $plot -gt 1 ];then
 	if [ $oc -eq 0 ];then
 #	    makecpt -Cpolar -T0/1/.1 > $tmpn.cpt
-	    makecpt -Cpolar -T0/1/.1 -Z > $tmpn.cpt
+#	    makecpt -Cpolar -T0/1/.1 -Z > $tmpn.cpt
+	    makecpt -Chaxby -T0/1/.01 > $tmpn.cpt
 	    proj=-Jx3
 	fi
 	#
 	# create a plot with temperatures and velocities
 	#
 	ofile=$op.$tlabel.ps
-	grdimage -C$tmpn.cpt $op.t.$tlabel -P $proj $reg -Ba.5f.05:"x":/a.5f.05:"z":wESn -K > $ofile
-	grdvector $op.vx.$tlabel  $op.vy.$tlabel  $proj $reg -Q0.03/0.06/0.045n.05 -N \
-	    -I0.2 -S$scale -O -K -Ggray -W0.5 >> $ofile
+	grdsample $op.t.$tlabel -I0.005 -Gtmp.grd # finer sampling
+	grdimage -C$tmpn.cpt tmp.grd -P $proj $reg -Ba.5f.05:"x":/a.5f.05:"z":wESn -K > $ofile
+	rm tmp.grd
+	if [ $addvel -eq 1 ];then
+	    grdvector $op.vx.$tlabel  $op.vy.$tlabel  $proj $reg -Q0.03/0.06/0.045n.05 -N \
+		-I0.2 -S$scale -O -K -Ggray -W0.5 >> $ofile
+	fi
 	psscale -N50 -D-0.85/1.4/2.5/.2 -C$tmpn.cpt -B.25/:"T": -O  >> $ofile
 	echo $pname: written to $ofile
 	if [ $plot -eq 3 ];then	# convert
 #	    gv $ofile
-	    echo $pname: converting to $op.$tlabel.gif, deleting PS
-	    /usr/bin/convert $ofile $op.$tlabel.gif
+
+	    if [ $make_movie -eq 1 ];then
+		echo $pname: converting to $op.$tlabel.gif, deleting PS
+		/usr/bin/convert -density 150 -background white -flatten $ofile $op.$tlabel.gif
+	    else
+		echo $pname: converting to $op.$tlabel.png, deleting PS
+		/usr/bin/convert -density 150 -background white -flatten $ofile $op.$tlabel.png
+	    fi
 	    rm $ofile
 	fi
     fi
@@ -94,10 +112,10 @@
     ((oc=oc+1))
 done
 
-if [ $plot -eq 3 ];then		# combine several GIF files to a movie
-    xv *.gif
+if [ $make_movie -eq 1 ];then		# combine several GIF files to a movie
+    #xv *.gif
     gifsicle $op.*.gif > $model.movie.gif
-    rm $op.*.gif
+    #rm $op.*.gif
     echo $pname: output in $model.movie.gif
 
 



More information about the CIG-COMMITS mailing list