|
1 #!/usr/bin/perl |
|
2 #====================================================================== |
|
3 # L I S T H D R |
|
4 # doc: Sat Jan 18 18:41:49 2003 |
|
5 # dlm: Wed Jul 9 13:30:35 2008 |
|
6 # (c) 2003 A.M. Thurnherr |
|
7 # uE-Info: 66 0 NIL 0 0 72 8 2 4 NIL ofnI |
|
8 #====================================================================== |
|
9 |
|
10 # Print useful info from the RDI BB header |
|
11 |
|
12 # HISTORY: |
|
13 # Jan 18, 2003: - incepted as a test for [WorkhorseBinRead.pl] |
|
14 # Jan 19, 2003: - continued |
|
15 # Feb 14, 2003: - added BT setup params |
|
16 # Mar 15, 2003: - added and removed BATTERY |
|
17 # Feb 24, 2004: - corrected TRANSMIT_LAG_DISTANCE units |
|
18 # Feb 26, 2004: - added ENSEMBLE_LENGTH |
|
19 # - added FIRMWARE |
|
20 # Mar 4, 2004: - added transducer orientation |
|
21 # Mar 30, 2004: - decified firmware output |
|
22 # Sep 14, 2005: - made BT data optional, dep. on NUMBER_OF_DATA_TYPES |
|
23 # - added DATA_FORMAT & related |
|
24 # Sep 15, 2005: - change BinRead library name |
|
25 # - compacted output format |
|
26 # Oct 30, 2005: - shuffled stuff, added DATA_FORMAT_VARIANT |
|
27 # Aug 21, 2006: - added CPU_SERIAL_NUMBER |
|
28 # - added usage error |
|
29 # Sep 19, 2007: - adapted to new [RDI_BB_Read.pl] (not tested) |
|
30 # Jul 9, 2008: - added output regarding available sensors |
|
31 |
|
32 $0 =~ m{(.*/)[^/]+}; |
|
33 require "$1RDI_BB_Read.pl"; |
|
34 |
|
35 die("Usage: $0 <RDI file[...]>\n") |
|
36 unless (@ARGV); |
|
37 |
|
38 while (-f $ARGV[0]) { |
|
39 print("$ARGV[0]:\n"); |
|
40 readHeader(@ARGV,\%hdr); |
|
41 shift; |
|
42 |
|
43 print(" Instrument Characteristics:\n"); |
|
44 |
|
45 printf("\tCPU_SERIAL_NUMBER\t\t= %s\n",$hdr{CPU_SERIAL_NUMBER}); |
|
46 printf("\tFIRMWARE\t\t\t= %d.%d\n",$hdr{CPU_FW_VER},$hdr{CPU_FW_REV}); |
|
47 printf("\tBEAM_FREQUENCY\t\t\t= %d kHz\n",$hdr{BEAM_FREQUENCY}); |
|
48 printf("\tBEAM_ANGLE\t\t\t= %d deg\n",$hdr{BEAM_ANGLE}); |
|
49 printf("\tN_BEAMS\t\t\t\t= %d\n",$hdr{N_BEAMS}); |
|
50 printf("\tN_DEMODS\t\t\t= %d\n",$hdr{N_DEMODS}) if defined($hdr{N_DEMODS}); |
|
51 |
|
52 printf("\tSensors\t\t\t\t: "); |
|
53 printf("PRESSURE ") if ($hdr{PRESSURE_SENSOR_AVAILABLE}); |
|
54 printf("CONDUCTIVITY ") if ($hdr{CONDUCTIVITY_SENSOR_AVAILABLE}); |
|
55 printf("TEMPERATURE ") if ($hdr{TEMPERATURE_SENSOR_AVAILABLE}); |
|
56 printf("COMPASS ") if ($hdr{COMPASS_AVAILABLE}); |
|
57 printf("PITCH ") if ($hdr{PITCH_SENSOR_AVAILABLE}); |
|
58 printf("ROLL ") if ($hdr{ROLL_SENSOR_AVAILABLE}); |
|
59 print("\n"); |
|
60 |
|
61 printf("\tFlags\t\t\t\t: "); |
|
62 printf("XDUCER_HEAD_ATTACHED ") if ($hdr{XDUCER_HEAD_ATTACHED}); |
|
63 printf("CONVEX_BEAM_PATTERN ") if ($hdr{CONVEX_BEAM_PATTERN}); |
|
64 printf("CONCAVE_BEAM_PATTERN ") if ($hdr{CONCAVE_BEAM_PATTERN}); |
|
65 print("\n"); |
|
66 |
|
67 |
|
68 print(" File Format:\n"); |
|
69 |
|
70 printf("\tDATA_FORMAT\t\t\t= %s (variant %d)\n", |
|
71 $hdr{DATA_FORMAT},$hdr{DATA_FORMAT_VARIANT}); |
|
72 printf("\tNUMBER_OF_DATA_TYPES\t\t= %d\n",$hdr{NUMBER_OF_DATA_TYPES}); |
|
73 printf("\tENSEMBLE_BYTES\t\t\t= %3d bytes\n",$hdr{ENSEMBLE_BYTES}); |
|
74 printf("\tHEADER_BYTES\t\t\t= %3d bytes\n",$hdr{HEADER_BYTES}); |
|
75 printf("\tFIXED_LEADER_BYTES\t\t= %3d bytes\n",$hdr{FIXED_LEADER_BYTES}); |
|
76 printf("\tVARIABLE_LEADER_BYTES\t\t= %3d bytes\n",$hdr{VARIABLE_LEADER_BYTES}); |
|
77 printf("\tVELOCITY_DATA_BYTES\t\t= %3d bytes\n",$hdr{VELOCITY_DATA_BYTES}); |
|
78 printf("\tCORRELATION_DATA_BYTES\t\t= %3d bytes\n",$hdr{CORRELATION_DATA_BYTES}); |
|
79 printf("\tECHO_INTENSITY_DATA_BYTES\t= %3d bytes\n",$hdr{ECHO_INTENSITY_DATA_BYTES}); |
|
80 printf("\tPERCENT_GOOD_DATA_BYTES\t\t= %3d bytes\n",$hdr{PERCENT_GOOD_DATA_BYTES}); |
|
81 printf("\tBT_DATA_BYTES\t\t\t= %3d bytes\n",$hdr{BT_DATA_BYTES}) |
|
82 if ($dta->{BT_PRESENT}); |
|
83 |
|
84 |
|
85 print(" Coordinate System:\n"); |
|
86 |
|
87 printf("\tHEADING_ALIGNMENT_CORRECTION\t\t= %g deg\n", |
|
88 $hdr{HEADING_ALIGNMENT_CORRECTION}) |
|
89 if defined($hdr{HEADING_ALIGNMENT_CORRECTION}); |
|
90 printf("\tHEADING_BIAS_CORRECTION\t\t= %g deg\n", |
|
91 $hdr{HEADING_BIAS_CORRECTION}) |
|
92 if defined($hdr{HEADING_BIAS_CORRECTION}); |
|
93 print("\tFlags\t\t\t\t: "); |
|
94 printf("BEAM_COORDINATES ") if ($hdr{BEAM_COORDINATES}); |
|
95 printf("INSTRUMENT_COORDINATES ") if ($hdr{INSTRUMENT_COORDINATES}); |
|
96 printf("SHIP_COORDINATES ") if ($hdr{SHIP_COORDINATES}); |
|
97 printf("EARTH_COORDINATES ") if ($hdr{EARTH_COORDINATES}); |
|
98 printf("PITCH_AND_ROLL_USED ") if ($hdr{PITCH_AND_ROLL_USED}); |
|
99 printf("BIN_MAPPING_ALLOWED ") if ($hdr{ALLOW_BIN_MAPPING}); |
|
100 print("\n"); |
|
101 |
|
102 |
|
103 if ($hdr{SPEED_OF_SOUND_CALCULATED}) { |
|
104 print(" Speed-of-Sound Sensors Used:\n"); |
|
105 printf("\tPRESSURE_SENSOR_USED\n") if ($hdr{PRESSURE_SENSOR_USED}); |
|
106 printf("\tCOMPASS_USED\n") if ($hdr{COMPASS_USED}); |
|
107 printf("\tPITCH_SENSOR_USED\n") if ($hdr{PITCH_SENSOR_USED}); |
|
108 printf("\tROLL_SENSOR_USED\n") if ($hdr{ROLL_SENSOR_USED}); |
|
109 printf("\tCONDUCTIVITY_SENSOR_USED\n") |
|
110 if ($hdr{CONDUCTIVITY_SENSOR_USED}); |
|
111 printf("\tTEMPERATURE_SENSOR_USED\n") |
|
112 if ($hdr{TEMPERATURE_SENSOR_USED}); |
|
113 print("\n"); |
|
114 } |
|
115 |
|
116 |
|
117 print(" Bin Setup:\n"); |
|
118 printf("\tN_BINS\t\t\t\t= %d\n", $hdr{N_BINS}); |
|
119 printf("\tBLANKING_DISTANCE\t\t= %g m\n", $hdr{BLANKING_DISTANCE}); |
|
120 printf("\tTRANSMIT_LAG_DISTANCE\t\t= %g m\n", |
|
121 $hdr{TRANSMIT_LAG_DISTANCE}); |
|
122 printf("\tDISTANCE_TO_BIN1_CENTER\t\t= %g m\n", |
|
123 $hdr{DISTANCE_TO_BIN1_CENTER}); |
|
124 printf("\tBIN_LENGTH\t\t\t= %g m\n", $hdr{BIN_LENGTH}); |
|
125 printf("\tTRANSMITTED_PULSE_LENGTH\t= %g m\n", |
|
126 $hdr{TRANSMITTED_PULSE_LENGTH}); |
|
127 printf("\tRL_FIRST_BIN\t\t\t= %d\n", $hdr{RL_FIRST_BIN}); |
|
128 printf("\tRL_LAST_BIN\t\t\t= %d\n", $hdr{RL_LAST_BIN}); |
|
129 |
|
130 |
|
131 print(" Water-Track Setup:\n"); |
|
132 printf("\tPINGS_PER_ENSEMBLE\t\t= %d\n", $hdr{PINGS_PER_ENSEMBLE}); |
|
133 printf("\tTIME_BETWEEN_PINGS\t\t= %g s\n",$hdr{TIME_BETWEEN_PINGS}); |
|
134 printf("\tTRANSMIT_POWER\t\t\t= %d\n", $hdr{TRANSMIT_POWER}); |
|
135 printf("\tMIN_CORRELATION\t\t\t= %d\n", $hdr{MIN_CORRELATION}); |
|
136 printf("\tMIN_PERCENT_GOOD\t\t= %d %%\n", $hdr{MIN_PERCENT_GOOD}); |
|
137 printf("\tMAX_ERROR_VELOCITY\t\t= %g m/s\n", |
|
138 $hdr{MAX_ERROR_VELOCITY}); |
|
139 printf("\tFALSE_TARGET_THRESHOLD\t\t= %d\n", |
|
140 $hdr{FALSE_TARGET_THRESHOLD}) |
|
141 if defined($hdr{FALSE_TARGET_THRESHOLD}); |
|
142 printf("\tFlags\t\t\t\t: "); |
|
143 printf("NARROW_BANDWIDTH ") if ($hdr{NARROW_BANDWIDTH}); |
|
144 printf("WIDE_BANDWIDTH ") if ($hdr{WIDE_BANDWIDTH}); |
|
145 printf("TRANSMIT_POWER_HIGH ") if ($hdr{TRANSMIT_POWER_HIGH}); |
|
146 printf("USE_3_BEAM_ON_LOW_CORR ") if ($hdr{USE_3_BEAM_ON_LOW_CORR}); |
|
147 print("\n"); |
|
148 |
|
149 #---------------------------------------------------------------------- |
|
150 |
|
151 if ($hdr{NUMBER_OF_DATA_TYPES} == 7) { |
|
152 print(" Bottom-Track Setup:\n"); |
|
153 printf("\tBT_MODE\t\t\t\t= %d\n", $hdr{BT_MODE}); |
|
154 printf("\tBT_PINGS_PER_ENSEMBLE\t\t= %d\n", |
|
155 $hdr{BT_PINGS_PER_ENSEMBLE}); |
|
156 printf("\tBT_TIME_BEFORE_REACQUIRE\t= %g s\n", |
|
157 $hdr{BT_TIME_BEFORE_REACQUIRE}); |
|
158 printf("\tBT_MIN_CORRELATION\t\t= %d\n",$hdr{BT_MIN_CORRELATION}); |
|
159 printf("\tBT_MIN_EVAL_AMPLITUDE\t\t= %d\n", |
|
160 $hdr{BT_MIN_EVAL_AMPLITUDE}); |
|
161 printf("\tBT_MIN_PERCENT_GOOD\t\t= %d %%\n", |
|
162 $hdr{BT_MIN_PERCENT_GOOD}); |
|
163 printf("\tBT_MAX_ERROR_VELOCITY\t\t= %g m/s\n", |
|
164 $hdr{BT_MAX_ERROR_VELOCITY}) |
|
165 if defined($hdr{BT_MAX_ERROR_VELOCITY}); |
|
166 printf("\tBT_RL_MIN_SIZE\t\t\t= %g m\n", $hdr{BT_RL_MIN_SIZE}); |
|
167 printf("\tBT_RL_NEAR\t\t\t= %g m\n", $hdr{BT_RL_NEAR}); |
|
168 printf("\tBT_RL_FAR\t\t\t= %g m\n", $hdr{BT_RL_FAR}); |
|
169 printf("\tBT_MAX_TRACKING_DEPTH\t\t= %g m\n" |
|
170 , $hdr{BT_MAX_TRACKING_DEPTH}); |
|
171 } |
|
172 } |
|
173 |
|
174 |