#!/usr/local/bin/perl # # File: CheckNone # # Checks to see that GetAnts was successful # # Page Stites 1999/12/03 # # Error Checking unless ($#ARGV == 1) { print "Usage: CheckNone yyyy mm --> Lists files not changed by GetAnts\n"; exit 1; } # Index variables for navigating through rinex directory structure: @days = ("01", "02", "03", "04", "05", "06", "07", "08", "09", 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31); # interpretation of arguments @years = ("$ARGV[0]"); @months = ("$ARGV[1]"); $source = "/closet/GPS/working/rinex"; # Main Program foreach $year (@years) { $yy = substr($year, 2, 2); foreach $mm (@months) { foreach $dd (@days) { $searchpath = "$year/$yy$mm/$yy$mm$dd"; %allfiles = (); &ExtractCodes; &FindAnts; } } } # Subroutine: ExtractCodes # Usage: &Extractcodes; # Comments: extractes 4 letter station codes from filenames sub ExtractCodes { @contents = (); @contents = `ls $source/$searchpath`; foreach $name (@contents) { chomp $name; $code = substr($name, 0, 4); push(@codes, $code); $allfiles{$name} = $code; } } # Subroutine: FindAnts # Usage: &FindAnts; # Comments: Extracts and prints antenna types, instrument heights, receiver types, and dates. sub FindAnts { while(($file, $stacode) = each(%allfiles)) { $test = substr($file, 13, 1); if ($test eq "o") { @RinLines = `zcat $source/$searchpath/$file | head -50`; unless (grep { m/NONE/ } @RinLines) { if ((grep { m/unknown/ } @RinLines) && !(grep { m/Ashtech/ } @RinLines) ) { print "$file contains unknown antenna\n" } elsif (grep { m/TRIMBLE/ } @RinLines) { print "$file contains Trimble antenna\n" } elsif (grep { m/Ashtech/ } @RinLines) { print "$file contains unknown Ashtech antenna\n" } else { print "$file not changed by GetAnts\n" } } } } }