checkIX
author Andreas Thurnherr <ant@ldeo.columbia.edu>
Mon, 20 Apr 2020 15:42:28 -0400
changeset 52 5b07a9b89aee
parent 12 0f89b1523648
permissions -rwxr-xr-x
- adapted to work with IMPed moored ADCP data - fixed bug in RDI_PD0_IO

#!/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);