listHdr
author A.M. Thurnherr <athurnherr@yahoo.com>
Tue, 29 Jun 2021 12:21:32 -0400
changeset 59 4f4530fa35da
parent 58 78607e2e8add
permissions -rwxr-xr-x
V2.4 - New Features: - support for Nortek PD0 files - patchPD0 support for moored ADCP data - bug fixes & minor improvements
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     1
#!/usr/bin/perl
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     2
#======================================================================
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     3
#                    L I S T H D R 
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     4
#                    doc: Sat Jan 18 18:41:49 2003
58
78607e2e8add Nortek files
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 57
diff changeset
     5
#                    dlm: Wed Mar 17 22:53:25 2021
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     6
#                    (c) 2003 A.M. Thurnherr
58
78607e2e8add Nortek files
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 57
diff changeset
     7
#                    uE-Info: 50 35 NIL 0 0 72 10 2 4 NIL ofnI
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     8
#======================================================================
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     9
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    10
# Print useful info from the RDI BB header
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    11
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    12
# HISTORY:
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    13
#	Jan 18, 2003: - incepted as a test for [WorkhorseBinRead.pl]
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    14
#	Jan 19, 2003: - continued
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    15
#	Feb 14, 2003: - added BT setup params
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    16
#	Mar 15, 2003: - added and removed BATTERY
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    17
#	Feb 24, 2004: - corrected TRANSMIT_LAG_DISTANCE units
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    18
#	Feb 26, 2004: - added ENSEMBLE_LENGTH
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    19
#				  - added FIRMWARE
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    20
#	Mar  4, 2004: - added transducer orientation
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    21
#	Mar 30, 2004: - decified firmware output
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    22
#	Sep 14, 2005: - made BT data optional, dep. on NUMBER_OF_DATA_TYPES
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    23
#				  - added DATA_FORMAT & related
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    24
#	Sep 15, 2005: - change BinRead library name
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    25
#				  - compacted output format
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    26
#	Oct 30, 2005: - shuffled stuff, added DATA_FORMAT_VARIANT
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    27
#	Aug 21, 2006: - added CPU_SERIAL_NUMBER
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    28
#				  - added usage error
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    29
#	Sep 19, 2007: - adapted to new [RDI_BB_Read.pl] (not tested)
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    30
#	Jul  9, 2008: - added output regarding available sensors
10
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
    31
#	Mar 20, 2013: - removed DATA_FORMAT stuff
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
    32
#	Mar 25, 2013: - added INSTRUMENT_TYPE stuff instead
20
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    33
#   Apr 24, 2014: - BUG: USE_3_BEAM_ON_LOW_CORR was reported in water-track setup
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    34
#   Jul 12, 2014: - BUG: did not work with multiple input files
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    35
#                 - added -s)ummary option
21
0b5bbe60131c version sent to P16N
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    36
#	Sep  9, 2014: - adapted to files with >7 data types
29
aeb26e966b71 transport
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 22
diff changeset
    37
#				  - BUG: usage message was not produced on empty arglist
30
184133e916be transport
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 29
diff changeset
    38
#	Jan  9, 2016: - added support for PRODUCER data field
29
aeb26e966b71 transport
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 22
diff changeset
    39
#				  - updated getopts to current perl version
aeb26e966b71 transport
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 22
diff changeset
    40
#				  - updated IO library name
31
b6ca27a1d19c pre Tampa
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 30
diff changeset
    41
#				  - adapted to [ADCP_tools_lib.pl]
37
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 31
diff changeset
    42
#	Nov  9, 2016: - BUG: no error on missing files
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
    43
#	Aug  7, 2017: - added LAG_LENGTH
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
    44
#				  - added AMBIGUITY_VELOCITY
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
    45
#	Aug  8, 2017: - added -l)ong listing
48
cdc74ebada81 after partial adaptation to RTI files
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 43
diff changeset
    46
# 	Jun 13, 2019: - removed BT_PRESENT flag support
49
8f4fbdaf0102 post merge
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 48
diff changeset
    47
#	Jun 26, 2019: - added comment to the effect that BT setup cannot be listed
8f4fbdaf0102 post merge
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 48
diff changeset
    48
#					with this utility any more
58
78607e2e8add Nortek files
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 57
diff changeset
    49
#	Mar  6, 2021: - adapted to Nortek Signature data files
78607e2e8add Nortek files
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 57
diff changeset
    50
#	Mar 17, 2021: - updated HISTORY
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    51
29
aeb26e966b71 transport
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 22
diff changeset
    52
use Getopt::Std;
aeb26e966b71 transport
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 22
diff changeset
    53
31
b6ca27a1d19c pre Tampa
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 30
diff changeset
    54
($ADCP_TOOLS) = ($0 =~ m{(.*/)[^/]+});
42
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    55
$ADCP_tools_minVersion = 2.1; 
31
b6ca27a1d19c pre Tampa
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 30
diff changeset
    56
require "$ADCP_TOOLS/ADCP_tools_lib.pl";
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    57
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
    58
die("Usage: $0 [-s)ummary] [-l)ong listing] <PD0 file[...]>\n")
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
    59
    unless (&getopts('ls') && @ARGV);
20
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    60
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    61
if ($opt_s) {
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    62
	print("#!/usr/bin/perl -S list\n");     
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    63
	chmod(0777&~umask,*STDOUT);
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    64
	print("#ANTS#FIELDS# {id} {serial_number} {transducer_frequency} {number_of_bins} {blanking_distance} {bin_length} {pulse_length}\n");
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    65
}
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    66
37
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 31
diff changeset
    67
while ($ARGV[0] ne '') {
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 31
diff changeset
    68
	die("$ARGV[0]: No such file or directory\n")
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 31
diff changeset
    69
		unless (-f $ARGV[0]);
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 31
diff changeset
    70
	
42
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    71
	my($valid) = readHeader($ARGV[0],\%hdr,$opt_s);
20
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    72
	print("$ARGV[0]:\n") unless ($opt_s);
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    73
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    74
	if ($opt_s) {														# summary ANTS output
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    75
		my($id) = $ARGV[0];
43
b63fa355644c commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 42
diff changeset
    76
		if ($id =~ /^\w{5}\d{3}\.\d{3}/) {								# leave just deployment name for std RDI files
b63fa355644c commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 42
diff changeset
    77
			$id =~ s/00[0-9]\.000//;										
b63fa355644c commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 42
diff changeset
    78
			$id =~ s@^.*/([^/]+)@\1@;
b63fa355644c commit to merge with changes from EN620
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 42
diff changeset
    79
		}
42
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    80
		if ($valid) {
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    81
			printf("%s %d %.1f %d %g %d %.1f\n",
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    82
				$id,$hdr{SERIAL_NUMBER},$hdr{BEAM_FREQUENCY},
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    83
				$hdr{N_BINS},$hdr{BLANKING_DISTANCE},$hdr{BIN_LENGTH},
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    84
	            $hdr{TRANSMITTED_PULSE_LENGTH});
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    85
	    } else {
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    86
			printf("%s [no complete ensemble in file]\n",$id);
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 39
diff changeset
    87
	    }
20
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    88
		shift;
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    89
		next;
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    90
	}
16197fdefdb1 added -s to listHdr
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 18
diff changeset
    91
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    92
	shift;
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    93
	print("    Instrument Characteristics:\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
    94
31
b6ca27a1d19c pre Tampa
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 30
diff changeset
    95
	printf("\tPRODUCER\t\t\t= %s\n",$hdr{PRODUCER});
10
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
    96
	if (defined($hdr{SERIAL_NUMBER})) {
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
    97
		printf("\tINSTRUMENT\t\t\t= %s #%d\n",$hdr{INSTRUMENT_TYPE},$hdr{SERIAL_NUMBER});
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
    98
    } else {
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
    99
		printf("\tINSTRUMENT_TYPE\t\t\t= %s\n",$hdr{INSTRUMENT_TYPE});
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
   100
    }
c835cd613f3e before EGU Vienna
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 0
diff changeset
   101
	printf("\tCPU_SERIAL_NUMBER\t\t= %s\n",$hdr{CPU_SERIAL_NUMBER})
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   102
		if ($opt_l && ($hdr{INSTRUMENT_TYPE} ne 'Explorer')
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   103
				   && ($hdr{INSTRUMENT_TYPE} ne 'Signature'));
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   104
	printf("\tFIRMWARE\t\t\t= %d.%d\n",$hdr{CPU_FW_VER},$hdr{CPU_FW_REV});
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   105
	printf("\tBEAM_FREQUENCY\t\t\t= %.1f kHz\n",$hdr{BEAM_FREQUENCY});
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   106
	printf("\tBEAM_ANGLE\t\t\t= %d deg\n",$hdr{BEAM_ANGLE}) if $opt_l;
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   107
	printf("\tN_BEAMS\t\t\t\t= %d\n",$hdr{N_BEAMS}) if $opt_l;
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   108
	printf("\tTRANSMIT_LAG_DISTANCE\t\t= %g m\n",$hdr{TRANSMIT_LAG_DISTANCE}) if $opt_l;
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   109
	printf("\tLAG_LENGTH\t\t\t= %d\n",$hdr{LAG_LENGTH}) if $opt_l;
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   110
	printf("\tN_DEMODS\t\t\t= %d\n",$hdr{N_DEMODS}) if $opt_l && defined($hdr{N_DEMODS});
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   111
	printf("\tSPEED_OF_SOUND\t\t\t= %d m/s [%s]\n",
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   112
				$hdr{SPEED_OF_SOUND},
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   113
				$hdr{SSPEED_CALCULATED} ? 'using measurements' : 'from settings');
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   114
	printf("\tAMBIGUITY_VELOCITY\t\t= %.1f m/s\n",
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   115
				ambiguity_velocity($hdr{BEAM_FREQUENCY},$hdr{BEAM_ANGLE},$hdr{SPEED_OF_SOUND},$hdr{TRANSMIT_LAG_DISTANCE}))
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   116
					unless ($hdr{INSTRUMENT_TYPE} eq 'Signature');
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   117
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   118
	printf("\tEnvironmental Sensors\t\t: ");
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   119
	printf("PRESSURE ") 						if ($hdr{PRESSURE_SENSOR});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   120
	printf("CONDUCTIVITY ") 					if ($hdr{CONDUCTIVITY_SENSOR});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   121
	printf("TEMPERATURE ") 						if ($hdr{TEMPERATURE_SENSOR});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   122
	printf("COMPASS ") 							if ($hdr{COMPASS});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   123
	printf("PITCH ") 							if ($hdr{PITCH_SENSOR});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   124
	printf("ROLL ") 							if ($hdr{ROLL_SENSOR});
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   125
	print("\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   126
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   127
	if ($opt_l) {
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   128
		printf("\tHardware Flags\t\t\t: ");
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   129
		printf("XDUCER_HEAD_ATTACHED ") 		if ($hdr{XDUCER_HEAD_ATTACHED});
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   130
		printf("CONVEX_BEAM_PATTERN ")			if ($hdr{CONVEX_BEAM_PATTERN});
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   131
		printf("CONCAVE_BEAM_PATTERN ") 		if ($hdr{CONCAVE_BEAM_PATTERN});
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   132
	    print("\n");
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   133
	}
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   134
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   135
	if ($opt_l) {
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   136
		print("    File Format:\n");
56
82384f531dba improvements for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 49
diff changeset
   137
#		printf("\tNUMBER_OF_DATA_TYPES\t\t= %d\n",$hdr{NUMBER_OF_DATA_TYPES});
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   138
		printf("\tDATA_TYPES\t\t\t: @{$hdr{DATA_TYPES}}\n");
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   139
		printf("\tFIXED_LEADER_BYTES\t\t= %4d bytes\n",$hdr{FIXED_LEADER_BYTES});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   140
		printf("\tENSEMBLE_BYTES\t\t\t= %4d bytes\n",$hdr{ENSEMBLE_BYTES});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   141
		printf("\tHEADER_BYTES\t\t\t= %4d bytes\n",$hdr{HEADER_BYTES});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   142
		printf("\tVARIABLE_LEADER_BYTES\t\t= %4d bytes\n",$hdr{VARIABLE_LEADER_BYTES});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   143
		printf("\tVELOCITY_DATA_BYTES\t\t= %4d bytes\n",$hdr{VELOCITY_DATA_BYTES})
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   144
			if defined($hdr{VELOCITY_DATA_BYTES});
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   145
		printf("\tCORRELATION_DATA_BYTES\t\t= %4d bytes\n",$hdr{CORRELATION_DATA_BYTES})
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   146
			if defined($hdr{CORRELATION_DATA_BYTES});
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   147
		printf("\tECHO_INTENSITY_DATA_BYTES\t= %4d bytes\n",$hdr{ECHO_INTENSITY_DATA_BYTES})
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   148
			if defined($hdr{ECHO_INTENSITY_DATA_BYTES});
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   149
		printf("\tPERCENT_GOOD_DATA_BYTES\t\t= %4d bytes\n",$hdr{PERCENT_GOOD_DATA_BYTES})
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   150
			if defined($hdr{PERCENT_GOOD_DATA_BYTES});
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   151
	}
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   152
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   153
	print("    Coordinate System:\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   154
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   155
	printf("\tHEADING_ALIGNMENT_CORRECTION\t\t= %g deg\n",    
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   156
												$hdr{HEADING_ALIGNMENT_CORRECTION})
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   157
												if defined($hdr{HEADING_ALIGNMENT_CORRECTION});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   158
	printf("\tHEADING_BIAS_CORRECTION\t\t= %g deg\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   159
												$hdr{HEADING_BIAS_CORRECTION})
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   160
												if defined($hdr{HEADING_BIAS_CORRECTION});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   161
	print("\tFlags\t\t\t\t: ");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   162
	printf("BEAM_COORDINATES ") 				if ($hdr{BEAM_COORDINATES});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   163
	printf("INSTRUMENT_COORDINATES ")			if ($hdr{INSTRUMENT_COORDINATES});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   164
	printf("SHIP_COORDINATES ") 				if ($hdr{SHIP_COORDINATES});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   165
	printf("EARTH_COORDINATES ")				if ($hdr{EARTH_COORDINATES});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   166
	printf("PITCH_AND_ROLL_USED ")				if ($hdr{PITCH_AND_ROLL_USED});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   167
	printf("BIN_MAPPING_ALLOWED ")				if ($hdr{ALLOW_BIN_MAPPING});
18
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 10
diff changeset
   168
	printf("USE_3_BEAM_ON_LOW_CORR ")			if ($hdr{USE_3_BEAM_ON_LOW_CORR});
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   169
	print("\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   170
	
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   171
	
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   172
	if ($hdr{SPEED_OF_SOUND_CALCULATED}) {
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   173
		print("    Speed-of-Sound Sensors Used:\n");
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   174
		printf("\tPRESSURE\n")					if ($hdr{SSPEED_USING_PRESS});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   175
		printf("\tCOMPASS_USED\n")				if ($hdr{COMPASS_USED});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   176
		printf("\tPITCH_SENSOR_USED\n")			if ($hdr{PITCH_SENSOR_USED});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   177
		printf("\tROLL_SENSOR_USED\n")			if ($hdr{ROLL_SENSOR_USED});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   178
		printf("\tCONDUCTIVITY_SENSOR_USED\n")  if ($hdr{CONDUCTIVITY_SENSOR_USED});
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   179
		printf("\tTEMPERATURE_SENSOR_USED\n")	if ($hdr{TEMPERATURE_SENSOR_USED});
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   180
		print("\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   181
	}
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   182
	
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   183
	
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   184
	print("    Bin Setup:\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   185
	printf("\tN_BINS\t\t\t\t= %d\n",			$hdr{N_BINS});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   186
	printf("\tBLANKING_DISTANCE\t\t= %g m\n", $hdr{BLANKING_DISTANCE});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   187
	printf("\tDISTANCE_TO_BIN1_CENTER\t\t= %g m\n",   
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   188
												$hdr{DISTANCE_TO_BIN1_CENTER});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   189
	printf("\tBIN_LENGTH\t\t\t= %g m\n",		$hdr{BIN_LENGTH});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   190
	printf("\tTRANSMITTED_PULSE_LENGTH\t= %g m\n",    
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   191
												$hdr{TRANSMITTED_PULSE_LENGTH});
39
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   192
	printf("\tRL_FIRST_BIN\t\t\t= %d\n",		$hdr{RL_FIRST_BIN})	if $opt_l;
3bddaa514ef5 before Hamburg
A.M. Thurnherr <athurnherr@yahoo.com>
parents: 37
diff changeset
   193
	printf("\tRL_LAST_BIN\t\t\t= %d\n",			$hdr{RL_LAST_BIN})  if $opt_l;
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   194
	
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   195
	
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   196
	print("    Water-Track Setup:\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   197
	printf("\tPINGS_PER_ENSEMBLE\t\t= %d\n",	$hdr{PINGS_PER_ENSEMBLE});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   198
	printf("\tTIME_BETWEEN_PINGS\t\t= %g s\n",$hdr{TIME_BETWEEN_PINGS});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   199
	printf("\tTRANSMIT_POWER\t\t\t= %d\n",	$hdr{TRANSMIT_POWER});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   200
	printf("\tMIN_CORRELATION\t\t\t= %d\n",	$hdr{MIN_CORRELATION});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   201
	printf("\tMIN_PERCENT_GOOD\t\t= %d %%\n",	$hdr{MIN_PERCENT_GOOD});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   202
	printf("\tMAX_ERROR_VELOCITY\t\t= %g m/s\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   203
												$hdr{MAX_ERROR_VELOCITY});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   204
	printf("\tFALSE_TARGET_THRESHOLD\t\t= %d\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   205
												$hdr{FALSE_TARGET_THRESHOLD})
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   206
												if defined($hdr{FALSE_TARGET_THRESHOLD});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   207
	printf("\tFlags\t\t\t\t: ");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   208
	printf("NARROW_BANDWIDTH ") 				if ($hdr{NARROW_BANDWIDTH});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   209
	printf("WIDE_BANDWIDTH ")					if ($hdr{WIDE_BANDWIDTH});
57
5a59411306ba updated for Nortek
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 56
diff changeset
   210
	printf("TRANSMIT_POWER_MAX ")				if ($hdr{TRANSMIT_POWER_MAX});
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   211
	print("\n");
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   212
49
8f4fbdaf0102 post merge
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 48
diff changeset
   213
	#----------------------------------------------------------------------
8f4fbdaf0102 post merge
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 48
diff changeset
   214
	# BT code is never executed since BT_MODE is not set any more
8f4fbdaf0102 post merge
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 48
diff changeset
   215
	#----------------------------------------------------------------------
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   216
48
cdc74ebada81 after partial adaptation to RTI files
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 43
diff changeset
   217
	if (defined($hdr{BT_MODE})) {
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   218
		print("    Bottom-Track Setup:\n");
49
8f4fbdaf0102 post merge
Andreas Thurnherr <ant@ldeo.columbia.edu>
parents: 48
diff changeset
   219
		printf("\tBT_MODE\t\t\t\t= %d\n", 			$hdr{BT_MODE});
0
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   220
		printf("\tBT_PINGS_PER_ENSEMBLE\t\t= %d\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   221
													$hdr{BT_PINGS_PER_ENSEMBLE});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   222
		printf("\tBT_TIME_BEFORE_REACQUIRE\t= %g s\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   223
													$hdr{BT_TIME_BEFORE_REACQUIRE});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   224
		printf("\tBT_MIN_CORRELATION\t\t= %d\n",$hdr{BT_MIN_CORRELATION});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   225
		printf("\tBT_MIN_EVAL_AMPLITUDE\t\t= %d\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   226
													$hdr{BT_MIN_EVAL_AMPLITUDE});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   227
		printf("\tBT_MIN_PERCENT_GOOD\t\t= %d %%\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   228
													$hdr{BT_MIN_PERCENT_GOOD});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   229
		printf("\tBT_MAX_ERROR_VELOCITY\t\t= %g m/s\n",
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   230
													$hdr{BT_MAX_ERROR_VELOCITY})
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   231
													if defined($hdr{BT_MAX_ERROR_VELOCITY});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   232
		printf("\tBT_RL_MIN_SIZE\t\t\t= %g m\n",	$hdr{BT_RL_MIN_SIZE});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   233
		printf("\tBT_RL_NEAR\t\t\t= %g m\n",		$hdr{BT_RL_NEAR});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   234
		printf("\tBT_RL_FAR\t\t\t= %g m\n",		$hdr{BT_RL_FAR});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   235
		printf("\tBT_MAX_TRACKING_DEPTH\t\t= %g m\n"
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   236
	                                        ,       $hdr{BT_MAX_TRACKING_DEPTH});
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   237
    }
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   238
}
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   239
229a0d72d2ab first hg version
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
   240