Changeset 184

Show
Ignore:
Timestamp:
04/15/08 12:32:48
Author:
dan
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • obskml/trunk/TelemetryToObsKML/BuoyTelemetryDataToObsKML.pl

    r162 r184  
     1#################################################################################################################### 
     2#Revisions 
     3# Author: DWR 
     4# Date: 4/15/2008 
     5# Version: 1.1 
     6# Changes: Implemented use of module obsKMLSubRoutines.pm to replace the obsKMLSubRoutines.lib. 
     7#################################################################################################################### 
    18#!/usr/bin/perl 
    29 
     
    411if( !MICROSOFT_PLATFORM ) 
    512{ 
    6   require "./obsKMLSubRoutines.lib"; 
     13  use lib "./"; #DWR 4/15/2008 Instead of using the library, it is now a module, so we need to look in current dir. 
     14  #require "./obsKMLSubRoutines.lib"; 
    715} 
    816else 
    917{ 
    10   require ".\\obsKMLSubRoutines.lib";   
     18  use lib ".\\"; #DWR 4/15/2008 Instead of using the library, it is now a module, so we need to look in current dir. 
     19  #require ".\\obsKMLSubRoutines.lib";   
    1120} 
    1221 
     
    1827use Config::IniFiles; 
    1928use Getopt::Long; 
    20  
     29use obsKMLSubRoutines; 
    2130 
    2231my %CommandLineOptions; 
     
    8695 
    8796  my %PlatformIDHash; 
    88   LoadPlatformControlFile($strControlFile, \%PlatformIDHash, $buoy_id); 
     97  obsKMLSubRoutines::LoadPlatformControlFile($strControlFile, \%PlatformIDHash, $buoy_id); 
    8998  my $XMLControlFile = XML::LibXML->new->parse_file("$strUnitsXMLFilename"); 
    9099 
     
    778787    my %PlatformObsSettings; 
    779788     
    780     GetPlatformData( \%PlatformIDHash, $buoy_id, \%PlatformObsSettings ); 
     789    obsKMLSubRoutines::GetPlatformData( \%PlatformIDHash, $buoy_id, \%PlatformObsSettings ); 
    781790    $strPlatformID = %PlatformObsSettings->{PlatformID}; 
    782791    $rObsHash->{PlatformID}{$strPlatformID}{Latitude} = $buoy_lat; 
     
    785794     
    786795    #( $strObsName, $strDate, $Value, $SensorSOrder, $rObsHash, $rPlatformControlFileInfo, $rPlatformObsSettings ) 
    787     KMLAddObsHashEntry( 'water_pressure', $strDBDate, $pcat_pressure, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    788     KMLAddObsHashEntry( 'water_depth', $strDBDate, ($pcat_pressure * 0.98), 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    789     KMLAddObsHashEntry( 'water_conductivity', $strDBDate, $pcat_conductivity, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    790     KMLAddObsHashEntry( 'water_temperature', $strDBDate, $pcat_temp, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    791     KMLAddObsHashEntry( 'salinity', $strDBDate, $pcat_salinity, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    792     KMLAddObsHashEntry( 'water_pressure', $strDBDate, $fcat_pressure, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    793     KMLAddObsHashEntry( 'water_depth', $strDBDate, ($fcat_pressure * 0.98), 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    794     KMLAddObsHashEntry( 'water_conductivity', $strDBDate, $fcat_conductivity, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    795     KMLAddObsHashEntry( 'water_temperature', $strDBDate, $fcat_temp, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    796     KMLAddObsHashEntry( 'salinity', $strDBDate, $fcat_salinity, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    797  
    798  
    799     KMLAddObsHashEntry( 'voltage', $strDBDate, $fcat_voltage, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     796    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_pressure', $strDBDate, $pcat_pressure, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     797    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_depth', $strDBDate, ($pcat_pressure * 0.98), 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     798    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_conductivity', $strDBDate, $pcat_conductivity, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     799    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_temperature', $strDBDate, $pcat_temp, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     800    obsKMLSubRoutines::KMLAddObsHashEntry( 'salinity', $strDBDate, $pcat_salinity, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     801    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_pressure', $strDBDate, $fcat_pressure, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     802    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_depth', $strDBDate, ($fcat_pressure * 0.98), 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     803    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_conductivity', $strDBDate, $fcat_conductivity, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     804    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_temperature', $strDBDate, $fcat_temp, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     805    obsKMLSubRoutines::KMLAddObsHashEntry( 'salinity', $strDBDate, $fcat_salinity, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     806 
     807 
     808    obsKMLSubRoutines::KMLAddObsHashEntry( 'voltage', $strDBDate, $fcat_voltage, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    800809    my $chlorophyll = undef; 
    801810    if( $fcat_voltage ne 'NULL') 
     
    832841      } 
    833842    } 
    834     KMLAddObsHashEntry( 'chl_concentration', $strDBDate, $chlorophyll, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     843    obsKMLSubRoutines::KMLAddObsHashEntry( 'chl_concentration', $strDBDate, $chlorophyll, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    835844 
    836845    # The current_speed is natively mm_s-1 however we want to store it in cm_s-1, so we convert. 
    837     GetObsData( \%PlatformIDHash, 'current_speed', 1, \%PlatformObsSettings ); 
     846    obsKMLSubRoutines::GetObsData( \%PlatformIDHash, 'current_speed', 1, \%PlatformObsSettings ); 
    838847    my $strCurrentUnits = %PlatformObsSettings->{UoM}; 
    839     my $ConvertedValue = MeasurementConvert($adcp_bin1_velocity, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    840      
    841     KMLAddObsHashEntry( 'current_speed', $strDBDate, $ConvertedValue, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    842     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin1_direction, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    843      
    844     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    845     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin2_velocity, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    846     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin2_direction, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    847      
    848     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    849     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin3_velocity, 3, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    850     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin3_direction, 3, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    851      
    852     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    853     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin4_velocity, 4, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    854     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin4_direction, 4, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    855      
    856     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    857     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin5_velocity, 5, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    858     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin5_direction, 5, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    859      
    860     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    861     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin6_velocity, 6, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    862     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin6_direction, 6, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    863      
    864     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    865     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin7_velocity, 7, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    866     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin7_direction, 7, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    867      
    868     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    869     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin8_velocity, 8, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    870     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin8_direction, 8, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    871      
    872     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    873     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin9_velocity, 9, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    874     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin9_direction, 9, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    875      
    876     $ConvertedValue = MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
    877     KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin10_velocity, 10, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    878     KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin10_direction, 10, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     848    my $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($adcp_bin1_velocity, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     849     
     850    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $ConvertedValue, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     851    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin1_direction, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     852     
     853    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     854    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin2_velocity, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     855    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin2_direction, 2, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     856     
     857    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     858    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin3_velocity, 3, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     859    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin3_direction, 3, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     860     
     861    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     862    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin4_velocity, 4, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     863    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin4_direction, 4, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     864     
     865    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     866    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin5_velocity, 5, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     867    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin5_direction, 5, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     868     
     869    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     870    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin6_velocity, 6, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     871    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin6_direction, 6, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     872     
     873    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     874    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin7_velocity, 7, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     875    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin7_direction, 7, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     876     
     877    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     878    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin8_velocity, 8, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     879    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin8_direction, 8, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     880     
     881    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     882    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin9_velocity, 9, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     883    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin9_direction, 9, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     884     
     885    $ConvertedValue = obsKMLSubRoutines::MeasurementConvert($ConvertedValue, 'mm_s-1', $strCurrentUnits, $XMLControlFile ); 
     886    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_speed', $strDBDate, $adcp_bin10_velocity, 10, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     887    obsKMLSubRoutines::KMLAddObsHashEntry( 'current_to_direction', $strDBDate, $adcp_bin10_direction, 10, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    879888 
    880889    #Weather pack. 
    881     KMLAddObsHashEntry( 'wind_speed', $strDBDate, $wxpak_wind_speed, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    882     KMLAddObsHashEntry( 'wind_from_direction', $strDBDate, $wxpak_wind_direction, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    883     KMLAddObsHashEntry( 'wind_gust', $strDBDate, $wxpak_wind_gust, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    884     KMLAddObsHashEntry( 'air_temperature', $strDBDate, $wxpak_air_temp, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    885     KMLAddObsHashEntry( 'relative_humidity', $strDBDate, $wxpak_humidity, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    886     KMLAddObsHashEntry( 'air_pressure', $strDBDate, $wxpak_air_pressure, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    887     KMLAddObsHashEntry( 'solar_radiation', $strDBDate, $wxpak_solar, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    888     KMLAddObsHashEntry( 'visibility', $strDBDate, $buoy_visibility, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     890    obsKMLSubRoutines::KMLAddObsHashEntry( 'wind_speed', $strDBDate, $wxpak_wind_speed, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     891    obsKMLSubRoutines::KMLAddObsHashEntry( 'wind_from_direction', $strDBDate, $wxpak_wind_direction, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     892    obsKMLSubRoutines::KMLAddObsHashEntry( 'wind_gust', $strDBDate, $wxpak_wind_gust, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     893    obsKMLSubRoutines::KMLAddObsHashEntry( 'air_temperature', $strDBDate, $wxpak_air_temp, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     894    obsKMLSubRoutines::KMLAddObsHashEntry( 'relative_humidity', $strDBDate, $wxpak_humidity, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     895    obsKMLSubRoutines::KMLAddObsHashEntry( 'air_pressure', $strDBDate, $wxpak_air_pressure, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     896    obsKMLSubRoutines::KMLAddObsHashEntry( 'solar_radiation', $strDBDate, $wxpak_solar, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     897    obsKMLSubRoutines::KMLAddObsHashEntry( 'visibility', $strDBDate, $buoy_visibility, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    889898 
    890899     
     
    904913    } 
    905914 
    906     BuildKMLFile( \%ObsHash, $strXMLPath, $strControlFile ); 
     915    obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath, $strControlFile ); 
    907916         
    908917        }  #foreach $record (<BUOY_FILE)  
     
    924933 
    925934  my %PlatformIDHash; 
    926   LoadPlatformControlFile($strControlFile, \%PlatformIDHash, $station_id); 
     935  obsKMLSubRoutines::LoadPlatformControlFile($strControlFile, \%PlatformIDHash, $station_id); 
    927936 
    928937        #the following code reads 0,1,many lines of buoy updates, ignoring lines starting with # and partial lines 
     
    10411050    my %PlatformObsSettings; 
    10421051 
    1043     GetPlatformData( \%PlatformIDHash, $station_id, \%PlatformObsSettings ); 
     1052    obsKMLSubRoutines::GetPlatformData( \%PlatformIDHash, $station_id, \%PlatformObsSettings ); 
    10441053    $strPlatformID = %PlatformObsSettings->{PlatformID}; 
    10451054    
    1046     KMLAddPlatformHashEntry( %PlatformObsSettings->{PlatformID}, %PlatformObsSettings->{PlatformURL}, '', '', $rObsHash ); 
     1055    obsKMLSubRoutines::KMLAddPlatformHashEntry( %PlatformObsSettings->{PlatformID}, %PlatformObsSettings->{PlatformURL}, '', '', $rObsHash ); 
    10471056    #( $strObsName, $strDate, $Value, $SensorSOrder, $rObsHash, $rPlatformControlFileInfo, $rPlatformObsSettings ) 
    1048     KMLAddObsHashEntry( 'water_level', $strDBDate, $water_level, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    1049     KMLAddObsHashEntry( 'wind_speed', $strDBDate, $wind_speed, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    1050     KMLAddObsHashEntry( 'wind_from_direction', $strDBDate, $wind_direction, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    1051     KMLAddObsHashEntry( 'wind_gust', $strDBDate, $wind_gust, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    1052     KMLAddObsHashEntry( 'air_temperature', $strDBDate, $air_temperature, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    1053     KMLAddObsHashEntry( 'air_pressure', $strDBDate, $air_pressure, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    1054     KMLAddObsHashEntry( 'water_temperature', $strDBDate, $water_temperature, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1057    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_level', $strDBDate, $water_level, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1058    obsKMLSubRoutines::KMLAddObsHashEntry( 'wind_speed', $strDBDate, $wind_speed, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1059    obsKMLSubRoutines::KMLAddObsHashEntry( 'wind_from_direction', $strDBDate, $wind_direction, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1060    obsKMLSubRoutines::KMLAddObsHashEntry( 'wind_gust', $strDBDate, $wind_gust, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1061    obsKMLSubRoutines::KMLAddObsHashEntry( 'air_temperature', $strDBDate, $air_temperature, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1062    obsKMLSubRoutines::KMLAddObsHashEntry( 'air_pressure', $strDBDate, $air_pressure, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
     1063    obsKMLSubRoutines::KMLAddObsHashEntry( 'water_temperature', $strDBDate, $water_temperature, 1, $rObsHash, \%PlatformIDHash, \%PlatformObsSettings ); 
    10551064 
    10561065    my $strXMLPath = '';  
     
    10691078    } 
    10701079 
    1071     BuildKMLFile( \%ObsHash, $strXMLPath, $strControlFile ); 
     1080    obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath, $strControlFile ); 
    10721081 
    10731082  }