#!/bin/csh -f
#
# gapstplot - plot a gapstimes file as a cdf
#
# usage:
#   gapstplot pattern alg synch event
# where pattern is the directory, alg and synch are one-letter codes,
# and time is the event name (contin, watch, etc).

if ($#argv < 4) then
	   echo usage: gapstplot pattern alg synch event
	   echo e.g., gapstplot gpr g e watch
	   exit 1
endif

set pattern=$1
set alg=$2
set synch=$3
set event=$4

cd $pattern

set file=cdf.$event.$alg.$synch
cols 2 < *.$alg.*.$synch.*.$event | cdf | cdf-reduce 100 > $file
plot -lines -t "cdf of $event for $pattern/$synch, predictor $alg (msec)" $file
