222 #====================================================================== |
224 #====================================================================== |
223 |
225 |
224 ($firstgood,$lastgood,$atbottom,$w_gap_time,$zErr,$maxz) = |
226 ($firstgood,$lastgood,$atbottom,$w_gap_time,$zErr,$maxz) = |
225 mk_prof(\%dta,!$opt_s,$opt_F,$minb,$maxb,$opt_c,$opt_e,$opt_m); |
227 mk_prof(\%dta,!$opt_s,$opt_F,$minb,$maxb,$opt_c,$opt_e,$opt_m); |
226 |
228 |
227 die("$ARGV[0]: no good ensembles found\n") |
229 unless (defined($firstgood)) { |
228 unless defined($firstgood); |
230 if ($opt_Q) { |
|
231 print(STDERR "$ARGV[0]: no good ensembles found\n"); |
|
232 exit(0); |
|
233 } else { |
|
234 die("$ARGV[0]: no good ensembles found\n"); |
|
235 } |
|
236 } |
229 |
237 |
230 if (defined($opt_B)) { # scale Z |
238 if (defined($opt_B)) { # scale Z |
231 my($zscale) = $opt_B / ($dta{ENSEMBLE}[$atbottom]->{DEPTH} -# downcast |
239 my($zscale) = $opt_B / ($dta{ENSEMBLE}[$atbottom]->{DEPTH} -# downcast |
232 $dta{ENSEMBLE}[$firstgood]->{DEPTH}); |
240 $dta{ENSEMBLE}[$firstgood]->{DEPTH}); |
233 # printf(STDERR "scaling downcast depths by %.2f\n",$zscale); |
241 # printf(STDERR "scaling downcast depths by %.2f\n",$zscale); |
633 |
641 |
634 #====================================================================== |
642 #====================================================================== |
635 # PRODUCE OUTPUT |
643 # PRODUCE OUTPUT |
636 #====================================================================== |
644 #====================================================================== |
637 |
645 |
638 printf(STDERR "# of ensembles : %d\n",scalar(@{$dta{ENSEMBLE}})); |
646 printf(STDERR "# of ensembles : %d\n",scalar(@{$dta{ENSEMBLE}})); |
639 printf(STDERR "Start of cast : %s (#%5d) at %6.1fm\n", |
647 printf(STDERR "Start of cast : %s (#%5d) at %6.1fm\n", |
640 $dta{ENSEMBLE}[$firstgood]->{TIME}, |
648 $dta{ENSEMBLE}[$firstgood]->{TIME}, |
641 $dta{ENSEMBLE}[$firstgood]->{NUMBER}, |
649 $dta{ENSEMBLE}[$firstgood]->{NUMBER}, |
642 $dta{ENSEMBLE}[$firstgood]->{DEPTH}); |
650 $dta{ENSEMBLE}[$firstgood]->{DEPTH}); |
643 printf(STDERR "Bottom of cast : %s (#%5d) at %6.1fm\n", |
651 printf(STDERR "Bottom of cast (zmax): %s (#%5d) at %6.1fm\n", |
644 $dta{ENSEMBLE}[$atbottom]->{TIME}, |
652 $dta{ENSEMBLE}[$atbottom]->{TIME}, |
645 $dta{ENSEMBLE}[$atbottom]->{NUMBER}, |
653 $dta{ENSEMBLE}[$atbottom]->{NUMBER}, |
646 $dta{ENSEMBLE}[$atbottom]->{DEPTH}); |
654 $dta{ENSEMBLE}[$atbottom]->{DEPTH}); |
647 if (defined($water_depth)) { |
655 if (defined($water_depth)) { |
648 printf(STDERR "Seabed : at %6.1fm (+-%dm)\n",$water_depth,$sig_wd); |
656 printf(STDERR "Seabed : at %6.1fm (+-%dm)\n",$water_depth,$sig_wd); |
649 } else { |
657 } else { |
650 print(STDERR "Seabed : not found\n"); |
658 print(STDERR "Seabed : not found\n"); |
651 } |
659 } |
652 printf(STDERR "End of cast : %s (#%5d) at %6.1fm\n", |
660 printf(STDERR "End of cast (zend) : %s (#%5d) at %6.1fm\n", |
653 $dta{ENSEMBLE}[$lastgood]->{TIME}, |
661 $dta{ENSEMBLE}[$lastgood]->{TIME}, |
654 $dta{ENSEMBLE}[$lastgood]->{NUMBER}, |
662 $dta{ENSEMBLE}[$lastgood]->{NUMBER}, |
655 $dta{ENSEMBLE}[$lastgood]->{DEPTH}); |
663 $dta{ENSEMBLE}[$lastgood]->{DEPTH}); |
656 |
664 |
657 printf(STDERR "Rel. Displacement: x = %d(%d)m / y = %d(%d)m\n", |
665 printf(STDERR "Rel. Displacement : x = %d(%d)m / y = %d(%d)m\n", |
658 $dta{ENSEMBLE}[$lastgood]->{X}, $x_err, |
666 $dta{ENSEMBLE}[$lastgood]->{X}, $x_err, |
659 $dta{ENSEMBLE}[$lastgood]->{Y}, $y_err, |
667 $dta{ENSEMBLE}[$lastgood]->{Y}, $y_err, |
660 ) if defined($opt_M); |
668 ) if defined($opt_M); |
661 |
669 |
662 printf(STDERR "Cast Duration : %.1f hours (pinging for %.1f hours)\n", |
670 printf(STDERR "Cast Duration : %.1f hours (pinging for %.1f hours)\n", |
663 $dta{ENSEMBLE}[$lastgood]->{ELAPSED_TIME} / 3600, |
671 $dta{ENSEMBLE}[$lastgood]->{ELAPSED_TIME} / 3600, |
664 ($dta{ENSEMBLE}[$#{$dta{ENSEMBLE}}]->{UNIX_TIME} - |
672 ($dta{ENSEMBLE}[$#{$dta{ENSEMBLE}}]->{UNIX_TIME} - |
665 $dta{ENSEMBLE}[0]->{UNIX_TIME}) / 3600); |
673 $dta{ENSEMBLE}[0]->{UNIX_TIME}) / 3600); |
666 |
674 |
667 printf(STDERR "Minimum range : %dm at ensemble %d, beam %d\n", |
675 printf(STDERR "Minimum range : %dm at ensemble %d, beam %d\n", |
668 $dta{DISTANCE_TO_BIN1_CENTER} + |
676 $dta{DISTANCE_TO_BIN1_CENTER} + |
669 $min_good_bins*$dta{BIN_LENGTH}, |
677 $min_good_bins*$dta{BIN_LENGTH}, |
670 $dta{ENSEMBLE}[$min_good_ens]->{NUMBER}, |
678 $dta{ENSEMBLE}[$min_good_ens]->{NUMBER}, |
671 $worst_beam); |
679 $worst_beam); |
672 printf(STDERR "80%%-valid bins : %.1f\n",$gb+1); |
680 printf(STDERR "80%%-valid bins : %.1f\n",$gb+1); |
673 printf(STDERR "80%%-valid range : %dm\n", |
681 printf(STDERR "80%%-valid range : %dm\n", |
674 $dta{DISTANCE_TO_BIN1_CENTER} + $gb*$dta{BIN_LENGTH}); |
682 $dta{DISTANCE_TO_BIN1_CENTER} + $gb*$dta{BIN_LENGTH}); |
675 printf(STDERR "3-beam solutions : $RDI_Coords::threeBeam_1 " . |
683 printf(STDERR "3-beam solutions : $RDI_Coords::threeBeam_1 " . |
676 "$RDI_Coords::threeBeam_2 " . |
684 "$RDI_Coords::threeBeam_2 " . |
677 "$RDI_Coords::threeBeam_3 " . |
685 "$RDI_Coords::threeBeam_3 " . |
678 "$RDI_Coords::threeBeam_4\n") |
686 "$RDI_Coords::threeBeam_4\n") |
679 unless ($opt_4); |
687 unless ($opt_4); |
680 printf(STDERR "net rotations : [%d]/%d/%d/[%d]\n",$prerot,$dnrot,$uprot,$postrot); |
688 printf(STDERR "net rotations : [%d]/%d/%d/[%d]\n",$prerot,$dnrot,$uprot,$postrot); |
681 printf(STDERR "rms pitch/roll : %.1f/%.1f\n",$dnprrms,$upprrms); |
689 printf(STDERR "rms pitch/roll : %.1f/%.1f\n",$dnprrms,$upprrms); |
682 |
690 |
683 if ($opt_A) { # ANTS format |
691 if ($opt_A) { # ANTS format |
684 print("#ANTS# [] $USAGE\n"); |
692 print("#ANTS# [] $USAGE\n"); |
685 $uFields = "{u} {u_err} {v} {v_err} {x} {x_err} {y} {y_err}" |
693 $uFields = "{u} {u_err} {v} {v_err} {x} {x_err} {y} {y_err}" |
686 if defined($opt_M); |
694 if defined($opt_M); |