(Message inbox:475)
Received: from chaos.syr.edu by spica.npac.syr.edu (4.1/I-1.98K)
	id AA05000; Wed, 1 Nov 95 14:54:10 EST
From: faleski@npac.syr.edu (Michael C. Faleski)
Received: (faleski@localhost) by chaos.syr.edu (8.6.7/8.6.6) id OAA13465 for salgado; Wed, 1 Nov 1995 14:54:05 -0500
Date: Wed, 1 Nov 1995 14:54:05 -0500
Message-Id: <199511011954.OAA13465@chaos.syr.edu>
To: salgado@npac.syr.edu



#! /usr/local/bin/perl

## just report left field and 1/rate - IV curve for simple ramps

$eps = 0.0000001;
$n = 0;                              ## init number of electrons = 0
$tlim = $ARGV[0];                    ## read at what point to startave
$sumx = 0;
$sumy = 0;
$velnorm = 2.0;
$oldF = -10000100.;
while (<STDIN>) {
  ($F, $vx, $vy) = split;            ## split: Force, velx, vely
  if ($oldF == -10000100.) {$oldF = $F;}
  if ($F == $oldF) {  ## still same field
      $n++;
      if ($n > $tlim) {
      $vel = $vx;
      $sumvel += $vel;
      $sumsqvel += $vel * $vel;
    }
  }
  else {
    if ($n>$tlim) {                  ## if enough points, print average
      $sumvel = $sumvel/($n-$tlim);
      $sumsqvel = $sumsqvel/($n-$tlim);
      printf "%lf %lf %lf %d\n",
        $oldF, $sumvel, sqrt($sumsqvel-$sumvel*$sumvel), $n-$tlim;
      $n=1; $oldF = $F; $sumvel = 0; $sumsqvel = 0;}
  }
}

if ($n>$tlim) {
      $sumvel = $sumvel/($n-$tlim);
      $sumsqvel = $sumsqvel/($n-$tlim);
      printf "%lf %lf %lf %d\n",
        $oldF, $sumvel, sqrt($sumsqvel-$sumvel*$sumvel), $n-$tlim;
}



