Changeset 250

Show
Ignore:
Timestamp:
04/20/09 14:22:42
Author:
dan
Message:

Fixed up passing unitialized values for north/east current and mag/dir. Symptom was values being reported as 0 when really they were missing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • scout/trunk/cdl_fixed_point.pl

    r246 r250  
     1#Revisions 
     2#Rev: 1.1.1.0 
     3#Fixed up passing unitialized values for north/east current and mag/dir. Symptom was values being reported as 0 when really they were missing. 
     4 
    15sub fixed_point() { 
    26 
     
    25642568                  @VectorDataVal = get_mag_and_dir( $ECurrentDataVal, $NCurrentDataVal, 1 ); 
    25652569                } 
     2570                #DWR v1.1.1.0 
     2571                #Initialize the array elements with NULL so if the data is either missing we correctly put the missing data flag. 
     2572                my $mag = 'NULL'; 
     2573                my $dir = 'NULL'; 
     2574                my $len = @VectorDataVal; 
     2575                if( $len == 2 ) 
     2576                { 
     2577                  $mag = @VectorDataVal[0] * 100.0;#Convert to cm_s-1 
     2578                  $dir = @VectorDataVal[1]; 
     2579                } 
    25662580                obsKMLSubRoutines::KMLAddObsToHash( 'current_to_direction',  
    25672581                                                    $KMLTimeStamp[$k], 
    2568                                                     @VectorDataVal[1]
     2582                                                    $dir
    25692583                                                    1, 
    25702584                                                    $strPlatformID, 
     
    25762590                obsKMLSubRoutines::KMLAddObsToHash( 'current_speed',  
    25772591                                                    $KMLTimeStamp[$k], 
    2578                                                     ( @VectorDataVal[0] * 100.0 ), #Convert to cm_s-1 
     2592                                                    $mag,  
    25792593                                                    1, 
    25802594                                                    $strPlatformID, 
     
    25902604                #  $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_northward_current[$i]{'units'} );                  
    25912605                #} 
     2606                #DWR v1.1.1.0 
     2607                #Fixed bug where data was missing, so $NCurrentDataVal would be NULL, but multiplying it by 100.0 would result in 0 so it appeared 
     2608                #to be a real observation 
     2609                if( $NCurrentDataVal != 'NULL' ) 
     2610                { 
     2611                  $NCurrentDataVal * 100.0; #DWR convert to cm_s-1 
     2612                } 
    25922613                obsKMLSubRoutines::KMLAddObsToHash( 'northward_current',  
    25932614                                                    $KMLTimeStamp[$k], 
    2594                                                     $NCurrentDataVal * 100.0, #DWR convert to cm_s-1 
     2615                                                    $NCurrentDataVal, #DWR convert to cm_s-1 
    25952616                                                    1, 
    25962617                                                    $strPlatformID, 
     
    26052626                #  $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_eastward_current[$i]{'units'} );                  
    26062627                #} 
     2628                #DWR v1.1.1.0 
     2629                #Fixed bug where data was missing, so $NCurrentDataVal would be NULL, but multiplying it by 100.0 would result in 0 so it appeared 
     2630                #to be a real observation 
     2631                if( $ECurrentDataVal != 'NULL' ) 
     2632                { 
     2633                  $ECurrentDataVal * 100.0; #DWR convert to cm_s-1 
     2634                } 
     2635                 
    26072636                obsKMLSubRoutines::KMLAddObsToHash( 'eastward_current',  
    26082637                                                    $KMLTimeStamp[$k], 
    2609                                                     $ECurrentDataVal * 100.0, #DWR convert to cm_s-1 
     2638                                                    $ECurrentDataVal, #DWR convert to cm_s-1 
    26102639                                                    1, 
    26112640                                                    $strPlatformID,