Monday, August 20, 2007

GMT script for the moving-window with jackknife uncertainty -- epicentral bin-sums

NOTE -- there is a bit of shellscript syntax that is not showing up in the blog post. There is a shell command

process leftangle-leftangle END rightangle-rightangle plot.ps

that instructs "process" to read the succeeding lines of data until it reaches a line that contains just "END"
In my blog posts the phrase "leftangle-leftangle END rightangle-rightangle" is printing as "leftangle-rightangle"

So you must correct these lines for the shellscripts to work



#!/bin/csh -f

#shell to plot RF wiggles from the "grid" files generated by
#spectral coherence code of JP, arranged by BAZ
#Input - $1 $2 $3 - radial RF filenames $4 $5 $6 transverse RF filenames $7 - scale $8 title
# filenames are for mean RF estimate, and lower and upper jackknife uncertainty bounds on the RF estimate
# the script uses PS wiggle to draw a green envelope that represents the uncertainty range
# Then plots the mean RF estimate within the green uncertainty
# two calls to pswiggle for each jackknife file allow the "certain" RF excursion to be red or blue

echo "EDIT PLOTTING PARAMETERS TO SUIT YOUR DATA"
set BOX = -R-12/12/0/180
set FRAME = -JX3/7.5
set FRAME_BIG = -JX3/9.4

/bin/rm plot.ps

set scale = $7

set title = $8

pswiggle $2 $FRAME $BOX -Z$scale -M -G200/255/200 -Ba4f1/f30\SWen -P -K > plot.ps
pswiggle $3 $FRAME $BOX -Z$scale -M -G200/255/200 -N -Ba4f1/f30\Swen -P -K -O >> plot.ps
pswiggle $3 $FRAME $BOX -Z$scale -M -G0/0/255 -Ba4f1/f30\SWen -P -K -O >> plot.ps
pswiggle $2 $FRAME $BOX -Z$scale -M -G255/0/0 -N -Ba4f1/f30\Swen -P -K -O >> plot.ps

pswiggle $1 $FRAME $BOX -Z$scale -W1/0 -M -P -K -O >> plot.ps
echo 0 2.4 14 0 5 CT $1 scale $7 | pstext $FRAME -R-1/1/-2/2 -N -O -K >> plot.ps
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
0 -10
0 180
END
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
2.5 -10
2.5 180
END
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
5 -10
5 180
END
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
7.5 -10
7.5 180
END

pswiggle $5 $FRAME $BOX -Z$scale -M -G200/255/200 -Ba4f1/f30\SwEn -P -O -K -X3.5 >> plot.ps
pswiggle $6 $FRAME $BOX -Z$scale -M -G200/255/200 -N -Ba4f1/f30\SwEn -P -K -O >> plot.ps
pswiggle $6 $FRAME $BOX -Z$scale -M -G0/0/255 -Ba4f1/f30\SwEn -P -O -K >> plot.ps
pswiggle $5 $FRAME $BOX -Z$scale -M -G255/0/0 -N -Ba4f1/f30\SwEn -P -K -O >> plot.ps

pswiggle $4 $FRAME $BOX -Z$scale -W1/0 -M -P -K -O >> plot.ps
echo 0 2.4 14 0 5 CT $4 scale $7 | pstext $FRAME_BIG -R-1/1/-2/3 -N -O -K >> plot.ps
echo -2.5 2.7 24 0 5 LT $8 | pstext $FRAME_BIG -R-1/1/-2/3 -N -O -K >> plot.ps
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
0 -10
0 180
END
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
2.5 -10
2.5 180
END
psxy $FRAME $BOX -W1.5p/0/150/0 -O -K <> plot.ps
5 -10
5 180
END
psxy $FRAME $BOX -W1.5p/0/150/0 -O <> plot.ps
7.5 -10
7.5 180
END

echo gv is JPark's alias for ghostscript
gv plot.ps

No comments:

 
Link