#!/usr/local/bin/perl # eb0.p file1 # takes takeuchi's error bar file N z delta # and returns N u followed by N l, relative to zero. # # also computes gamma $num=1.0; $beta=9.90099e-07; $out=1; $gamma=0.0; eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; $/ = ""; # read in by the paragraph $* = 1 ; while( <> ) { # while ( /^\s*([\-\d\.]+)\s+([\-\d\.]+)\s+([\-\d\.]+)\s*\n/g ) { $upper .= sprintf ( "$1\t%f\n" , $3 * $num ) ; $lower .= sprintf ( "$1\t%f\n" , - $3 * $num ) ; $gamma += $3 * $3 ; } } # if ($out) { print $upper, "\n" , $lower ; } $gamma *= $beta ; print STDERR "gamma = $gamma\n" ;