before adapting to read RTI PD0 files
authorA.M. Thurnherr <athurnherr@yahoo.com>
Thu, 13 Jun 2019 20:31:30 -0400
changeset 47 494a76548e94
parent 46 777cd0f2456a
child 49 8f4fbdaf0102
before adapting to read RTI PD0 files
RDI_PD0_IO.pl
RDI_Utils.pl
mkProfile
--- a/RDI_PD0_IO.pl
+++ b/RDI_PD0_IO.pl
@@ -1,9 +1,9 @@
 #======================================================================
 #                    R D I _ P D 0 _ I O . P L 
 #                    doc: Sat Jan 18 14:54:43 2003
-#                    dlm: Tue Jun 12 19:10:08 2018
+#                    dlm: Mon Apr  8 09:19:53 2019
 #                    (c) 2003 A.M. Thurnherr
-#					 uE-Info: 115 72 NIL 0 0 72 2 2 4 NIL ofnI
+#					 uE-Info: 412 1 NIL 0 0 72 2 2 4 NIL ofnI
 #======================================================================
 	
 # Read RDI PD0 binary data files (*.[0-9][0-9][0-9])
--- a/RDI_Utils.pl
+++ b/RDI_Utils.pl
@@ -1,9 +1,9 @@
 #======================================================================
 #                    R D I _ U T I L S . P L 
 #                    doc: Wed Feb 12 10:21:32 2003
-#                    dlm: Sat Jun  9 12:11:01 2018
+#                    dlm: Thu Jun 13 11:37:30 2019
 #                    (c) 2003 A.M. Thurnherr
-#                    uE-Info: 61 58 NIL 0 0 72 2 2 4 NIL ofnI
+#                    uE-Info: 274 16 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # miscellaneous RDI-specific utilities
@@ -271,6 +271,7 @@
 sub ambiguity_velocity($$$$)
 {
 	my($xd_freq,$beam_angle,$speed_of_sound,$TL_distance) = @_;
+	return 'nan' unless ($TL_distance > 0);
 	my($lambda) = $speed_of_sound / (1000*$xd_freq);
 	my($D) = $speed_of_sound * cos(rad($beam_angle)) / 2;
 	return $lambda * $D / (4 * $TL_distance);
--- a/mkProfile
+++ b/mkProfile
@@ -2,9 +2,9 @@
 #======================================================================
 #                    M K P R O F I L E 
 #                    doc: Sun Jan 19 18:55:26 2003
-#                    dlm: Tue May  1 10:12:56 2018
+#                    dlm: Thu Apr 18 16:28:13 2019
 #                    (c) 2003 A.M. Thurnherr
-#                    uE-Info: 395 0 NIL 0 0 72 0 2 4 NIL ofnI
+#                    uE-Info: 98 54 NIL 0 0 72 0 2 4 NIL ofnI
 #======================================================================
 
 # Make an LADCP Profile by Integrating W (similar to Firing's scan*).
@@ -95,6 +95,7 @@
 #	Oct 13, 2017: - added instrument orientation
 #	Apr  2, 2018: - BUG: velBeamToInstrument() used old usage
 #	Apr 24, 2018: - BUG: bin1 was used even with zero blanking
+#	Apr 18, 2019: - added coord-transformation %PARAMs
 
 # NOTES:
 #	- the battery values are based on transmission voltages (different
@@ -722,34 +723,37 @@
 					"{pitch} {roll} {tilt} {hdg} {rotation} " .
 					"$uFields $addFields\n");
 
-printf("#ANTS#PARAMS# date{$dta{ENSEMBLE}[$firstgood]->{DATE}} " .
-			   "start_time{$dta{ENSEMBLE}[$firstgood]->{TIME}} " .
-			  "bottom_time{$dta{ENSEMBLE}[$atbottom]->{TIME}} " .
-				 "end_time{$dta{ENSEMBLE}[$lastgood]->{TIME}} " .
-	  "bottom_xmit_voltage{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_VOLTAGE}} " .
-	  "bottom_xmit_current{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_CURRENT}} " .
-				 "PD0_file{$ARGV[0]} " .
-		 "pinging_duration{%.1f} " .
-			"cast_duration{%.1f} " .
-		   "0.8_valid_bins{%.1f} " .
-		  "0.8_valid_range{%.1f} " .
-				"max_depth{%.1f} " .
-			  "depth_error{%.1f} " .
-				  "min_range{%d} " .
-				"n_ensembles{%d} " .
-                 "w_gap_time{%d} " .
-				 "stderr_w{%.4f} " .
-				 "rms_tilt{%.1f} " .
-		"downcast_rms_tilt{%.1f} " .
-          "upcast_rms_tilt{%.1f} " .
-			 "rms_rotation{%.2f} " .
-	   "deployment_rotations{%d} " .
-		 "downcast_rotations{%d} " .
-		   "upcast_rotations{%d} " .
-         "recovery_rotations{%d} " .
-   "rms_heave_acceleration{%.2f} " .
-				"bin1_dist{%.1f} " .
-			   "bin_length{%.1f} " .
+printf(     "#ANTS#PARAMS# date{$dta{ENSEMBLE}[$firstgood]->{DATE}} " .
+			        "start_time{$dta{ENSEMBLE}[$firstgood]->{TIME}} " .
+			       "bottom_time{$dta{ENSEMBLE}[$atbottom]->{TIME}} " .
+		   		      "end_time{$dta{ENSEMBLE}[$lastgood]->{TIME}} " .
+	       "bottom_xmit_voltage{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_VOLTAGE}} " .
+	       "bottom_xmit_current{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_CURRENT}} " .
+	    			  "PD0_file{$ARGV[0]} " .
+      "RDI_Coords::minValidVels{$RDI_Coords::minValidVels} " .
+        "RDI_Coords::binMapping{$RDI_Coords::binMapping} " .
+"RDI_Coords::beamTransformation{$RDI_Coords::beamTransformation} " .
+			  "pinging_duration{%.1f} " .
+				 "cast_duration{%.1f} " .
+				"0.8_valid_bins{%.1f} " .
+			   "0.8_valid_range{%.1f} " .
+					 "max_depth{%.1f} " .
+				   "depth_error{%.1f} " .
+				     "min_range{%d} " .
+				   "n_ensembles{%d} " .
+				    "w_gap_time{%d} " .
+					  "stderr_w{%.4f} " .
+					  "rms_tilt{%.1f} " .
+			 "downcast_rms_tilt{%.1f} " .
+			   "upcast_rms_tilt{%.1f} " .
+				  "rms_rotation{%.2f} " .
+   		  "deployment_rotations{%d} " .
+		    "downcast_rotations{%d} " .
+		   	  "upcast_rotations{%d} " .
+			"recovery_rotations{%d} " .
+		"rms_heave_acceleration{%.2f} " .
+					 "bin1_dist{%.1f} " .
+                    "bin_length{%.1f} " .
 					 "\n",
 			($dta{ENSEMBLE}[$#{$dta{ENSEMBLE}}]->{UNIX_TIME} -
 					$dta{ENSEMBLE}[0]->{UNIX_TIME}),