LADCP_w_ocean
changeset 51 0f6d9e64cc4f
parent 49 5006e9158207
child 54 828e5466391b
equal deleted inserted replaced
50:84914596c635 51:0f6d9e64cc4f
     1 #!/usr/bin/perl
     1 #!/usr/bin/perl
     2 #======================================================================
     2 #======================================================================
     3 #                    L A D C P _ W _ O C E A N 
     3 #                    L A D C P _ W _ O C E A N 
     4 #                    doc: Fri Dec 17 18:11:13 2010
     4 #                    doc: Fri Dec 17 18:11:13 2010
     5 #                    dlm: Tue Nov 27 14:04:39 2018
     5 #                    dlm: Sun Apr 21 14:16:03 2019
     6 #                    (c) 2010 A.M. Thurnherr
     6 #                    (c) 2010 A.M. Thurnherr
     7 #                    uE-Info: 282 15 NIL 0 0 72 2 2 4 NIL ofnI
     7 #                    uE-Info: 298 81 NIL 0 0 72 2 2 4 NIL ofnI
     8 #======================================================================
     8 #======================================================================
     9 
     9 
    10 # TODO:
    10 # TODO:
    11 #   ! use instrument tilt in sidelobe editing
    11 #   ! use instrument tilt in sidelobe editing
    12 #	- use instrument tilt in e.g. calculation of Sv
    12 #	- use instrument tilt in e.g. calculation of Sv
   291 #	May  2, 2018: - BUG: ref-lr threshold did not work
   291 #	May  2, 2018: - BUG: ref-lr threshold did not work
   292 #				  - BUG: BT code was called for UL when -h was used
   292 #				  - BUG: BT code was called for UL when -h was used
   293 #				  - replaced $PPI_seabed_editing_required by &PPI_seabed_editing_required
   293 #				  - replaced $PPI_seabed_editing_required by &PPI_seabed_editing_required
   294 #				  - BUG: surface PPI editing code could not be enabled; added &PPI_surface_editing_required
   294 #				  - BUG: surface PPI editing code could not be enabled; added &PPI_surface_editing_required
   295 #	Nov  2, 2018: - BUG: for 3-beam solutions, residual{12,34} with affected beam was wrong
   295 #	Nov  2, 2018: - BUG: for 3-beam solutions, residual{12,34} with affected beam was wrong
       
   296 #	Apr 12, 2019: - added logfile error message for non-existing file
       
   297 #	Apr 18, 2019: - added addtional RDI coordinate transformation %PARAMs
       
   298 #	Apr 21, 2019: - BUG: removed duplicate warning about lacking water-depth info
   296 # HISTORY END
   299 # HISTORY END
   297 
   300 
   298 # CTD REQUIREMENTS
   301 # CTD REQUIREMENTS
   299 #	- elapsed		elapsed seconds; see note below
   302 #	- elapsed		elapsed seconds; see note below
   300 #	- depth
   303 #	- depth
   573 #	- high bandwidth
   576 #	- high bandwidth
   574 #	- low transmit power
   577 #	- low transmit power
   575 #---------------------------
   578 #---------------------------
   576 
   579 
   577 progress("Reading LADCP data from <$LADCP_file>...\n");
   580 progress("Reading LADCP data from <$LADCP_file>...\n");
       
   581 error("cannot open <$LADCP_file> for reading\n")
       
   582 	unless (-r $LADCP_file);
   578 readData($LADCP_file,\%LADCP);
   583 readData($LADCP_file,\%LADCP);
   579 &antsAddDeps($LADCP_file);
   584 &antsAddDeps($LADCP_file);
   580 if ($LADCP{BEAM_COORDINATES}) {
   585 if ($LADCP{BEAM_COORDINATES}) {
   581 	progress("\t%d ensembles (beam coordinates)\n",scalar(@{$LADCP{ENSEMBLE}}));
   586 	progress("\t%d ensembles (beam coordinates)\n",scalar(@{$LADCP{ENSEMBLE}}));
   582 } else {
   587 } else {
   723         }
   728         }
   724     }
   729     }
   725 	$RDI_Coords::binMapping = 'none';
   730 	$RDI_Coords::binMapping = 'none';
   726 }
   731 }
   727 
   732 
   728 &antsAddParams('RDI_Coords::binMapping',$RDI_Coords::binMapping);		# finally, bin mapping is known
   733 &antsAddParams('RDI_Coords::binMapping', 	    $RDI_Coords::binMapping,		# finally, bin mapping is known
       
   734 			   'RDI_Coords::minValidVels',      $RDI_Coords::minValidVels,
       
   735 			   'RDI_Coords::beamTransformation',$RDI_Coords::beamTransformation);
       
   736 
   729 
   737 
   730 #-------------------------------------------------------------------
   738 #-------------------------------------------------------------------
   731 # Calculate earth velocities
   739 # Calculate earth velocities
   732 #	- this is done for all bins (not just valid ones), to allow
   740 #	- this is done for all bins (not just valid ones), to allow
   733 #	  useless possibility that invalid bins are used for reflr calcs
   741 #	  useless possibility that invalid bins are used for reflr calcs
  1361 		if (defined($water_depth)) {
  1369 		if (defined($water_depth)) {
  1362 			progress("Editing data to remove sidelobe interference from seabed...\n");
  1370 			progress("Editing data to remove sidelobe interference from seabed...\n");
  1363 			($nvrm,$nerm) = editSideLobes($firstGoodEns,$lastGoodEns,$water_depth);
  1371 			($nvrm,$nerm) = editSideLobes($firstGoodEns,$lastGoodEns,$water_depth);
  1364         	progress("\t$nvrm velocities from $nerm ensembles removed\n");
  1372         	progress("\t$nvrm velocities from $nerm ensembles removed\n");
  1365         } else {
  1373         } else {
  1366 			warning(2,"unknown water depth --- cannot edit UL data for sidelobe interference from seabed\n");
  1374 #			WARNING ALREADY PRODUCED ABOVE
       
  1375 #			warning(2,"unknown water depth --- cannot edit UL data for sidelobe interference from seabed\n");
  1367         }
  1376         }
  1368         &antsAddParams('sidelobe_editing','surface+seabed','vessel_draft',$vessel_draft);
  1377         &antsAddParams('sidelobe_editing','surface+seabed','vessel_draft',$vessel_draft);
  1369     } else {
  1378     } else {
  1370         &antsAddParams('sidelobe_editing','surface','vessel_draft',$vessel_draft);
  1379         &antsAddParams('sidelobe_editing','surface','vessel_draft',$vessel_draft);
  1371     } 
  1380     }