edit_data.pl
changeset 56 8f120b9f795a
parent 55 2d8e1139acd5
child 57 69e39fcb7f41
equal deleted inserted replaced
55:2d8e1139acd5 56:8f120b9f795a
     1 #======================================================================
     1 #======================================================================
     2 #                    E D I T _ D A T A . P L 
     2 #                    E D I T _ D A T A . P L 
     3 #                    doc: Sat May 22 21:35:55 2010
     3 #                    doc: Sat May 22 21:35:55 2010
     4 #                    dlm: Tue Mar 23 05:29:53 2021
     4 #                    dlm: Fri Jul  9 13:41:36 2021
     5 #                    (c) 2010 A.M. Thurnherr
     5 #                    (c) 2010 A.M. Thurnherr
     6 #                    uE-Info: 409 100 NIL 0 0 72 0 2 4 NIL ofnI
     6 #                    uE-Info: 597 63 NIL 0 0 72 0 2 4 NIL ofnI
     7 #======================================================================
     7 #======================================================================
     8 
     8 
     9 # HISTORY:
     9 # HISTORY:
    10 #	May 22, 2010: - created
    10 #	May 22, 2010: - created
    11 #	May 24, 2010: - added editSideLobesFromSeabed()
    11 #	May 24, 2010: - added editSideLobesFromSeabed()
    43 #	Jun  6, 2016: - removed applyTiltCorrection()
    43 #	Jun  6, 2016: - removed applyTiltCorrection()
    44 #	Oct 13, 2017: - BUG: editPPI() only allowed for nominal transducer frequencies
    44 #	Oct 13, 2017: - BUG: editPPI() only allowed for nominal transducer frequencies
    45 #	May  1, 2018: - added editLargeHSpeeds()
    45 #	May  1, 2018: - added editLargeHSpeeds()
    46 #	Nov 17, 2018: - BUG: spurious letter "z" had crept in at some stage
    46 #	Nov 17, 2018: - BUG: spurious letter "z" had crept in at some stage
    47 #	Mar 23, 2021: - updated PPI doc
    47 #	Mar 23, 2021: - updated PPI doc
       
    48 #	Jul  9, 2021: - added editHighResidualLayers()
    48 # END OF HISTORY
    49 # END OF HISTORY
    49 
    50 
    50 # NOTES:
    51 # NOTES:
    51 #	- all bins must be edited (not just the ones between $LADCP_firstBin
    52 #	- all bins must be edited (not just the ones between $LADCP_firstBin
    52 #	  and $LADCP_lastBin to allow reflr calculations to use bins outside
    53 #	  and $LADCP_lastBin to allow reflr calculations to use bins outside
   569 	}
   570 	}
   570     return $nerm;
   571     return $nerm;
   571 }
   572 }
   572 
   573 
   573 #======================================================================
   574 #======================================================================
       
   575 # $nbrm = editHighResidualLayers($max_lr_res)
       
   576 #	- filter applied after gridding
       
   577 #	- filter based on observation that profiles of beam-pair residuals
       
   578 #	  are good indicators of bad data, but very noisy
       
   579 #	- current version uses estimates in 5-bin-thick layers (200m by
       
   580 #	  default) 
       
   581 #	- filter cutoff based on 2021 A20 cruise which crossed region with
       
   582 #	  very weak backscatter
       
   583 #======================================================================
       
   584 
       
   585 sub editHighResidualLayers($)
       
   586 {
       
   587 	my($limit) = @_;
       
   588 
       
   589 	my($nbrm) = 0;
       
   590 	for (my($bi)=0; $bi<=$#{$DNCAST{LR_RMS_BP_RESIDUAL}}; $bi++) {
       
   591 		next unless ($DNCAST{LR_RMS_BP_RESIDUAL}[$bi] > $limit);
       
   592 		$DNCAST{MEDIAN_W}[$bi] = $DNCAST{MEDIAN_W12}[$bi] = $DNCAST{MEDIAN_W34}[$bi] = nan;
       
   593 		$nbrm++;
       
   594 	}
       
   595 	for (my($bi)=0; $bi<=$#{$UPCAST{LR_RMS_BP_RESIDUAL}}; $bi++) {
       
   596 		next unless ($UPCAST{LR_RMS_BP_RESIDUAL}[$bi] > $limit);
       
   597 		$UPCAST{MEDIAN_W}[$bi] = $UPCAST{MEDIAN_W12}[$bi] = $UPCAST{MEDIAN_W34}[$bi] = nan;
       
   598 		$nbrm++;
       
   599 	}
       
   600     return $nbrm;
       
   601 }
       
   602 
       
   603 #======================================================================
   574 
   604 
   575 1;
   605 1;