Changeset 243
- Timestamp:
- 10/31/08 14:41:29
- Files:
-
- scout/trunk/cdl_profiler_adcp.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
scout/trunk/cdl_profiler_adcp.pl
r240 r243 528 528 for( $iNdx = 0; $iNdx < $iDataCnt; $iNdx++ ) 529 529 { 530 my $Val = @{$Data[0]}[$iStartNdx]; 530 my $Val = @{$Data[0]}[$iStartNdx]; 531 531 if( $iZDimCnt ) 532 532 { … … 536 536 { 537 537 $iZVal = @$ZData[0]; 538 } 539 if( $strVarName eq 'water_depth' ) 540 { 541 $iZVal = $Val; 542 } 543 elsif( $strVarName eq 'water_level' ) 544 { 545 $iZVal = 0; 538 546 } 539 547 my $iSOrder = $iNdx + 1; … … 593 601 my $TimeVal = ''; 594 602 my $iZVal = 0; 603 my $iPositiveUp = 0; 604 #Is the Z increasing(bottom to surface) or decreasing(surface to bottom)? 605 if( @$ZData[0] < @$ZData[-1] ) 606 { 607 $iPositiveUp = 1; 608 } 595 609 foreach my $strDimName ( sort keys %{$refVarData->{'var_name'}{$strVarName}{'dim_name'}} ) 596 610 { … … 669 683 { 670 684 my $Val = @{$Data[0]}[$iStartNdx]; 685 if( $Val == $Fill_value_value || $Val == $missing_value_value ) 686 { 687 $Val = 'NULL'; 688 } 689 else 690 { 691 $Val = sprintf("%.3f", $Val ); 692 } 671 693 if( $iZDimCnt ) 672 694 { … … 678 700 } 679 701 my $iSOrder = $iNdx + 1; 680 $Val = sprintf("%.3f", $Val ); 702 if( $iPositiveUp ) 703 { 704 $iSOrder = $iDataCnt - $iNdx; 705 } 681 706 OutputData( $strPlatformID, 682 707 $strVarName, … … 691 716 692 717 #Calculate the Speed/Direction? 693 if( $bHasCurrentAndSpeed == 0 && @CalcData ) 694 { 695 my $NorthVal = @{$CalcData[0]}[$iStartNdx]; 696 697 my @MagDir = GetMagAndDir( $Val, $NorthVal, 1 ); 698 718 if( ( $bHasCurrentAndSpeed == 0 ) && 719 ( @CalcData ) ) 720 { 721 my @MagDir; 722 @MagDir[0] = 'NULL'; 723 @MagDir[1] = 'NULL'; 724 if( $Val != 'NULL' ) 725 { 726 my $NorthVal = @{$CalcData[0]}[$iStartNdx]; 727 @MagDir = GetMagAndDir( $Val, $NorthVal, 1 ); 728 } 699 729 #Write the current speed. 700 730 OutputData( $strPlatformID, … … 721 751 } 722 752 #Calculate the east/north components? 723 elsif( $bHasEastNorth == 0 && @CalcData ) 724 { 725 my( $EastCurrent, $NorthCurrent ); 726 my $DirVal = @{$CalcData[0]}[$iStartNdx]; 727 CalcVectorComponents( $Val, $DirVal, \$EastCurrent, \$NorthCurrent ); 753 elsif(( $bHasEastNorth == 0 ) && 754 ( @CalcData ) ) 755 { 756 my( $EastCurrent, $NorthCurrent ) = 'NULL'; 757 758 if( $Val != 'NULL' ) 759 { 760 my $DirVal = @{$CalcData[0]}[$iStartNdx]; 761 CalcVectorComponents( $Val, $DirVal, \$EastCurrent, \$NorthCurrent ); 762 } 728 763 OutputData( $strPlatformID, 729 764 $strVarName,
