#!/usr/bin/perl
#======================================================================
# C H E C K I X
# doc: Wed Dec 12 15:58:56 2012
# dlm: Mon Apr 22 15:17:17 2013
# (c) 2012 A.M. Thurnherr
# uE-Info: 43 0 NIL 0 0 72 2 2 4 NIL ofnI
#======================================================================
# HISTORY:
# Dec 12, 2012: - created
die("Usage: $0 <count-spec[ ...]>\n")
unless (@ARGV > 0);
foreach my $id (`count @ARGV`) {
$id = sprintf('%03d',$id)
unless (-f "$id.log");
unless (-f "$id.log") {
print(STDERR "$id: missing station\n");
next;
}
die("$id: file <$id.lad> missing\n") # ensure required output is here
unless (-f "$id.lad");
die("$id: file <$id.log> missing\n")
unless (-f "$id.log");
die("$id: file <$id.mat> missing\n")
unless (-f "$id.mat");
die("$id: file <$id.txt> missing\n")
unless (-f "$id.txt");
if (-f "${id}_11.ps" && # handle warnings figure
length(`grep 'LADCP profile OK' ${id}_11.ps`) == 0) {
print("$id: warnings produced\n");
system("gv ${id}_11.ps &");
}
print("$id: no valid BT data\n") # check validity of ancillary data
unless (-f "$id.bot");
print("$id: no valid SADCP data\n")
unless (length(`grep 'all SADCP values removed' $id.log`) == 0);
}
exit(0);