Changeset 209

Show
Ignore:
Timestamp:
06/06/08 16:46:10
Author:
dan
Message:

--

Files:

Legend:

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

    r208 r209  
    229229  #DWR v1.1.0.0 6/2/2008 
    230230  #Added use of $iLastNTimeStamps. 
    231   fixed_point_1($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 
    232   #fixed_point($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 
     231  #fixed_point_1($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 
     232  fixed_point($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 
    233233} 
    234234elsif ($format_category_value eq 'moving-point-2D') { 
     
    244244  fixed_map(); 
    245245} 
     246=comment 
    246247sub fixed_point_1 () { 
    247248 
     
    30123013  } 
    30133014} 
     3015=cut 
  • scout/trunk/cdl_fixed_point.pl

    r205 r209  
    2828  $strUnitsXMLFilename = './UnitsConversion.xml'; 
    2929  my $XMLControlFile = XML::LibXML->new->parse_file("$strUnitsXMLFilename"); 
     30   
     31  my %ObsHash; 
     32  my $rObsHash = \%ObsHash; 
     33  my $strPlatformID = $institution_code_value.'.'.$platform_code_value.'.'.$package_code_value; 
    3034   
    3135  # 
     
    437441      .sprintf("%02d",$base_minute).':' 
    438442      .sprintf("%02d",$base_second); 
    439        
    440  
    441   } 
    442   #DWR v1.1.0.0 
    443   #Do a date range check on the newest entry to see if we are picking up any stations that have been offline for a couple of days and log out the message. 
    444   my $ThreeDaysAgo = `date --d=\"3 days ago\" +%s`;      
    445   if( $time_values[-1] < $ThreeDaysAgo ) 
    446   { 
    447     print( "\n***Time Lag::Last time value older than 3 days Platform: $institution_code_value.$platform_code_value.$package_code_value Last Date: $time_formatted_values[-1] File: $net_cdf_file\n" ); 
     443 
    448444  } 
    449445   
     
    13561352    } 
    13571353  } 
    1358    
    1359   #DWR 4/5/2008 
    1360   #Implemented code to write the obsKML files.  
    1361   my %ObsHash; 
    1362   my $rObsHash = \%ObsHash; 
    1363   my $strPlatformID = $institution_code_value.'.'.$platform_code_value.'.'.$package_code_value; 
    1364   obsKMLSubRoutines::KMLAddPlatformHashEntry( $strPlatformID, $institution_url_value, $latitude_value[0], $longitude_value[0], $rObsHash ); 
    1365    
     1354    
    13661355  # water_level (water_level) 
    13671356  if ($#water_level > -1) 
     
    14851474          $this_time_stamp = $time_formatted_values[$j]; 
    14861475          $this_time_stamp_sec = timelocal(substr($this_time_stamp,17,2),substr($this_time_stamp,14,2),substr($this_time_stamp,11,2),substr($this_time_stamp,8,2),(substr($this_time_stamp,5,2)-1),substr($this_time_stamp,0,4)); 
    1487  
    1488           if ($water_level[$i]{'data'}[$j] != $missing_value_value 
    1489             && $water_level[$i]{'data'}[$j] != $Fill_value_value 
    1490             && $this_station_id_top_ts < $this_time_stamp_sec 
    1491             && $this_time_stamp_sec > $oldest_ok_timestamp)  
    1492             { 
    1493      
    1494               #DWR 4/3/2008 
    1495               if ($water_level[$i]{'height'} != $missing_value_value 
    1496                 && $water_level[$i]{'height'} != $Fill_value_value)  
     1476          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     1477          { 
     1478            if ($water_level[$i]{'data'}[$j] != $missing_value_value 
     1479              && $water_level[$i]{'data'}[$j] != $Fill_value_value 
     1480              && $this_station_id_top_ts < $this_time_stamp_sec 
     1481              )  
    14971482              { 
    1498                 $this_val = sprintf("%.2f",$water_level[$i]{'height'}); 
    1499                 $Height = $this_val; 
    1500               } 
    1501               $this_val = sprintf("%.2f",$water_level[$i]{'data'}[$j]); 
    1502                
    1503               $DataVal = $water_level[$i]{'reference'}; 
    1504                
    1505               if (length $water_level[$i]{'reference_to_mllw'} > 0) { 
    1506                 $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_mllw'}); 
    1507               } 
    1508               else { 
    1509                 $this_val = 'NULL'; 
    1510               } 
    1511               $MLLWDataVal = $this_val; 
    1512  
    1513               if (length $water_level[$i]{'reference_to_msl'} > 0) { 
    1514                 $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_msl'}); 
    1515               } 
    1516               else { 
    1517                 $this_val = 'NULL'; 
    1518               } 
    1519               $MSLDataVal = $this_val; 
    1520  
    1521               if (length $water_level[$i]{'reference_to_navd88'} > 0) { 
    1522                 $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_navd88'}); 
    1523               } 
    1524               else { 
    1525                 $this_val = 'NULL'; 
    1526               } 
    1527               #DWR 4/5/2008 
    1528               $NavD88DataVal = $this_val; 
    1529           } 
    1530           obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
    1531                                             $KMLTimeStamp[$j], 
    1532                                             $MLLWDataVal, 
    1533                                             1, 
    1534                                             $strPlatformID, 
    1535                                             $Height, 
    1536                                             'm(MLLW)', 
    1537                                             $rObsHash ); 
    1538           obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
    1539                                             $KMLTimeStamp[$j], 
    1540                                             $MSLDataVal, 
    1541                                             2, 
    1542                                             $strPlatformID, 
    1543                                             $Height, 
    1544                                             'm(MSL)', 
    1545                                             $rObsHash ); 
    1546           obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
    1547                                             $KMLTimeStamp[$j], 
    1548                                             $NavD88DataVal, 
    1549                                             3, 
    1550                                             $strPlatformID, 
    1551                                             $Height, 
    1552                                             'm(NAVD88)', 
    1553                                             $rObsHash ); 
     1483       
     1484                #DWR 4/3/2008 
     1485                if ($water_level[$i]{'height'} != $missing_value_value 
     1486                  && $water_level[$i]{'height'} != $Fill_value_value)  
     1487                { 
     1488                  $this_val = sprintf("%.2f",$water_level[$i]{'height'}); 
     1489                  $Height = $this_val; 
     1490                } 
     1491                $this_val = sprintf("%.2f",$water_level[$i]{'data'}[$j]); 
     1492                 
     1493                $DataVal = $water_level[$i]{'reference'}; 
     1494                 
     1495                if (length $water_level[$i]{'reference_to_mllw'} > 0) { 
     1496                  $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_mllw'}); 
     1497                } 
     1498                else { 
     1499                  $this_val = 'NULL'; 
     1500                } 
     1501                $MLLWDataVal = $this_val; 
     1502 
     1503                if (length $water_level[$i]{'reference_to_msl'} > 0) { 
     1504                  $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_msl'}); 
     1505                } 
     1506                else { 
     1507                  $this_val = 'NULL'; 
     1508                } 
     1509                $MSLDataVal = $this_val; 
     1510 
     1511                if (length $water_level[$i]{'reference_to_navd88'} > 0) { 
     1512                  $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_navd88'}); 
     1513                } 
     1514                else { 
     1515                  $this_val = 'NULL'; 
     1516                } 
     1517                #DWR 4/5/2008 
     1518                $NavD88DataVal = $this_val; 
     1519            } 
     1520            obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
     1521                                              $KMLTimeStamp[$j], 
     1522                                              $MLLWDataVal, 
     1523                                              1, 
     1524                                              $strPlatformID, 
     1525                                              $Height, 
     1526                                              'm(MLLW)', 
     1527                                              $rObsHash ); 
     1528            obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
     1529                                              $KMLTimeStamp[$j], 
     1530                                              $MSLDataVal, 
     1531                                              2, 
     1532                                              $strPlatformID, 
     1533                                              $Height, 
     1534                                              'm(MSL)', 
     1535                                              $rObsHash ); 
     1536            obsKMLSubRoutines::KMLAddObsToHash( 'water_level',  
     1537                                              $KMLTimeStamp[$j], 
     1538                                              $NavD88DataVal, 
     1539                                              3, 
     1540                                              $strPlatformID, 
     1541                                              $Height, 
     1542                                              'm(NAVD88)', 
     1543                                              $rObsHash ); 
     1544          }                                                       
    15541545        } 
    15551546      }             
     
    16511642          $this_time_stamp = $time_formatted_values[$j]; 
    16521643          $this_time_stamp_sec = timelocal(substr($this_time_stamp,17,2),substr($this_time_stamp,14,2),substr($this_time_stamp,11,2),substr($this_time_stamp,8,2),(substr($this_time_stamp,5,2)-1),substr($this_time_stamp,0,4)); 
    1653          
    1654           if ($sea_surface_temperature[$i]{'data'}[$j] != $missing_value_value 
    1655               && $sea_surface_temperature[$i]{'data'}[$j] != $Fill_value_value 
    1656               && $this_station_id_top_ts < $this_time_stamp_sec 
    1657               && $this_time_stamp_sec > $oldest_ok_timestamp)  
    1658           { 
    1659  
    1660             if ($sea_surface_temperature[$i]{'height'} != $missing_value_value 
    1661               && $sea_surface_temperature[$i]{'height'} != $Fill_value_value)  
     1644          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     1645          {         
     1646            if ($sea_surface_temperature[$i]{'data'}[$j] != $missing_value_value 
     1647                && $sea_surface_temperature[$i]{'data'}[$j] != $Fill_value_value 
     1648                && $this_station_id_top_ts < $this_time_stamp_sec 
     1649               )  
    16621650            { 
    1663               $Height = sprintf("%.2f",$sea_surface_temperature[$i]{'height'}); 
    1664             } 
    1665             $DataVal = sprintf("%.2f",$sea_surface_temperature[$i]{'data'}[$j]); 
    1666                        
    1667           } 
    1668           my $strUnits; 
    1669           $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_temperature[$i]{'units'}, $XMLControlFile ); 
    1670           if( length( $strUnits ) == 0 ) 
    1671           { 
    1672             #DWR v1.1.0.0 
    1673             #Make sure we don't have any unprintable characters.             
    1674             $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_temperature[$i]{'units'} );   
    1675           } 
    1676           obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature',  
    1677                                             $KMLTimeStamp[$j], 
    1678                                             $DataVal, 
    1679                                             1, 
    1680                                             $strPlatformID, 
    1681                                             $Height, 
    1682                                             $strUnits, 
    1683                                             $rObsHash ); 
     1651 
     1652              if ($sea_surface_temperature[$i]{'height'} != $missing_value_value 
     1653                && $sea_surface_temperature[$i]{'height'} != $Fill_value_value)  
     1654              { 
     1655                $Height = sprintf("%.2f",$sea_surface_temperature[$i]{'height'}); 
     1656              } 
     1657              $DataVal = sprintf("%.2f",$sea_surface_temperature[$i]{'data'}[$j]); 
     1658                         
     1659            } 
     1660            my $strUnits; 
     1661            $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_temperature[$i]{'units'}, $XMLControlFile ); 
     1662            if( length( $strUnits ) == 0 ) 
     1663            { 
     1664              #DWR v1.1.0.0 
     1665              #Make sure we don't have any unprintable characters.             
     1666              $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_temperature[$i]{'units'} );   
     1667            } 
     1668            obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature',  
     1669                                              $KMLTimeStamp[$j], 
     1670                                              $DataVal, 
     1671                                              1, 
     1672                                              $strPlatformID, 
     1673                                              $Height, 
     1674                                              $strUnits, 
     1675                                              $rObsHash ); 
     1676          }                                               
    16841677        } 
    16851678      }                                             
     
    17781771          $this_time_stamp = $time_formatted_values[$j]; 
    17791772          $this_time_stamp_sec = timelocal(substr($this_time_stamp,17,2),substr($this_time_stamp,14,2),substr($this_time_stamp,11,2),substr($this_time_stamp,8,2),(substr($this_time_stamp,5,2)-1),substr($this_time_stamp,0,4));        
    1780           if ($sea_bottom_temperature[$i]{'data'}[$j] != $missing_value_value 
    1781               && $sea_bottom_temperature[$i]{'data'}[$j] != $Fill_value_value 
    1782               && $this_station_id_top_ts < $this_time_stamp_sec 
    1783               && $this_time_stamp_sec > $oldest_ok_timestamp)  
     1773          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
    17841774          { 
    1785  
    1786             if ($sea_bottom_temperature[$i]{'height'} != $missing_value_value 
    1787               && $sea_bottom_temperature[$i]{'height'} != $Fill_value_value)  
     1775            if ($sea_bottom_temperature[$i]{'data'}[$j] != $missing_value_value 
     1776                && $sea_bottom_temperature[$i]{'data'}[$j] != $Fill_value_value 
     1777                && $this_station_id_top_ts < $this_time_stamp_sec 
     1778               )  
    17881779            { 
    1789               $Height = sprintf("%.2f",$sea_bottom_temperature[$i]{'height'}); 
    1790             } 
    1791             $DataVal = sprintf("%.2f",$sea_bottom_temperature[$i]{'data'}[$j]); 
    1792                        
    1793           } 
    1794           my $strUnits; 
    1795           $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_bottom_temperature[$i]{'units'}, $XMLControlFile );         
    1796           if( length( $strUnits ) == 0 ) 
    1797           { 
    1798             #DWR v1.1.0.0 
    1799             #Make sure we don't have any unprintable characters.             
    1800             $strUnits = obsKMLSubRoutines::CleanString( $sea_bottom_temperature[$i]{'units'} );   
    1801           } 
    1802           obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature',  
    1803                                             $KMLTimeStamp[$j], 
    1804                                             $DataVal, 
    1805                                             2, 
    1806                                             $strPlatformID, 
    1807                                             $Height, 
    1808                                             $strUnits, 
    1809                                             $rObsHash ); 
     1780 
     1781              if ($sea_bottom_temperature[$i]{'height'} != $missing_value_value 
     1782                && $sea_bottom_temperature[$i]{'height'} != $Fill_value_value)  
     1783              { 
     1784                $Height = sprintf("%.2f",$sea_bottom_temperature[$i]{'height'}); 
     1785              } 
     1786              $DataVal = sprintf("%.2f",$sea_bottom_temperature[$i]{'data'}[$j]); 
     1787                         
     1788            } 
     1789            my $strUnits; 
     1790            $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_bottom_temperature[$i]{'units'}, $XMLControlFile );         
     1791            if( length( $strUnits ) == 0 ) 
     1792            { 
     1793              #DWR v1.1.0.0 
     1794              #Make sure we don't have any unprintable characters.             
     1795              $strUnits = obsKMLSubRoutines::CleanString( $sea_bottom_temperature[$i]{'units'} );   
     1796            } 
     1797            obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature',  
     1798                                              $KMLTimeStamp[$j], 
     1799                                              $DataVal, 
     1800                                              2, 
     1801                                              $strPlatformID, 
     1802                                              $Height, 
     1803                                              $strUnits, 
     1804                                              $rObsHash ); 
     1805          }                                               
    18101806        } 
    18111807      }                                             
     
    18921888          $this_time_stamp = $time_formatted_values[$j]; 
    18931889          $this_time_stamp_sec = timelocal(substr($this_time_stamp,17,2),substr($this_time_stamp,14,2),substr($this_time_stamp,11,2),substr($this_time_stamp,8,2),(substr($this_time_stamp,5,2)-1),substr($this_time_stamp,0,4)); 
    1894          
    1895           if ($air_temperature[$i]{'data'}[$j] != $missing_value_value 
    1896               && $air_temperature[$i]{'data'}[$j] != $Fill_value_value 
    1897               && $this_station_id_top_ts < $this_time_stamp_sec 
    1898               && $this_time_stamp_sec > $oldest_ok_timestamp)  
    1899           { 
    1900  
    1901             if ($air_temperature[$i]{'height'} != $missing_value_value 
    1902               && $air_temperature[$i]{'height'} != $Fill_value_value)  
     1890          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     1891          {         
     1892            if ($air_temperature[$i]{'data'}[$j] != $missing_value_value 
     1893                && $air_temperature[$i]{'data'}[$j] != $Fill_value_value 
     1894                && $this_station_id_top_ts < $this_time_stamp_sec 
     1895                )  
    19031896            { 
    1904               $Height = sprintf("%.2f",$air_temperature[$i]{'height'}); 
    1905             } 
    1906             $DataVal = sprintf("%.2f",$air_temperature[$i]{'data'}[$j]); 
    1907                        
    1908           } 
    1909           my $strUnits; 
    1910           $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_temperature[$i]{'units'}, $XMLControlFile );         
    1911           if( length( $strUnits ) == 0 ) 
    1912           { 
    1913             #DWR v1.1.0.0 
    1914             #Make sure we don't have any unprintable characters.             
    1915             $strUnits = obsKMLSubRoutines::CleanString( $air_temperature[$i]{'units'} );   
    1916             
    1917           } 
    1918           obsKMLSubRoutines::KMLAddObsToHash( 'air_temperature',  
    1919                                             $KMLTimeStamp[$j], 
    1920                                             $DataVal, 
    1921                                             1, 
    1922                                             $strPlatformID, 
    1923                                             $Height, 
    1924                                             $strUnits, 
    1925                                             $rObsHash ); 
     1897 
     1898              if ($air_temperature[$i]{'height'} != $missing_value_value 
     1899                && $air_temperature[$i]{'height'} != $Fill_value_value)  
     1900              { 
     1901                $Height = sprintf("%.2f",$air_temperature[$i]{'height'}); 
     1902              } 
     1903              $DataVal = sprintf("%.2f",$air_temperature[$i]{'data'}[$j]); 
     1904                         
     1905            } 
     1906            my $strUnits; 
     1907            $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_temperature[$i]{'units'}, $XMLControlFile );         
     1908            if( length( $strUnits ) == 0 ) 
     1909            { 
     1910              #DWR v1.1.0.0 
     1911              #Make sure we don't have any unprintable characters.             
     1912              $strUnits = obsKMLSubRoutines::CleanString( $air_temperature[$i]{'units'} );   
     1913              
     1914            } 
     1915            obsKMLSubRoutines::KMLAddObsToHash( 'air_temperature',  
     1916                                              $KMLTimeStamp[$j], 
     1917                                              $DataVal, 
     1918                                              1, 
     1919                                              $strPlatformID, 
     1920                                              $Height, 
     1921                                              $strUnits, 
     1922                                              $rObsHash ); 
     1923          }                                                 
    19261924        } 
    19271925      }                                             
     
    20692067            my $WindGstDataVal = 'NULL'; 
    20702068            my $Height = ''; 
    2071             if ($wind_speed[$i]{'data'}[$k] != $missing_value_value 
    2072               && $wind_speed[$i]{'data'}[$k] != $Fill_value_value 
    2073               && $wind_from_direction[$j]{'data'}[$k] != $missing_value_value 
    2074               && $wind_from_direction[$j]{'data'}[$k] != $Fill_value_value 
    2075               && $this_station_id_top_ts < $this_time_stamp_sec 
    2076               && $this_time_stamp_sec > $oldest_ok_timestamp)  
    2077               { 
    2078                 if ($wind_speed[$i]{'height'} != $missing_value_value 
    2079                   && $wind_speed[$i]{'height'} != $Fill_value_value)  
     2069            if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     2070            {            
     2071              if ($wind_speed[$i]{'data'}[$k] != $missing_value_value 
     2072                && $wind_speed[$i]{'data'}[$k] != $Fill_value_value 
     2073                && $wind_from_direction[$j]{'data'}[$k] != $missing_value_value 
     2074                && $wind_from_direction[$j]{'data'}[$k] != $Fill_value_value 
     2075                && $this_station_id_top_ts < $this_time_stamp_sec 
     2076                )  
    20802077                { 
    2081                   $Height = sprintf("%.2f",$wind_speed[$i]{'height'}); 
     2078                  if ($wind_speed[$i]{'height'} != $missing_value_value 
     2079                    && $wind_speed[$i]{'height'} != $Fill_value_value)  
     2080                  { 
     2081                    $Height = sprintf("%.2f",$wind_speed[$i]{'height'}); 
     2082                  } 
     2083 
     2084                  $this_val = sprintf("%.2f",$wind_speed[$i]{'data'}[$k]); 
     2085                  if( length( $this_val ) > 0 ) 
     2086                  { 
     2087                    $WindSpdDataVal = $this_val; 
     2088                  } 
     2089 
     2090                  if ($wind_gust[$j]{'data'}[$k] != $missing_value_value 
     2091                      && $wind_gust[$j]{'data'}[$k] != $Fill_value_value 
     2092                      && $wind_gust[$j]{'data'}[$k] != '')  
     2093                  { 
     2094                    $WindGstDataVal = sprintf("%.2f",$wind_gust[$j]{'data'}[$k]); 
     2095                  } 
     2096                   
     2097                  $this_val = sprintf("%.2f",$wind_from_direction[$j]{'data'}[$k]); 
     2098                  #DWR 4/5/2008 
     2099                  if( length( $this_val ) > 0 ) 
     2100                  { 
     2101                    $WindDirDataVal = $this_val; 
     2102                  }               
    20822103                } 
    2083  
    2084                 $this_val = sprintf("%.2f",$wind_speed[$i]{'data'}[$k]); 
    2085                 if( length( $this_val ) > 0 ) 
     2104                my $strUnits; 
     2105                $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_speed[$i]{'units'}, $XMLControlFile );         
     2106                if( length( $strUnits ) == 0 ) 
    20862107                { 
    2087                   $WindSpdDataVal = $this_val; 
    2088                 } 
    2089  
    2090                 if ($wind_gust[$j]{'data'}[$k] != $missing_value_value 
    2091                     && $wind_gust[$j]{'data'}[$k] != $Fill_value_value 
    2092                     && $wind_gust[$j]{'data'}[$k] != '')  
    2093                 { 
    2094                   $WindGstDataVal = sprintf("%.2f",$wind_gust[$j]{'data'}[$k]); 
     2108                  #DWR v1.1.0.0 
     2109                  #Make sure we don't have any unprintable characters.             
     2110                  $strUnits = obsKMLSubRoutines::CleanString( $wind_speed[$i]{'units'} );   
     2111                  
    20952112                } 
    20962113                 
    2097                 $this_val = sprintf("%.2f",$wind_from_direction[$j]{'data'}[$k]); 
    2098                 #DWR 4/5/2008 
    2099                 if( length( $this_val ) > 0 ) 
     2114                obsKMLSubRoutines::KMLAddObsToHash( 'wind_speed',  
     2115                                                    $KMLTimeStamp[$k], 
     2116                                                    $WindSpdDataVal, 
     2117                                                    1, 
     2118                                                    $strPlatformID, 
     2119                                                    $Height, 
     2120                                                    $strUnits, 
     2121                                                    $rObsHash ); 
     2122                $strUnits = ''; 
     2123                $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_from_direction[$i]{'units'}, $XMLControlFile );         
     2124                if( length( $strUnits ) == 0 ) 
    21002125                { 
    2101                   $WindDirDataVal = $this_val; 
    2102                 }               
    2103               } 
    2104               my $strUnits; 
    2105               $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_speed[$i]{'units'}, $XMLControlFile );         
    2106               if( length( $strUnits ) == 0 ) 
    2107               { 
    2108                 #DWR v1.1.0.0 
    2109                 #Make sure we don't have any unprintable characters.             
    2110                 $strUnits = obsKMLSubRoutines::CleanString( $wind_speed[$i]{'units'} );   
    2111                 
    2112               } 
    2113                
    2114               obsKMLSubRoutines::KMLAddObsToHash( 'wind_speed',  
    2115                                                   $KMLTimeStamp[$k], 
    2116                                                   $WindSpdDataVal, 
    2117                                                   1, 
    2118                                                   $strPlatformID, 
    2119                                                   $Height, 
    2120                                                   $strUnits, 
    2121                                                   $rObsHash ); 
    2122               $strUnits = ''; 
    2123               $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_from_direction[$i]{'units'}, $XMLControlFile );         
    2124               if( length( $strUnits ) == 0 ) 
    2125               { 
    2126                 #DWR v1.1.0.0 
    2127                 #Make sure we don't have any unprintable characters.             
    2128                 $strUnits = obsKMLSubRoutines::CleanString( $wind_from_direction[$i]{'units'} );                 
    2129               } 
    2130               obsKMLSubRoutines::KMLAddObsToHash( 'wind_from_direction',  
    2131                                                   $KMLTimeStamp[$k], 
    2132                                                   $WindDirDataVal, 
    2133                                                   1, 
    2134                                                   $strPlatformID, 
    2135                                                   $Height, 
    2136                                                   $strUnits, 
    2137                                                   $rObsHash ); 
    2138               $strUnits = ''; 
    2139               $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_gust[$i]{'units'}, $XMLControlFile );         
    2140               if( length( $strUnits ) == 0 ) 
    2141               { 
    2142                 #DWR v1.1.0.0 
    2143                 #Make sure we don't have any unprintable characters.             
    2144                 $strUnits = obsKMLSubRoutines::CleanString( $wind_gust[$i]{'units'} );                  
    2145               } 
    2146               obsKMLSubRoutines::KMLAddObsToHash( 'wind_gust',  
    2147                                                   $KMLTimeStamp[$k], 
    2148                                                   $WindGstDataVal, 
    2149                                                   1, 
    2150                                                   $strPlatformID, 
    2151                                                   $Height, 
    2152                                                   $strUnits, 
    2153                                                   $rObsHash ); 
     2126                  #DWR v1.1.0.0 
     2127                  #Make sure we don't have any unprintable characters.             
     2128                  $strUnits = obsKMLSubRoutines::CleanString( $wind_from_direction[$i]{'units'} );                 
     2129                } 
     2130                obsKMLSubRoutines::KMLAddObsToHash( 'wind_from_direction',  
     2131                                                    $KMLTimeStamp[$k], 
     2132                                                    $WindDirDataVal, 
     2133                                                    1, 
     2134                                                    $strPlatformID, 
     2135                                                    $Height, 
     2136                                                    $strUnits, 
     2137                                                    $rObsHash ); 
     2138                $strUnits = ''; 
     2139                $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_gust[$i]{'units'}, $XMLControlFile );         
     2140                if( length( $strUnits ) == 0 ) 
     2141                { 
     2142                  #DWR v1.1.0.0 
     2143                  #Make sure we don't have any unprintable characters.             
     2144                  $strUnits = obsKMLSubRoutines::CleanString( $wind_gust[$i]{'units'} );                  
     2145                } 
     2146                obsKMLSubRoutines::KMLAddObsToHash( 'wind_gust',  
     2147                                                    $KMLTimeStamp[$k], 
     2148                                                    $WindGstDataVal, 
     2149                                                    1, 
     2150                                                    $strPlatformID, 
     2151                                                    $Height, 
     2152                                                    $strUnits, 
     2153                                                    $rObsHash ); 
     2154            }                                                     
    21542155          } 
    21552156        } 
     
    22392240          my $DataVal = 'NULL'; 
    22402241          my $Height = ''; 
    2241           if ($air_pressure[$i]{'data'}[$j] != $missing_value_value 
    2242             && $air_pressure[$i]{'data'}[$j] != $Fill_value_value 
    2243             && $this_station_id_top_ts < $this_time_stamp_sec 
    2244             && $this_time_stamp_sec > $oldest_ok_timestamp) { 
    2245             if ($air_pressure[$i]{'height'} != $missing_value_value 
    2246               && $air_pressure[$i]{'height'} != $Fill_value_value)  
     2242          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     2243          {           
     2244            if ($air_pressure[$i]{'data'}[$j] != $missing_value_value 
     2245              && $air_pressure[$i]{'data'}[$j] != $Fill_value_value 
     2246              && $this_station_id_top_ts < $this_time_stamp_sec 
     2247              ) { 
     2248              if ($air_pressure[$i]{'height'} != $missing_value_value 
     2249                && $air_pressure[$i]{'height'} != $Fill_value_value)  
     2250              { 
     2251                $Height = sprintf("%.2f",$air_pressure[$i]{'height'}); 
     2252              } 
     2253              $DataVal = sprintf("%.2f",$air_pressure[$i]{'data'}[$j]); 
     2254            }            
     2255            #DWR 4/3/2008 
     2256            my $strUnits; 
     2257            $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_pressure[$i]{'units'}, $XMLControlFile );  
     2258            if( length( $strUnits ) == 0 ) 
    22472259            { 
    2248               $Height = sprintf("%.2f",$air_pressure[$i]{'height'}); 
    2249             } 
    2250             $DataVal = sprintf("%.2f",$air_pressure[$i]{'data'}[$j]); 
    2251           }            
    2252           #DWR 4/3/2008 
    2253           my $strUnits; 
    2254           $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_pressure[$i]{'units'}, $XMLControlFile );  
    2255           if( length( $strUnits ) == 0 ) 
    2256           { 
    2257            #DWR v1.1.0.0 
    2258            #Make sure we don't have any unprintable characters.             
    2259            $strUnits = obsKMLSubRoutines::CleanString( $air_pressure[$i]{'units'} );             
    2260           } 
    2261           obsKMLSubRoutines::KMLAddObsToHash( 'air_pressure',  
    2262                                               $KMLTimeStamp[$j], 
    2263                                               $DataVal, 
    2264                                               1, 
    2265                                               $strPlatformID, 
    2266                                               $Height, 
    2267                                               $strUnits, 
    2268                                               $rObsHash ); 
     2260             #DWR v1.1.0.0 
     2261             #Make sure we don't have any unprintable characters.             
     2262             $strUnits = obsKMLSubRoutines::CleanString( $air_pressure[$i]{'units'} );             
     2263            } 
     2264            obsKMLSubRoutines::KMLAddObsToHash( 'air_pressure',  
     2265                                                $KMLTimeStamp[$j], 
     2266                                                $DataVal, 
     2267                                                1, 
     2268                                                $strPlatformID, 
     2269                                                $Height, 
     2270                                                $strUnits, 
     2271                                                $rObsHash ); 
     2272          }                                                 
    22692273        } 
    22702274      }                                             
     
    23532357          my $DataVal = 'NULL'; 
    23542358          my $Height = ''; 
    2355           if ($salinity[$i]{'data'}[$j] != $missing_value_value 
    2356               && $salinity[$i]{'data'}[$j] != $Fill_value_value 
    2357               && $this_station_id_top_ts < $this_time_stamp_sec 
    2358               && $this_time_stamp_sec > $oldest_ok_timestamp)  
    2359           { 
    2360             if ($salinity[$i]{'height'} != $missing_value_value 
    2361               && $salinity[$i]{'height'} != $Fill_value_value)  
     2359          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     2360          {          
     2361            if ($salinity[$i]{'data'}[$j] != $missing_value_value 
     2362                && $salinity[$i]{'data'}[$j] != $Fill_value_value 
     2363                && $this_station_id_top_ts < $this_time_stamp_sec 
     2364                )  
    23622365            { 
    2363               $Height = sprintf("%.2f",$salinity[$i]{'height'}); 
    2364             } 
    2365             $DataVal = sprintf("%.2f",$salinity[$i]{'data'}[$j]); 
    2366           }            
    2367           my $strUnits; 
    2368           if( lc( $salinity[$i]{'units'} ) eq 'ppt' ) 
    2369           { 
    2370             $strUnits =  'psu';         
    2371           } 
    2372           if( length( $strUnits ) == 0 ) 
    2373           { 
    2374            #DWR v1.1.0.0 
    2375            #Make sure we don't have any unprintable characters.             
    2376            $strUnits = obsKMLSubRoutines::CleanString( $salinity[$i]{'units'} );             
    2377           } 
    2378            
    2379           obsKMLSubRoutines::KMLAddObsToHash( 'salinity',  
    2380                                               $KMLTimeStamp[$j], 
    2381                                               $DataVal, 
    2382                                               1, 
    2383                                               $strPlatformID, 
    2384                                               $Height, 
    2385                                               $strUnits, 
    2386                                               $rObsHash ); 
     2366              if ($salinity[$i]{'height'} != $missing_value_value 
     2367                && $salinity[$i]{'height'} != $Fill_value_value)  
     2368              { 
     2369                $Height = sprintf("%.2f",$salinity[$i]{'height'}); 
     2370              } 
     2371              $DataVal = sprintf("%.2f",$salinity[$i]{'data'}[$j]); 
     2372            }            
     2373            my $strUnits; 
     2374            if( lc( $salinity[$i]{'units'} ) eq 'ppt' ) 
     2375            { 
     2376              $strUnits =  'psu';         
     2377            } 
     2378            if( length( $strUnits ) == 0 ) 
     2379            { 
     2380             #DWR v1.1.0.0 
     2381             #Make sure we don't have any unprintable characters.             
     2382             $strUnits = obsKMLSubRoutines::CleanString( $salinity[$i]{'units'} );             
     2383            } 
     2384             
     2385            obsKMLSubRoutines::KMLAddObsToHash( 'salinity',  
     2386                                                $KMLTimeStamp[$j], 
     2387                                                $DataVal, 
     2388                                                1, 
     2389                                                $strPlatformID, 
     2390                                                $Height, 
     2391                                                $strUnits, 
     2392                                                $rObsHash ); 
     2393          }                                                 
    23872394        } 
    23882395      }                                             
     
    25042511              my $NCurrentDataVal = 'NULL'; 
    25052512              my $Height = '';             
    2506                
    2507               if ($sea_surface_eastward_current[$i]{'data'}[$k] != $missing_value_value 
    2508                   && $sea_surface_eastward_current[$i]{'data'}[$k] != $Fill_value_value 
    2509                   && $sea_surface_northward_current[$j]{'data'}[$k] != $missing_value_value 
    2510                   && $sea_surface_northward_current[$j]{'data'}[$k] != $Fill_value_value 
    2511                   && $this_station_id_top_ts < $this_time_stamp_sec 
    2512                   && $this_time_stamp_sec > $oldest_ok_timestamp)  
    2513               { 
    2514                 if ($sea_surface_eastward_current[$i]{'height'} != $missing_value_value 
    2515                     && $sea_surface_eastward_current[$i]{'height'} != $Fill_value_value)  
     2513              if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     2514              {              
     2515                if ($sea_surface_eastward_current[$i]{'data'}[$k] != $missing_value_value 
     2516                    && $sea_surface_eastward_current[$i]{'data'}[$k] != $Fill_value_value 
     2517                    && $sea_surface_northward_current[$j]{'data'}[$k] != $missing_value_value 
     2518                    && $sea_surface_northward_current[$j]{'data'}[$k] != $Fill_value_value 
     2519                    && $this_station_id_top_ts < $this_time_stamp_sec 
     2520                    )  
    25162521                { 
    2517                   $Height = sprintf("%.2f",$sea_surface_eastward_current[$i]{'height'});                 
     2522                  if ($sea_surface_eastward_current[$i]{'height'} != $missing_value_value 
     2523                      && $sea_surface_eastward_current[$i]{'height'} != $Fill_value_value)  
     2524                  { 
     2525                    $Height = sprintf("%.2f",$sea_surface_eastward_current[$i]{'height'});                 
     2526                  } 
     2527                  $ECurrentDataVal = sprintf("%.2f",$sea_surface_eastward_current[$i]{'data'}[$k]); 
     2528                   
     2529                  $NCurrentDataVal = sprintf("%.2f",$sea_surface_northward_current[$j]{'data'}[$k]); 
     2530 
    25182531                } 
    2519                 $ECurrentDataVal = sprintf("%.2f",$sea_surface_eastward_current[$i]{'data'}[$k]); 
     2532                my $strUnits; 
     2533                $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_eastward_current[$i]{'units'}, $XMLControlFile );         
     2534                if( length( $strUnits ) == 0 ) 
     2535                { 
     2536                  #DWR v1.1.0.0 
     2537                  #Make sure we don't have any unprintable characters.             
     2538                  $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_eastward_current[$i]{'units'} );                  
     2539                } 
    25202540                 
    2521                 $NCurrentDataVal = sprintf("%.2f",$sea_surface_northward_current[$j]{'data'}[$k]); 
    2522  
    2523               } 
    2524               my $strUnits; 
    2525               $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_eastward_current[$i]{'units'}, $XMLControlFile );         
    2526               if( length( $strUnits ) == 0 ) 
    2527               { 
    2528                 #DWR v1.1.0.0 
    2529                 #Make sure we don't have any unprintable characters.             
    2530                 $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_eastward_current[$i]{'units'} );                  
    2531               } 
    2532                
    2533               obsKMLSubRoutines::KMLAddObsToHash( 'eastward_current',  
    2534                                                   $KMLTimeStamp[$k], 
    2535                                                   $ECurrentDataVal, 
    2536                                                   1, 
    2537                                                   $strPlatformID, 
    2538                                                   $Height, 
    2539                                                   $strUnits, 
    2540                                                   $rObsHash ); 
    2541               $strUnits = ''; 
    2542               $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_northward_current[$i]{'units'}, $XMLControlFile );         
    2543               if( length( $strUnits ) == 0 ) 
    2544               { 
    2545                 #DWR v1.1.0.0 
    2546                 #Make sure we don't have any unprintable characters.             
    2547                 $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_northward_current[$i]{'units'} );                  
    2548               } 
    2549               obsKMLSubRoutines::KMLAddObsToHash( 'northward_current',  
    2550                                                   $KMLTimeStamp[$k], 
    2551                                                   $NCurrentDataVal, 
    2552                                                   1, 
    2553                                                   $strPlatformID, 
    2554                                                   $Height, 
    2555                                                   $strUnits, 
    2556                                                   $rObsHash ); 
     2541                obsKMLSubRoutines::KMLAddObsToHash( 'eastward_current',  
     2542                                                    $KMLTimeStamp[$k], 
     2543                                                    $ECurrentDataVal, 
     2544                                                    1, 
     2545                                                    $strPlatformID, 
     2546                                                    $Height, 
     2547                                                    $strUnits, 
     2548                                                    $rObsHash ); 
     2549                $strUnits = ''; 
     2550                $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_northward_current[$i]{'units'}, $XMLControlFile );         
     2551                if( length( $strUnits ) == 0 ) 
     2552                { 
     2553                  #DWR v1.1.0.0 
     2554                  #Make sure we don't have any unprintable characters.             
     2555                  $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_northward_current[$i]{'units'} );                  
     2556                } 
     2557                obsKMLSubRoutines::KMLAddObsToHash( 'northward_current',  
     2558                                                    $KMLTimeStamp[$k], 
     2559                                                    $NCurrentDataVal, 
     2560                                                    1, 
     2561                                                    $strPlatformID, 
     2562                                                    $Height, 
     2563                                                    $strUnits, 
     2564                                                    $rObsHash ); 
     2565            }                                                     
    25572566          } 
    25582567        }                                             
     
    26672676          my $SigWaveHgtDataVal = 'NULL'; 
    26682677          my $Height = ''; 
    2669            
    2670           if ($significant_wave_height[$i]{'data'}[$j] != $missing_value_value 
    2671               && $significant_wave_height[$i]{'data'}[$j] != $Fill_value_value 
    2672               && $this_station_id_top_ts < $this_time_stamp_sec 
    2673               && $this_time_stamp_sec > $oldest_ok_timestamp)  
    2674           { 
    2675             if ($significant_wave_height[$i]{'height'} != $missing_value_value 
    2676                 && $significant_wave_height[$i]{'height'} != $Fill_value_value) 
    2677             { 
    2678               $Height = sprintf("%.2f",$significant_wave_height[$i]{'height'}); 
    2679             } 
     2678          if( $this_time_stamp_sec > $oldest_ok_timestamp ) 
     2679          {           
    26802680            if ($significant_wave_height[$i]{'data'}[$j] != $missing_value_value 
    26812681                && $significant_wave_height[$i]{'data'}[$j] != $Fill_value_value 
    2682                 && $significant_wave_height[$i]{'data'}[$j] != '')  
     2682                && $this_station_id_top_ts < $this_time_stamp_sec 
     2683                )  
    26832684            { 
    2684               $SigWaveHgtDataVal = sprintf("%.2f",$significant_wave_height[$i]{'data'}[$j]); 
    2685             } 
    2686             if ($dominant_wave_period[$i]{'data'}[$j] != $missing_value_value 
    2687               && $dominant_wave_period[$i]{'data'}[$j] != $Fill_value_value 
    2688               && $dominant_wave_period[$i]{'data'}[$j] != '')  
     2685              if ($significant_wave_height[$i]{'height'} != $missing_value_value 
     2686                  && $significant_wave_height[$i]{'height'} != $Fill_value_value) 
     2687              { 
     2688                $Height = sprintf("%.2f",$significant_wave_height[$i]{'height'}); 
     2689              } 
     2690              if ($significant_wave_height[$i]{'data'}[$j] != $missing_value_value 
     2691                  && $significant_wave_height[$i]{'data'}[$j] != $Fill_value_value 
     2692                  && $significant_wave_height[$i]{'data'}[$j] != '')  
     2693              { 
     2694                $SigWaveHgtDataVal = sprintf("%.2f",$significant_wave_height[$i]{'data'}[$j]); 
     2695              } 
     2696              if ($dominant_wave_period[$i]{'data'}[$j] != $missing_value_value 
     2697                && $dominant_wave_period[$i]{'data'}[$j] != $Fill_value_value 
     2698                && $dominant_wave_period[$i]{'data'}[$j] != '')  
     2699              { 
     2700                $DomWaveDataVal = sprintf("%.2f",$dominant_wave_period[$i]{'data'}[$j]); 
     2701              } 
     2702            } 
     2703            my $strUnits; 
     2704            $strUnits = obsKMLSubRoutines::UnitsStringConversion( $dominant_wave_period[$i]{'units'}, $XMLControlFile );       
     2705            if( length( $strUnits ) == 0 ) 
    26892706            { 
    2690               $DomWaveDataVal = sprintf("%.2f",$dominant_wave_period[$i]{'data'}[$j]); 
    2691             } 
    2692           } 
    2693           my $strUnits; 
    2694           $strUnits = obsKMLSubRoutines::UnitsStringConversion( $dominant_wave_period[$i]{'units'}, $XMLControlFile );       
    2695           if( length( $strUnits ) == 0 ) 
    2696           { 
    2697              $strUnits = obsKMLSubRoutines::CleanString( $dominant_wave_period[$i]{'units'} ); 
    2698           } 
    2699              
    2700           obsKMLSubRoutines::KMLAddObsToHash( 'dominant_wave_period',  
    2701                                               $KMLTimeStamp[$j], 
    2702                                               $DomWaveDataVal, 
    2703                                               1, 
    2704                                               $strPlatformID, 
    2705                                               $Height, 
    2706                                               $strUnits, 
    2707                                               $rObsHash ); 
    2708           $strUnits = ''; 
    2709           $strUnits = obsKMLSubRoutines::CleanString( obsKMLSubRoutines::UnitsStringConversion( $significant_wave_height[$i]{'units'}, $XMLControlFile ) ); 
    2710           if( length( $strUnits ) == 0 ) 
    2711           { 
    2712              $strUnits = $significant_wave_height[$i]{'units'}; 
    2713           } 
    2714           obsKMLSubRoutines::KMLAddObsToHash( 'significant_wave_height',  
    2715                                               $KMLTimeStamp[$j], 
    2716                                               $SigWaveHgtDataVal, 
    2717                                               1, 
    2718                                               $strPlatformID, 
    2719                                               $Height, 
    2720                                               $strUnits, 
    2721                                               $rObsHash ); 
     2707               $strUnits = obsKMLSubRoutines::CleanString( $dominant_wave_period[$i]{'units'} ); 
     2708            } 
     2709               
     2710            obsKMLSubRoutines::KMLAddObsToHash( 'dominant_wave_period',  
     2711                                                $KMLTimeStamp[$j], 
     2712                                                $DomWaveDataVal, 
     2713                                                1, 
     2714                                                $strPlatformID, 
     2715                                                $Height, 
     2716                                                $strUnits, 
     2717                                                $rObsHash ); 
     2718            $strUnits = ''; 
     2719            $strUnits = obsKMLSubRoutines::CleanString( obsKMLSubRoutines::UnitsStringConversion( $significant_wave_height[$i]{'units'}, $XMLControlFile ) ); 
     2720            if( length( $strUnits ) == 0 ) 
     2721            { 
     2722               $strUnits = $significant_wave_height[$i]{'units'}; 
     2723            } 
     2724            obsKMLSubRoutines::KMLAddObsToHash( 'significant_wave_height',  
     2725                                                $KMLTimeStamp[$j], 
     2726                                                $SigWaveHgtDataVal, 
     2727                                                1, 
     2728                                                $strPlatformID, 
     2729                                                $Height, 
     2730                                                $strUnits, 
     2731                                                $rObsHash ); 
     2732          }                                                   
    27222733        }         
    27232734      } 
     
    27272738  if( $bWriteobsKMLFile ) 
    27282739  { 
    2729     my $strXMLPath;  
    2730     #my $strDate = `date  +%Y-%m-%dT%H-%M-%S`; 
    2731     #chomp( $strDate );       
    2732     $strXMLPath = "$strObsKMLFilePath/$this_station_id"; 
    2733     $strXMLPath = $strXMLPath . '_latest.kml'; 
    2734     print( "XMLFilePath: $strXMLPath\n" ); 
    2735     obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath ); 
     2740    my $iCnt = keys( %ObsHash ); 
     2741    print( "Cnt: $iCnt\n" ); 
     2742    if( $iCnt ) 
     2743    { 
     2744      #DWR v1.1.0.0 
     2745      #Moved KMLAddPlatformHashEntry to after we process all the data so we can see if we actually had any data. I correctly implemented the time check 
     2746      #to verify the data is no older than 2 weeks. 
     2747      #Implemented code to write the obsKML files.  
     2748      obsKMLSubRoutines::KMLAddPlatformHashEntry( $strPlatformID, $institution_url_value, $latitude_value[0], $longitude_value[0], $rObsHash ); 
     2749       
     2750      my $strXMLPath;  
     2751      #my $strDate = `date  +%Y-%m-%dT%H-%M-%S`; 
     2752      #chomp( $strDate );       
     2753      $strXMLPath = "$strObsKMLFilePath/$this_station_id"; 
     2754      $strXMLPath = $strXMLPath . '_latest.kml'; 
     2755      print( "XMLFilePath: $strXMLPath\n" ); 
     2756      obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath ); 
     2757    } 
     2758    else 
     2759    { 
     2760      #DWR v1.1.0.0 
     2761      #Check to see if the last entry is older than our $oldest_ok_timestamp, if so let's log a message. 
     2762      my $this_time_stamp = $time_formatted_values[-1]; 
     2763      my $this_time_stamp_sec = timelocal(substr($this_time_stamp,17,2),substr($this_time_stamp,14,2),substr($this_time_stamp,11,2),substr($this_time_stamp,8,2),(substr($this_time_stamp,5,2)-1),substr($this_time_stamp,0,4)); 
     2764       
     2765      print( "fixed_point::Time Lag: Last Data Point Time:$this_time_stamp ($this_time_stamp_sec secs) Oldest allowed time: $oldest_ok_timestamp secs.\n" );      
     2766    } 
    27362767  } 
    27372768}