mkProfile
changeset 47 494a76548e94
parent 43 b63fa355644c
child 58 78607e2e8add
equal deleted inserted replaced
46:777cd0f2456a 47:494a76548e94
     1 #!/usr/bin/perl
     1 #!/usr/bin/perl
     2 #======================================================================
     2 #======================================================================
     3 #                    M K P R O F I L E 
     3 #                    M K P R O F I L E 
     4 #                    doc: Sun Jan 19 18:55:26 2003
     4 #                    doc: Sun Jan 19 18:55:26 2003
     5 #                    dlm: Tue May  1 10:12:56 2018
     5 #                    dlm: Thu Apr 18 16:28:13 2019
     6 #                    (c) 2003 A.M. Thurnherr
     6 #                    (c) 2003 A.M. Thurnherr
     7 #                    uE-Info: 395 0 NIL 0 0 72 0 2 4 NIL ofnI
     7 #                    uE-Info: 98 54 NIL 0 0 72 0 2 4 NIL ofnI
     8 #======================================================================
     8 #======================================================================
     9 
     9 
    10 # Make an LADCP Profile by Integrating W (similar to Firing's scan*).
    10 # Make an LADCP Profile by Integrating W (similar to Firing's scan*).
    11 
    11 
    12 # HISTORY:
    12 # HISTORY:
    93 #				  - removed warning
    93 #				  - removed warning
    94 #	Sep 12, 2016: - added %PD0_file
    94 #	Sep 12, 2016: - added %PD0_file
    95 #	Oct 13, 2017: - added instrument orientation
    95 #	Oct 13, 2017: - added instrument orientation
    96 #	Apr  2, 2018: - BUG: velBeamToInstrument() used old usage
    96 #	Apr  2, 2018: - BUG: velBeamToInstrument() used old usage
    97 #	Apr 24, 2018: - BUG: bin1 was used even with zero blanking
    97 #	Apr 24, 2018: - BUG: bin1 was used even with zero blanking
       
    98 #	Apr 18, 2019: - added coord-transformation %PARAMs
    98 
    99 
    99 # NOTES:
   100 # NOTES:
   100 #	- the battery values are based on transmission voltages (different
   101 #	- the battery values are based on transmission voltages (different
   101 #	  from battery voltages) and reported without units (raw 8-bit a2d
   102 #	  from battery voltages) and reported without units (raw 8-bit a2d
   102 #	  values)
   103 #	  values)
   720 print("#ANTS#FIELDS# {ens} {time} {elapsed} {secno} {downcast} " .
   721 print("#ANTS#FIELDS# {ens} {time} {elapsed} {secno} {downcast} " .
   721 					"{w} {w_err} {err_vel} {depth} {depth_err} {seabed} " .
   722 					"{w} {w_err} {err_vel} {depth} {depth_err} {seabed} " .
   722 					"{pitch} {roll} {tilt} {hdg} {rotation} " .
   723 					"{pitch} {roll} {tilt} {hdg} {rotation} " .
   723 					"$uFields $addFields\n");
   724 					"$uFields $addFields\n");
   724 
   725 
   725 printf("#ANTS#PARAMS# date{$dta{ENSEMBLE}[$firstgood]->{DATE}} " .
   726 printf(     "#ANTS#PARAMS# date{$dta{ENSEMBLE}[$firstgood]->{DATE}} " .
   726 			   "start_time{$dta{ENSEMBLE}[$firstgood]->{TIME}} " .
   727 			        "start_time{$dta{ENSEMBLE}[$firstgood]->{TIME}} " .
   727 			  "bottom_time{$dta{ENSEMBLE}[$atbottom]->{TIME}} " .
   728 			       "bottom_time{$dta{ENSEMBLE}[$atbottom]->{TIME}} " .
   728 				 "end_time{$dta{ENSEMBLE}[$lastgood]->{TIME}} " .
   729 		   		      "end_time{$dta{ENSEMBLE}[$lastgood]->{TIME}} " .
   729 	  "bottom_xmit_voltage{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_VOLTAGE}} " .
   730 	       "bottom_xmit_voltage{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_VOLTAGE}} " .
   730 	  "bottom_xmit_current{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_CURRENT}} " .
   731 	       "bottom_xmit_current{$dta{ENSEMBLE}[$atbottom]->{ADC_XMIT_CURRENT}} " .
   731 				 "PD0_file{$ARGV[0]} " .
   732 	    			  "PD0_file{$ARGV[0]} " .
   732 		 "pinging_duration{%.1f} " .
   733       "RDI_Coords::minValidVels{$RDI_Coords::minValidVels} " .
   733 			"cast_duration{%.1f} " .
   734         "RDI_Coords::binMapping{$RDI_Coords::binMapping} " .
   734 		   "0.8_valid_bins{%.1f} " .
   735 "RDI_Coords::beamTransformation{$RDI_Coords::beamTransformation} " .
   735 		  "0.8_valid_range{%.1f} " .
   736 			  "pinging_duration{%.1f} " .
   736 				"max_depth{%.1f} " .
   737 				 "cast_duration{%.1f} " .
   737 			  "depth_error{%.1f} " .
   738 				"0.8_valid_bins{%.1f} " .
   738 				  "min_range{%d} " .
   739 			   "0.8_valid_range{%.1f} " .
   739 				"n_ensembles{%d} " .
   740 					 "max_depth{%.1f} " .
   740                  "w_gap_time{%d} " .
   741 				   "depth_error{%.1f} " .
   741 				 "stderr_w{%.4f} " .
   742 				     "min_range{%d} " .
   742 				 "rms_tilt{%.1f} " .
   743 				   "n_ensembles{%d} " .
   743 		"downcast_rms_tilt{%.1f} " .
   744 				    "w_gap_time{%d} " .
   744           "upcast_rms_tilt{%.1f} " .
   745 					  "stderr_w{%.4f} " .
   745 			 "rms_rotation{%.2f} " .
   746 					  "rms_tilt{%.1f} " .
   746 	   "deployment_rotations{%d} " .
   747 			 "downcast_rms_tilt{%.1f} " .
   747 		 "downcast_rotations{%d} " .
   748 			   "upcast_rms_tilt{%.1f} " .
   748 		   "upcast_rotations{%d} " .
   749 				  "rms_rotation{%.2f} " .
   749          "recovery_rotations{%d} " .
   750    		  "deployment_rotations{%d} " .
   750    "rms_heave_acceleration{%.2f} " .
   751 		    "downcast_rotations{%d} " .
   751 				"bin1_dist{%.1f} " .
   752 		   	  "upcast_rotations{%d} " .
   752 			   "bin_length{%.1f} " .
   753 			"recovery_rotations{%d} " .
       
   754 		"rms_heave_acceleration{%.2f} " .
       
   755 					 "bin1_dist{%.1f} " .
       
   756                     "bin_length{%.1f} " .
   753 					 "\n",
   757 					 "\n",
   754 			($dta{ENSEMBLE}[$#{$dta{ENSEMBLE}}]->{UNIX_TIME} -
   758 			($dta{ENSEMBLE}[$#{$dta{ENSEMBLE}}]->{UNIX_TIME} -
   755 					$dta{ENSEMBLE}[0]->{UNIX_TIME}),
   759 					$dta{ENSEMBLE}[0]->{UNIX_TIME}),
   756 			$dta{ENSEMBLE}[$lastgood]->{ELAPSED_TIME},
   760 			$dta{ENSEMBLE}[$lastgood]->{ELAPSED_TIME},
   757 			$gb+1,
   761 			$gb+1,