0
|
1 |
#!/usr/bin/perl
|
|
2 |
#======================================================================
|
|
3 |
# L I S T H D R
|
|
4 |
# doc: Sat Jan 18 18:41:49 2003
|
10
|
5 |
# dlm: Mon Mar 25 19:20:19 2013
|
0
|
6 |
# (c) 2003 A.M. Thurnherr
|
10
|
7 |
# uE-Info: 79 0 NIL 0 0 72 8 2 4 NIL ofnI
|
0
|
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
|
10
|
31 |
# Mar 20, 2013: - removed DATA_FORMAT stuff
|
|
32 |
# Mar 25, 2013: - added INSTRUMENT_TYPE stuff instead
|
0
|
33 |
|
|
34 |
$0 =~ m{(.*/)[^/]+};
|
|
35 |
require "$1RDI_BB_Read.pl";
|
|
36 |
|
|
37 |
die("Usage: $0 <RDI file[...]>\n")
|
|
38 |
unless (@ARGV);
|
|
39 |
|
|
40 |
while (-f $ARGV[0]) {
|
|
41 |
print("$ARGV[0]:\n");
|
|
42 |
readHeader(@ARGV,\%hdr);
|
|
43 |
shift;
|
|
44 |
|
|
45 |
print(" Instrument Characteristics:\n");
|
|
46 |
|
10
|
47 |
if (defined($hdr{SERIAL_NUMBER})) {
|
|
48 |
printf("\tINSTRUMENT\t\t\t= %s #%d\n",$hdr{INSTRUMENT_TYPE},$hdr{SERIAL_NUMBER});
|
|
49 |
} else {
|
|
50 |
printf("\tINSTRUMENT_TYPE\t\t\t= %s\n",$hdr{INSTRUMENT_TYPE});
|
|
51 |
}
|
|
52 |
printf("\tCPU_SERIAL_NUMBER\t\t= %s\n",$hdr{CPU_SERIAL_NUMBER})
|
|
53 |
unless ($hdr{INSTRUMENT_TYPE} eq 'Explorer');
|
0
|
54 |
printf("\tFIRMWARE\t\t\t= %d.%d\n",$hdr{CPU_FW_VER},$hdr{CPU_FW_REV});
|
|
55 |
printf("\tBEAM_FREQUENCY\t\t\t= %d kHz\n",$hdr{BEAM_FREQUENCY});
|
|
56 |
printf("\tBEAM_ANGLE\t\t\t= %d deg\n",$hdr{BEAM_ANGLE});
|
|
57 |
printf("\tN_BEAMS\t\t\t\t= %d\n",$hdr{N_BEAMS});
|
|
58 |
printf("\tN_DEMODS\t\t\t= %d\n",$hdr{N_DEMODS}) if defined($hdr{N_DEMODS});
|
|
59 |
|
|
60 |
printf("\tSensors\t\t\t\t: ");
|
|
61 |
printf("PRESSURE ") if ($hdr{PRESSURE_SENSOR_AVAILABLE});
|
|
62 |
printf("CONDUCTIVITY ") if ($hdr{CONDUCTIVITY_SENSOR_AVAILABLE});
|
|
63 |
printf("TEMPERATURE ") if ($hdr{TEMPERATURE_SENSOR_AVAILABLE});
|
|
64 |
printf("COMPASS ") if ($hdr{COMPASS_AVAILABLE});
|
|
65 |
printf("PITCH ") if ($hdr{PITCH_SENSOR_AVAILABLE});
|
|
66 |
printf("ROLL ") if ($hdr{ROLL_SENSOR_AVAILABLE});
|
|
67 |
print("\n");
|
|
68 |
|
|
69 |
printf("\tFlags\t\t\t\t: ");
|
|
70 |
printf("XDUCER_HEAD_ATTACHED ") if ($hdr{XDUCER_HEAD_ATTACHED});
|
|
71 |
printf("CONVEX_BEAM_PATTERN ") if ($hdr{CONVEX_BEAM_PATTERN});
|
|
72 |
printf("CONCAVE_BEAM_PATTERN ") if ($hdr{CONCAVE_BEAM_PATTERN});
|
|
73 |
print("\n");
|
|
74 |
|
|
75 |
|
|
76 |
print(" File Format:\n");
|
|
77 |
|
|
78 |
printf("\tNUMBER_OF_DATA_TYPES\t\t= %d\n",$hdr{NUMBER_OF_DATA_TYPES});
|
10
|
79 |
printf("\tFIXED_LEADER_BYTES\t\t= %3d bytes\n",$hdr{FIXED_LEADER_BYTES});
|
0
|
80 |
printf("\tENSEMBLE_BYTES\t\t\t= %3d bytes\n",$hdr{ENSEMBLE_BYTES});
|
|
81 |
printf("\tHEADER_BYTES\t\t\t= %3d bytes\n",$hdr{HEADER_BYTES});
|
|
82 |
printf("\tVARIABLE_LEADER_BYTES\t\t= %3d bytes\n",$hdr{VARIABLE_LEADER_BYTES});
|
|
83 |
printf("\tVELOCITY_DATA_BYTES\t\t= %3d bytes\n",$hdr{VELOCITY_DATA_BYTES});
|
|
84 |
printf("\tCORRELATION_DATA_BYTES\t\t= %3d bytes\n",$hdr{CORRELATION_DATA_BYTES});
|
|
85 |
printf("\tECHO_INTENSITY_DATA_BYTES\t= %3d bytes\n",$hdr{ECHO_INTENSITY_DATA_BYTES});
|
|
86 |
printf("\tPERCENT_GOOD_DATA_BYTES\t\t= %3d bytes\n",$hdr{PERCENT_GOOD_DATA_BYTES});
|
|
87 |
printf("\tBT_DATA_BYTES\t\t\t= %3d bytes\n",$hdr{BT_DATA_BYTES})
|
|
88 |
if ($dta->{BT_PRESENT});
|
|
89 |
|
|
90 |
|
|
91 |
print(" Coordinate System:\n");
|
|
92 |
|
|
93 |
printf("\tHEADING_ALIGNMENT_CORRECTION\t\t= %g deg\n",
|
|
94 |
$hdr{HEADING_ALIGNMENT_CORRECTION})
|
|
95 |
if defined($hdr{HEADING_ALIGNMENT_CORRECTION});
|
|
96 |
printf("\tHEADING_BIAS_CORRECTION\t\t= %g deg\n",
|
|
97 |
$hdr{HEADING_BIAS_CORRECTION})
|
|
98 |
if defined($hdr{HEADING_BIAS_CORRECTION});
|
|
99 |
print("\tFlags\t\t\t\t: ");
|
|
100 |
printf("BEAM_COORDINATES ") if ($hdr{BEAM_COORDINATES});
|
|
101 |
printf("INSTRUMENT_COORDINATES ") if ($hdr{INSTRUMENT_COORDINATES});
|
|
102 |
printf("SHIP_COORDINATES ") if ($hdr{SHIP_COORDINATES});
|
|
103 |
printf("EARTH_COORDINATES ") if ($hdr{EARTH_COORDINATES});
|
|
104 |
printf("PITCH_AND_ROLL_USED ") if ($hdr{PITCH_AND_ROLL_USED});
|
|
105 |
printf("BIN_MAPPING_ALLOWED ") if ($hdr{ALLOW_BIN_MAPPING});
|
|
106 |
print("\n");
|
|
107 |
|
|
108 |
|
|
109 |
if ($hdr{SPEED_OF_SOUND_CALCULATED}) {
|
|
110 |
print(" Speed-of-Sound Sensors Used:\n");
|
|
111 |
printf("\tPRESSURE_SENSOR_USED\n") if ($hdr{PRESSURE_SENSOR_USED});
|
|
112 |
printf("\tCOMPASS_USED\n") if ($hdr{COMPASS_USED});
|
|
113 |
printf("\tPITCH_SENSOR_USED\n") if ($hdr{PITCH_SENSOR_USED});
|
|
114 |
printf("\tROLL_SENSOR_USED\n") if ($hdr{ROLL_SENSOR_USED});
|
|
115 |
printf("\tCONDUCTIVITY_SENSOR_USED\n")
|
|
116 |
if ($hdr{CONDUCTIVITY_SENSOR_USED});
|
|
117 |
printf("\tTEMPERATURE_SENSOR_USED\n")
|
|
118 |
if ($hdr{TEMPERATURE_SENSOR_USED});
|
|
119 |
print("\n");
|
|
120 |
}
|
|
121 |
|
|
122 |
|
|
123 |
print(" Bin Setup:\n");
|
|
124 |
printf("\tN_BINS\t\t\t\t= %d\n", $hdr{N_BINS});
|
|
125 |
printf("\tBLANKING_DISTANCE\t\t= %g m\n", $hdr{BLANKING_DISTANCE});
|
|
126 |
printf("\tTRANSMIT_LAG_DISTANCE\t\t= %g m\n",
|
|
127 |
$hdr{TRANSMIT_LAG_DISTANCE});
|
|
128 |
printf("\tDISTANCE_TO_BIN1_CENTER\t\t= %g m\n",
|
|
129 |
$hdr{DISTANCE_TO_BIN1_CENTER});
|
|
130 |
printf("\tBIN_LENGTH\t\t\t= %g m\n", $hdr{BIN_LENGTH});
|
|
131 |
printf("\tTRANSMITTED_PULSE_LENGTH\t= %g m\n",
|
|
132 |
$hdr{TRANSMITTED_PULSE_LENGTH});
|
|
133 |
printf("\tRL_FIRST_BIN\t\t\t= %d\n", $hdr{RL_FIRST_BIN});
|
|
134 |
printf("\tRL_LAST_BIN\t\t\t= %d\n", $hdr{RL_LAST_BIN});
|
|
135 |
|
|
136 |
|
|
137 |
print(" Water-Track Setup:\n");
|
|
138 |
printf("\tPINGS_PER_ENSEMBLE\t\t= %d\n", $hdr{PINGS_PER_ENSEMBLE});
|
|
139 |
printf("\tTIME_BETWEEN_PINGS\t\t= %g s\n",$hdr{TIME_BETWEEN_PINGS});
|
|
140 |
printf("\tTRANSMIT_POWER\t\t\t= %d\n", $hdr{TRANSMIT_POWER});
|
|
141 |
printf("\tMIN_CORRELATION\t\t\t= %d\n", $hdr{MIN_CORRELATION});
|
|
142 |
printf("\tMIN_PERCENT_GOOD\t\t= %d %%\n", $hdr{MIN_PERCENT_GOOD});
|
|
143 |
printf("\tMAX_ERROR_VELOCITY\t\t= %g m/s\n",
|
|
144 |
$hdr{MAX_ERROR_VELOCITY});
|
|
145 |
printf("\tFALSE_TARGET_THRESHOLD\t\t= %d\n",
|
|
146 |
$hdr{FALSE_TARGET_THRESHOLD})
|
|
147 |
if defined($hdr{FALSE_TARGET_THRESHOLD});
|
|
148 |
printf("\tFlags\t\t\t\t: ");
|
|
149 |
printf("NARROW_BANDWIDTH ") if ($hdr{NARROW_BANDWIDTH});
|
|
150 |
printf("WIDE_BANDWIDTH ") if ($hdr{WIDE_BANDWIDTH});
|
|
151 |
printf("TRANSMIT_POWER_HIGH ") if ($hdr{TRANSMIT_POWER_HIGH});
|
|
152 |
printf("USE_3_BEAM_ON_LOW_CORR ") if ($hdr{USE_3_BEAM_ON_LOW_CORR});
|
|
153 |
print("\n");
|
|
154 |
|
|
155 |
#----------------------------------------------------------------------
|
|
156 |
|
|
157 |
if ($hdr{NUMBER_OF_DATA_TYPES} == 7) {
|
|
158 |
print(" Bottom-Track Setup:\n");
|
|
159 |
printf("\tBT_MODE\t\t\t\t= %d\n", $hdr{BT_MODE});
|
|
160 |
printf("\tBT_PINGS_PER_ENSEMBLE\t\t= %d\n",
|
|
161 |
$hdr{BT_PINGS_PER_ENSEMBLE});
|
|
162 |
printf("\tBT_TIME_BEFORE_REACQUIRE\t= %g s\n",
|
|
163 |
$hdr{BT_TIME_BEFORE_REACQUIRE});
|
|
164 |
printf("\tBT_MIN_CORRELATION\t\t= %d\n",$hdr{BT_MIN_CORRELATION});
|
|
165 |
printf("\tBT_MIN_EVAL_AMPLITUDE\t\t= %d\n",
|
|
166 |
$hdr{BT_MIN_EVAL_AMPLITUDE});
|
|
167 |
printf("\tBT_MIN_PERCENT_GOOD\t\t= %d %%\n",
|
|
168 |
$hdr{BT_MIN_PERCENT_GOOD});
|
|
169 |
printf("\tBT_MAX_ERROR_VELOCITY\t\t= %g m/s\n",
|
|
170 |
$hdr{BT_MAX_ERROR_VELOCITY})
|
|
171 |
if defined($hdr{BT_MAX_ERROR_VELOCITY});
|
|
172 |
printf("\tBT_RL_MIN_SIZE\t\t\t= %g m\n", $hdr{BT_RL_MIN_SIZE});
|
|
173 |
printf("\tBT_RL_NEAR\t\t\t= %g m\n", $hdr{BT_RL_NEAR});
|
|
174 |
printf("\tBT_RL_FAR\t\t\t= %g m\n", $hdr{BT_RL_FAR});
|
|
175 |
printf("\tBT_MAX_TRACKING_DEPTH\t\t= %g m\n"
|
|
176 |
, $hdr{BT_MAX_TRACKING_DEPTH});
|
|
177 |
}
|
|
178 |
}
|
|
179 |
|
|
180 |
|