#!/bin/csh -bf # # OUTLIERS_TABLE # # Script displays the number of outliers for each satellite (row) and station (column). # N.E. King # May 1994 echo " " if ($#argv != 0) then # CHECK NUMBER OF ARGUMENTS echo Usage: outliers_table exit 1 endif if (-e postfit.log) then # CHECK THAT FILE CALLED POSTFIT.LOG EXISTS else echo There is no file called postfit.log in the working directory exit 1 endif if (-e qmfile) then # CHECK THAT FILE CALLED QMFILE EXISTS else echo There is no file called qmfile in the working directory exit 1 endif outliers_list > temp1.$$ # SAVE OUTLIERS LIST IN TEMPORARY FILE set numsta = `dump_qm qmfile | head -1 | awk '{print $1}'` set numsat = `dump_qm qmfile | head -1 | awk '{print $2}'` set stanam = `dump_qm qmfile | head -2 | tail -1` set satnam = `dump_qm qmfile | head -3 | tail -1` echo " " # LABEL TOP OF TABLE echo $numsta stations echo $numsat satellites echo " " echo " " $stanam "Total" echo " " @ i=1 # LOOP ON SATELLITES while ($i <= $numsat) echo $satnam[$i] > temp2.$$ @ j=1 # LOOP ON STATIONS while ($j <= $numsta) set numout = `grep $satnam[$i] temp1.$$ | grep $stanam[$j] | wc -l` if ($numout < 10) then set numout=0$numout endif if ($numout < 100) then set numout=0$numout endif echo $numout >> temp2.$$ @ j=$j + 1 end set row = `cat temp2.$$` echo $row $#row set str = `echo $row | sed 's/ /_/g'` echo $str $#str @ i=$i + 1 end echo " " echo Total rm temp?.$$