Changeset 186

Show
Ignore:
Timestamp:
04/16/08 13:14:30
Author:
dan
Message:

--

Files:

Legend:

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

    r183 r186  
    397397    || die "ABORT! Invalid units for $time_var{'var_name'}.\n"; 
    398398   
     399  my @KMLTimeStamp; 
    399400  # format the time values for database insertion (no timezone right now) 
    400401  for my $i (0..$#time_values) { 
     
    406407      .sprintf("%02d",$base_month).'-' 
    407408      .sprintf("%02d",$base_day).' ' 
     409      .sprintf("%02d",$base_hour).':' 
     410      .sprintf("%02d",$base_minute).':' 
     411      .sprintf("%02d",$base_second); 
     412     #DWR 4/16/2008 
     413     #KML tag <TimeStamp><when> requires the date to be formatted in a YYYY-MM-DDThh:mm:ss format 
     414     $KMLTimeStamp[$i] = $base_year.'-' 
     415      .sprintf("%02d",$base_month).'-' 
     416      .sprintf("%02d",$base_day).'T' 
    408417      .sprintf("%02d",$base_hour).':' 
    409418      .sprintf("%02d",$base_minute).':' 
     
    14931502          } 
    14941503          obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
    1495                                             $time_formatted_values[$j], 
     1504                                            $KMLTimeStamp[$j], 
    14961505                                            $MLLWDataVal, 
    14971506                                            1, 
     
    15011510                                            $rObsHash ); 
    15021511          obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
    1503                                             $time_formatted_values[$j], 
     1512                                            $KMLTimeStamp[$j], 
    15041513                                            $MSLDataVal, 
    15051514                                            2, 
     
    15091518                                            $rObsHash ); 
    15101519          obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
    1511                                             $time_formatted_values[$j], 
     1520                                            $KMLTimeStamp[$j], 
    15121521                                            $NavD88DataVal, 
    15131522                                            3, 
     
    16351644          } 
    16361645          obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature',  
    1637                                             $time_formatted_values[$j], 
     1646                                            $KMLTimeStamp[$j], 
    16381647                                            $DataVal, 
    16391648                                            1, 
     
    17581767          } 
    17591768          obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature',  
    1760                                             $time_formatted_values[$j], 
     1769                                            $KMLTimeStamp[$j], 
    17611770                                            $DataVal, 
    17621771                                            2, 
     
    18701879          } 
    18711880          obsKMLSubRoutines::KMLAddObsToHash( 'air_temperature',  
    1872                                             $time_formatted_values[$j], 
     1881                                            $KMLTimeStamp[$j], 
    18731882                                            $DataVal, 
    18741883                                            1, 
     
    20622071               
    20632072              obsKMLSubRoutines::KMLAddObsToHash( 'wind_speed',  
    2064                                                   $time_formatted_values[$j], 
     2073                                                  $KMLTimeStamp[$j], 
    20652074                                                  $WindSpdDataVal, 
    20662075                                                  1, 
     
    20762085              } 
    20772086              obsKMLSubRoutines::KMLAddObsToHash( 'wind_from_direction',  
    2078                                                   $time_formatted_values[$j], 
     2087                                                  $KMLTimeStamp[$j], 
    20792088                                                  $WindDirDataVal, 
    20802089                                                  1, 
     
    20902099              } 
    20912100              obsKMLSubRoutines::KMLAddObsToHash( 'wind_gust',  
    2092                                                   $time_formatted_values[$j], 
     2101                                                  $KMLTimeStamp[$j], 
    20932102                                                  $WindGstDataVal, 
    20942103                                                  1, 
     
    22022211          } 
    22032212          obsKMLSubRoutines::KMLAddObsToHash( 'air_pressure',  
    2204                                               $time_formatted_values[$j], 
     2213                                              $KMLTimeStamp[$j], 
    22052214                                              $DataVal, 
    22062215                                              1, 
     
    23172326           
    23182327          obsKMLSubRoutines::KMLAddObsToHash( 'salinity',  
    2319                                               $time_formatted_values[$j], 
     2328                                              $KMLTimeStamp[$j], 
    23202329                                              $DataVal, 
    23212330                                              1, 
     
    24672476               
    24682477              obsKMLSubRoutines::KMLAddObsToHash( 'eastward_current',  
    2469                                                   $time_formatted_values[$j], 
     2478                                                  $KMLTimeStamp[$j], 
    24702479                                                  $ECurrentDataVal, 
    24712480                                                  1, 
     
    24812490              } 
    24822491              obsKMLSubRoutines::KMLAddObsToHash( 'northward_current',  
    2483                                                   $time_formatted_values[$j], 
     2492                                                  $KMLTimeStamp[$j], 
    24842493                                                  $NCurrentDataVal, 
    24852494                                                  1, 
     
    25912600           
    25922601        obsKMLSubRoutines::KMLAddObsToHash( 'dominant_wave_period',  
    2593                                             $time_formatted_values[$j], 
     2602                                            $KMLTimeStamp[$j], 
    25942603                                            $DomWaveDataVal, 
    25952604                                            1, 
     
    26052614        } 
    26062615        obsKMLSubRoutines::KMLAddObsToHash( 'significant_wave_height',  
    2607                                             $time_formatted_values[$j], 
     2616                                            $KMLTimeStamp[$j], 
    26082617                                            $SigWaveHgtDataVal, 
    26092618                                            1, 
     
    26642673           
    26652674        obsKMLSubRoutines::KMLAddObsToHash( 'dominant_wave_period',  
    2666                                             $time_formatted_values[$j], 
     2675                                            $KMLTimeStamp[$j], 
    26672676                                            $DomWaveDataVal, 
    26682677                                            1, 
     
    26782687        } 
    26792688        obsKMLSubRoutines::KMLAddObsToHash( 'significant_wave_height',  
    2680                                             $time_formatted_values[$j], 
     2689                                            $KMLTimeStamp[$j], 
    26812690                                            $SigWaveHgtDataVal, 
    26822691                                            1, 
     
    26972706    #$strXMLPath = "../sql/$strPlatformID-$strDate.kml"; 
    26982707    $strXMLPath = "$strObsKMLFilePath/$strPlatformID-$strDate.kml"; 
    2699     #print( "$strXMLPath\n" ); 
     2708    print( "XMLFilePath: $strXMLPath\n" ); 
    27002709    obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath ); 
    27012710  }