| 1729 | 1715 | $this_time_stamp = $time_formatted_values[$j]; |
|---|
| 1730 | 1716 | $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)); |
|---|
| 1731 | | |
|---|
| 1732 | | if ($water_level[$i]{'data'}[$j] != $missing_value_value |
|---|
| 1733 | | && $water_level[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 1734 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 1735 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 1736 | | { |
|---|
| 1737 | | |
|---|
| 1738 | | #DWR 4/3/2008 |
|---|
| 1739 | | if ($water_level[$i]{'height'} != $missing_value_value |
|---|
| 1740 | | && $water_level[$i]{'height'} != $Fill_value_value) |
|---|
| | 1717 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 1718 | { |
|---|
| | 1719 | if ($water_level[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 1720 | && $water_level[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 1721 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 1722 | ) |
|---|
| 1742 | | $this_val = sprintf("%.2f",$water_level[$i]{'height'}); |
|---|
| 1743 | | $Height = $this_val; |
|---|
| 1744 | | } |
|---|
| 1745 | | $this_val = sprintf("%.2f",$water_level[$i]{'data'}[$j]); |
|---|
| 1746 | | |
|---|
| 1747 | | $DataVal = $water_level[$i]{'reference'}; |
|---|
| 1748 | | |
|---|
| 1749 | | if (length $water_level[$i]{'reference_to_mllw'} > 0) { |
|---|
| 1750 | | $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_mllw'}); |
|---|
| 1751 | | } |
|---|
| 1752 | | else { |
|---|
| 1753 | | $this_val = 'NULL'; |
|---|
| 1754 | | } |
|---|
| 1755 | | $MLLWDataVal = $this_val; |
|---|
| 1756 | | |
|---|
| 1757 | | if (length $water_level[$i]{'reference_to_msl'} > 0) { |
|---|
| 1758 | | $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_msl'}); |
|---|
| 1759 | | } |
|---|
| 1760 | | else { |
|---|
| 1761 | | $this_val = 'NULL'; |
|---|
| 1762 | | } |
|---|
| 1763 | | $MSLDataVal = $this_val; |
|---|
| 1764 | | |
|---|
| 1765 | | if (length $water_level[$i]{'reference_to_navd88'} > 0) { |
|---|
| 1766 | | $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_navd88'}); |
|---|
| 1767 | | } |
|---|
| 1768 | | else { |
|---|
| 1769 | | $this_val = 'NULL'; |
|---|
| 1770 | | } |
|---|
| 1771 | | #DWR 4/5/2008 |
|---|
| 1772 | | $NavD88DataVal = $this_val; |
|---|
| 1773 | | } |
|---|
| 1774 | | obsKMLSubRoutines::KMLAddObsToHash( 'water_level', |
|---|
| 1775 | | $KMLTimeStamp[$j], |
|---|
| 1776 | | $MLLWDataVal, |
|---|
| 1777 | | 1, |
|---|
| 1778 | | $strPlatformID, |
|---|
| 1779 | | $Height, |
|---|
| 1780 | | 'm(MLLW)', |
|---|
| 1781 | | $rObsHash ); |
|---|
| 1782 | | obsKMLSubRoutines::KMLAddObsToHash( 'water_level', |
|---|
| 1783 | | $KMLTimeStamp[$j], |
|---|
| 1784 | | $MSLDataVal, |
|---|
| 1785 | | 2, |
|---|
| 1786 | | $strPlatformID, |
|---|
| 1787 | | $Height, |
|---|
| 1788 | | 'm(MSL)', |
|---|
| 1789 | | $rObsHash ); |
|---|
| 1790 | | obsKMLSubRoutines::KMLAddObsToHash( 'water_level', |
|---|
| 1791 | | $KMLTimeStamp[$j], |
|---|
| 1792 | | $NavD88DataVal, |
|---|
| 1793 | | 3, |
|---|
| 1794 | | $strPlatformID, |
|---|
| 1795 | | $Height, |
|---|
| 1796 | | 'm(NAVD88)', |
|---|
| 1797 | | $rObsHash ); |
|---|
| | 1724 | |
|---|
| | 1725 | #DWR 4/3/2008 |
|---|
| | 1726 | if ($water_level[$i]{'height'} != $missing_value_value |
|---|
| | 1727 | && $water_level[$i]{'height'} != $Fill_value_value) |
|---|
| | 1728 | { |
|---|
| | 1729 | $this_val = sprintf("%.2f",$water_level[$i]{'height'}); |
|---|
| | 1730 | $Height = $this_val; |
|---|
| | 1731 | } |
|---|
| | 1732 | $this_val = sprintf("%.2f",$water_level[$i]{'data'}[$j]); |
|---|
| | 1733 | |
|---|
| | 1734 | $DataVal = $water_level[$i]{'reference'}; |
|---|
| | 1735 | |
|---|
| | 1736 | if (length $water_level[$i]{'reference_to_mllw'} > 0) { |
|---|
| | 1737 | $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_mllw'}); |
|---|
| | 1738 | } |
|---|
| | 1739 | else { |
|---|
| | 1740 | $this_val = 'NULL'; |
|---|
| | 1741 | } |
|---|
| | 1742 | $MLLWDataVal = $this_val; |
|---|
| | 1743 | |
|---|
| | 1744 | if (length $water_level[$i]{'reference_to_msl'} > 0) { |
|---|
| | 1745 | $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_msl'}); |
|---|
| | 1746 | } |
|---|
| | 1747 | else { |
|---|
| | 1748 | $this_val = 'NULL'; |
|---|
| | 1749 | } |
|---|
| | 1750 | $MSLDataVal = $this_val; |
|---|
| | 1751 | |
|---|
| | 1752 | if (length $water_level[$i]{'reference_to_navd88'} > 0) { |
|---|
| | 1753 | $this_val = sprintf("%.2f",$water_level[$i]{'reference_to_navd88'}); |
|---|
| | 1754 | } |
|---|
| | 1755 | else { |
|---|
| | 1756 | $this_val = 'NULL'; |
|---|
| | 1757 | } |
|---|
| | 1758 | #DWR 4/5/2008 |
|---|
| | 1759 | $NavD88DataVal = $this_val; |
|---|
| | 1760 | } |
|---|
| | 1761 | obsKMLSubRoutines::KMLAddObsToHash( 'water_level', |
|---|
| | 1762 | $KMLTimeStamp[$j], |
|---|
| | 1763 | $MLLWDataVal, |
|---|
| | 1764 | 1, |
|---|
| | 1765 | $strPlatformID, |
|---|
| | 1766 | $Height, |
|---|
| | 1767 | 'm(MLLW)', |
|---|
| | 1768 | $rObsHash ); |
|---|
| | 1769 | obsKMLSubRoutines::KMLAddObsToHash( 'water_level', |
|---|
| | 1770 | $KMLTimeStamp[$j], |
|---|
| | 1771 | $MSLDataVal, |
|---|
| | 1772 | 2, |
|---|
| | 1773 | $strPlatformID, |
|---|
| | 1774 | $Height, |
|---|
| | 1775 | 'm(MSL)', |
|---|
| | 1776 | $rObsHash ); |
|---|
| | 1777 | obsKMLSubRoutines::KMLAddObsToHash( 'water_level', |
|---|
| | 1778 | $KMLTimeStamp[$j], |
|---|
| | 1779 | $NavD88DataVal, |
|---|
| | 1780 | 3, |
|---|
| | 1781 | $strPlatformID, |
|---|
| | 1782 | $Height, |
|---|
| | 1783 | 'm(NAVD88)', |
|---|
| | 1784 | $rObsHash ); |
|---|
| | 1785 | } |
|---|
| 1895 | 1883 | $this_time_stamp = $time_formatted_values[$j]; |
|---|
| 1896 | 1884 | $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)); |
|---|
| 1897 | | |
|---|
| 1898 | | if ($sea_surface_temperature[$i]{'data'}[$j] != $missing_value_value |
|---|
| 1899 | | && $sea_surface_temperature[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 1900 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 1901 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 1902 | | { |
|---|
| 1903 | | |
|---|
| 1904 | | if ($sea_surface_temperature[$i]{'height'} != $missing_value_value |
|---|
| 1905 | | && $sea_surface_temperature[$i]{'height'} != $Fill_value_value) |
|---|
| | 1885 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 1886 | { |
|---|
| | 1887 | if ($sea_surface_temperature[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 1888 | && $sea_surface_temperature[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 1889 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 1890 | ) |
|---|
| 1907 | | $Height = sprintf("%.2f",$sea_surface_temperature[$i]{'height'}); |
|---|
| 1908 | | } |
|---|
| 1909 | | $DataVal = sprintf("%.2f",$sea_surface_temperature[$i]{'data'}[$j]); |
|---|
| 1910 | | |
|---|
| 1911 | | } |
|---|
| 1912 | | my $strUnits; |
|---|
| 1913 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_temperature[$i]{'units'}, $XMLControlFile ); |
|---|
| 1914 | | if( length( $strUnits ) == 0 ) |
|---|
| 1915 | | { |
|---|
| 1916 | | #DWR v1.1.0.0 |
|---|
| 1917 | | #Make sure we don't have any unprintable characters. |
|---|
| 1918 | | $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_temperature[$i]{'units'} ); |
|---|
| 1919 | | } |
|---|
| 1920 | | obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature', |
|---|
| 1921 | | $KMLTimeStamp[$j], |
|---|
| 1922 | | $DataVal, |
|---|
| 1923 | | 1, |
|---|
| 1924 | | $strPlatformID, |
|---|
| 1925 | | $Height, |
|---|
| 1926 | | $strUnits, |
|---|
| 1927 | | $rObsHash ); |
|---|
| | 1892 | |
|---|
| | 1893 | if ($sea_surface_temperature[$i]{'height'} != $missing_value_value |
|---|
| | 1894 | && $sea_surface_temperature[$i]{'height'} != $Fill_value_value) |
|---|
| | 1895 | { |
|---|
| | 1896 | $Height = sprintf("%.2f",$sea_surface_temperature[$i]{'height'}); |
|---|
| | 1897 | } |
|---|
| | 1898 | $DataVal = sprintf("%.2f",$sea_surface_temperature[$i]{'data'}[$j]); |
|---|
| | 1899 | |
|---|
| | 1900 | } |
|---|
| | 1901 | my $strUnits; |
|---|
| | 1902 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_temperature[$i]{'units'}, $XMLControlFile ); |
|---|
| | 1903 | if( length( $strUnits ) == 0 ) |
|---|
| | 1904 | { |
|---|
| | 1905 | #DWR v1.1.0.0 |
|---|
| | 1906 | #Make sure we don't have any unprintable characters. |
|---|
| | 1907 | $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_temperature[$i]{'units'} ); |
|---|
| | 1908 | } |
|---|
| | 1909 | obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature', |
|---|
| | 1910 | $KMLTimeStamp[$j], |
|---|
| | 1911 | $DataVal, |
|---|
| | 1912 | 1, |
|---|
| | 1913 | $strPlatformID, |
|---|
| | 1914 | $Height, |
|---|
| | 1915 | $strUnits, |
|---|
| | 1916 | $rObsHash ); |
|---|
| | 1917 | } |
|---|
| 2022 | 2012 | $this_time_stamp = $time_formatted_values[$j]; |
|---|
| 2023 | 2013 | $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)); |
|---|
| 2033 | | $Height = sprintf("%.2f",$sea_bottom_temperature[$i]{'height'}); |
|---|
| 2034 | | } |
|---|
| 2035 | | $DataVal = sprintf("%.2f",$sea_bottom_temperature[$i]{'data'}[$j]); |
|---|
| 2036 | | |
|---|
| 2037 | | } |
|---|
| 2038 | | my $strUnits; |
|---|
| 2039 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_bottom_temperature[$i]{'units'}, $XMLControlFile ); |
|---|
| 2040 | | if( length( $strUnits ) == 0 ) |
|---|
| 2041 | | { |
|---|
| 2042 | | #DWR v1.1.0.0 |
|---|
| 2043 | | #Make sure we don't have any unprintable characters. |
|---|
| 2044 | | $strUnits = obsKMLSubRoutines::CleanString( $sea_bottom_temperature[$i]{'units'} ); |
|---|
| 2045 | | } |
|---|
| 2046 | | obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature', |
|---|
| 2047 | | $KMLTimeStamp[$j], |
|---|
| 2048 | | $DataVal, |
|---|
| 2049 | | 2, |
|---|
| 2050 | | $strPlatformID, |
|---|
| 2051 | | $Height, |
|---|
| 2052 | | $strUnits, |
|---|
| 2053 | | $rObsHash ); |
|---|
| | 2021 | |
|---|
| | 2022 | if ($sea_bottom_temperature[$i]{'height'} != $missing_value_value |
|---|
| | 2023 | && $sea_bottom_temperature[$i]{'height'} != $Fill_value_value) |
|---|
| | 2024 | { |
|---|
| | 2025 | $Height = sprintf("%.2f",$sea_bottom_temperature[$i]{'height'}); |
|---|
| | 2026 | } |
|---|
| | 2027 | $DataVal = sprintf("%.2f",$sea_bottom_temperature[$i]{'data'}[$j]); |
|---|
| | 2028 | |
|---|
| | 2029 | } |
|---|
| | 2030 | my $strUnits; |
|---|
| | 2031 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_bottom_temperature[$i]{'units'}, $XMLControlFile ); |
|---|
| | 2032 | if( length( $strUnits ) == 0 ) |
|---|
| | 2033 | { |
|---|
| | 2034 | #DWR v1.1.0.0 |
|---|
| | 2035 | #Make sure we don't have any unprintable characters. |
|---|
| | 2036 | $strUnits = obsKMLSubRoutines::CleanString( $sea_bottom_temperature[$i]{'units'} ); |
|---|
| | 2037 | } |
|---|
| | 2038 | obsKMLSubRoutines::KMLAddObsToHash( 'water_temperature', |
|---|
| | 2039 | $KMLTimeStamp[$j], |
|---|
| | 2040 | $DataVal, |
|---|
| | 2041 | 2, |
|---|
| | 2042 | $strPlatformID, |
|---|
| | 2043 | $Height, |
|---|
| | 2044 | $strUnits, |
|---|
| | 2045 | $rObsHash ); |
|---|
| | 2046 | } |
|---|
| 2136 | 2129 | $this_time_stamp = $time_formatted_values[$j]; |
|---|
| 2137 | 2130 | $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)); |
|---|
| 2138 | | |
|---|
| 2139 | | if ($air_temperature[$i]{'data'}[$j] != $missing_value_value |
|---|
| 2140 | | && $air_temperature[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 2141 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 2142 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 2143 | | { |
|---|
| 2144 | | |
|---|
| 2145 | | if ($air_temperature[$i]{'height'} != $missing_value_value |
|---|
| 2146 | | && $air_temperature[$i]{'height'} != $Fill_value_value) |
|---|
| | 2131 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 2132 | { |
|---|
| | 2133 | if ($air_temperature[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 2134 | && $air_temperature[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 2135 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 2136 | ) |
|---|
| 2148 | | $Height = sprintf("%.2f",$air_temperature[$i]{'height'}); |
|---|
| 2149 | | } |
|---|
| 2150 | | $DataVal = sprintf("%.2f",$air_temperature[$i]{'data'}[$j]); |
|---|
| 2151 | | |
|---|
| 2152 | | } |
|---|
| 2153 | | my $strUnits; |
|---|
| 2154 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_temperature[$i]{'units'}, $XMLControlFile ); |
|---|
| 2155 | | if( length( $strUnits ) == 0 ) |
|---|
| 2156 | | { |
|---|
| 2157 | | #DWR v1.1.0.0 |
|---|
| 2158 | | #Make sure we don't have any unprintable characters. |
|---|
| 2159 | | $strUnits = obsKMLSubRoutines::CleanString( $air_temperature[$i]{'units'} ); |
|---|
| 2160 | | |
|---|
| 2161 | | } |
|---|
| 2162 | | obsKMLSubRoutines::KMLAddObsToHash( 'air_temperature', |
|---|
| 2163 | | $KMLTimeStamp[$j], |
|---|
| 2164 | | $DataVal, |
|---|
| 2165 | | 1, |
|---|
| 2166 | | $strPlatformID, |
|---|
| 2167 | | $Height, |
|---|
| 2168 | | $strUnits, |
|---|
| 2169 | | $rObsHash ); |
|---|
| | 2138 | |
|---|
| | 2139 | if ($air_temperature[$i]{'height'} != $missing_value_value |
|---|
| | 2140 | && $air_temperature[$i]{'height'} != $Fill_value_value) |
|---|
| | 2141 | { |
|---|
| | 2142 | $Height = sprintf("%.2f",$air_temperature[$i]{'height'}); |
|---|
| | 2143 | } |
|---|
| | 2144 | $DataVal = sprintf("%.2f",$air_temperature[$i]{'data'}[$j]); |
|---|
| | 2145 | |
|---|
| | 2146 | } |
|---|
| | 2147 | my $strUnits; |
|---|
| | 2148 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_temperature[$i]{'units'}, $XMLControlFile ); |
|---|
| | 2149 | if( length( $strUnits ) == 0 ) |
|---|
| | 2150 | { |
|---|
| | 2151 | #DWR v1.1.0.0 |
|---|
| | 2152 | #Make sure we don't have any unprintable characters. |
|---|
| | 2153 | $strUnits = obsKMLSubRoutines::CleanString( $air_temperature[$i]{'units'} ); |
|---|
| | 2154 | |
|---|
| | 2155 | } |
|---|
| | 2156 | obsKMLSubRoutines::KMLAddObsToHash( 'air_temperature', |
|---|
| | 2157 | $KMLTimeStamp[$j], |
|---|
| | 2158 | $DataVal, |
|---|
| | 2159 | 1, |
|---|
| | 2160 | $strPlatformID, |
|---|
| | 2161 | $Height, |
|---|
| | 2162 | $strUnits, |
|---|
| | 2163 | $rObsHash ); |
|---|
| | 2164 | } |
|---|
| 2315 | | if ($wind_speed[$i]{'data'}[$k] != $missing_value_value |
|---|
| 2316 | | && $wind_speed[$i]{'data'}[$k] != $Fill_value_value |
|---|
| 2317 | | && $wind_from_direction[$j]{'data'}[$k] != $missing_value_value |
|---|
| 2318 | | && $wind_from_direction[$j]{'data'}[$k] != $Fill_value_value |
|---|
| 2319 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 2320 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 2321 | | { |
|---|
| 2322 | | if ($wind_speed[$i]{'height'} != $missing_value_value |
|---|
| 2323 | | && $wind_speed[$i]{'height'} != $Fill_value_value) |
|---|
| | 2310 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 2311 | { |
|---|
| | 2312 | if ($wind_speed[$i]{'data'}[$k] != $missing_value_value |
|---|
| | 2313 | && $wind_speed[$i]{'data'}[$k] != $Fill_value_value |
|---|
| | 2314 | && $wind_from_direction[$j]{'data'}[$k] != $missing_value_value |
|---|
| | 2315 | && $wind_from_direction[$j]{'data'}[$k] != $Fill_value_value |
|---|
| | 2316 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 2317 | ) |
|---|
| 2325 | | $Height = sprintf("%.2f",$wind_speed[$i]{'height'}); |
|---|
| | 2319 | if ($wind_speed[$i]{'height'} != $missing_value_value |
|---|
| | 2320 | && $wind_speed[$i]{'height'} != $Fill_value_value) |
|---|
| | 2321 | { |
|---|
| | 2322 | $Height = sprintf("%.2f",$wind_speed[$i]{'height'}); |
|---|
| | 2323 | } |
|---|
| | 2324 | |
|---|
| | 2325 | $this_val = sprintf("%.2f",$wind_speed[$i]{'data'}[$k]); |
|---|
| | 2326 | if( length( $this_val ) > 0 ) |
|---|
| | 2327 | { |
|---|
| | 2328 | $WindSpdDataVal = $this_val; |
|---|
| | 2329 | } |
|---|
| | 2330 | |
|---|
| | 2331 | if ($wind_gust[$j]{'data'}[$k] != $missing_value_value |
|---|
| | 2332 | && $wind_gust[$j]{'data'}[$k] != $Fill_value_value |
|---|
| | 2333 | && $wind_gust[$j]{'data'}[$k] != '') |
|---|
| | 2334 | { |
|---|
| | 2335 | $WindGstDataVal = sprintf("%.2f",$wind_gust[$j]{'data'}[$k]); |
|---|
| | 2336 | } |
|---|
| | 2337 | |
|---|
| | 2338 | $this_val = sprintf("%.2f",$wind_from_direction[$j]{'data'}[$k]); |
|---|
| | 2339 | #DWR 4/5/2008 |
|---|
| | 2340 | if( length( $this_val ) > 0 ) |
|---|
| | 2341 | { |
|---|
| | 2342 | $WindDirDataVal = $this_val; |
|---|
| | 2343 | } |
|---|
| 2345 | | $WindDirDataVal = $this_val; |
|---|
| 2346 | | } |
|---|
| 2347 | | } |
|---|
| 2348 | | my $strUnits; |
|---|
| 2349 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_speed[$i]{'units'}, $XMLControlFile ); |
|---|
| 2350 | | if( length( $strUnits ) == 0 ) |
|---|
| 2351 | | { |
|---|
| 2352 | | #DWR v1.1.0.0 |
|---|
| 2353 | | #Make sure we don't have any unprintable characters. |
|---|
| 2354 | | $strUnits = obsKMLSubRoutines::CleanString( $wind_speed[$i]{'units'} ); |
|---|
| 2355 | | |
|---|
| 2356 | | } |
|---|
| 2357 | | |
|---|
| 2358 | | obsKMLSubRoutines::KMLAddObsToHash( 'wind_speed', |
|---|
| 2359 | | $KMLTimeStamp[$k], |
|---|
| 2360 | | $WindSpdDataVal, |
|---|
| 2361 | | 1, |
|---|
| 2362 | | $strPlatformID, |
|---|
| 2363 | | $Height, |
|---|
| 2364 | | $strUnits, |
|---|
| 2365 | | $rObsHash ); |
|---|
| 2366 | | $strUnits = ''; |
|---|
| 2367 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_from_direction[$i]{'units'}, $XMLControlFile ); |
|---|
| 2368 | | if( length( $strUnits ) == 0 ) |
|---|
| 2369 | | { |
|---|
| 2370 | | #DWR v1.1.0.0 |
|---|
| 2371 | | #Make sure we don't have any unprintable characters. |
|---|
| 2372 | | $strUnits = obsKMLSubRoutines::CleanString( $wind_from_direction[$i]{'units'} ); |
|---|
| 2373 | | } |
|---|
| 2374 | | obsKMLSubRoutines::KMLAddObsToHash( 'wind_from_direction', |
|---|
| 2375 | | $KMLTimeStamp[$k], |
|---|
| 2376 | | $WindDirDataVal, |
|---|
| 2377 | | 1, |
|---|
| 2378 | | $strPlatformID, |
|---|
| 2379 | | $Height, |
|---|
| 2380 | | $strUnits, |
|---|
| 2381 | | $rObsHash ); |
|---|
| 2382 | | $strUnits = ''; |
|---|
| 2383 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_gust[$i]{'units'}, $XMLControlFile ); |
|---|
| 2384 | | if( length( $strUnits ) == 0 ) |
|---|
| 2385 | | { |
|---|
| 2386 | | #DWR v1.1.0.0 |
|---|
| 2387 | | #Make sure we don't have any unprintable characters. |
|---|
| 2388 | | $strUnits = obsKMLSubRoutines::CleanString( $wind_gust[$i]{'units'} ); |
|---|
| 2389 | | } |
|---|
| 2390 | | obsKMLSubRoutines::KMLAddObsToHash( 'wind_gust', |
|---|
| 2391 | | $KMLTimeStamp[$k], |
|---|
| 2392 | | $WindGstDataVal, |
|---|
| 2393 | | 1, |
|---|
| 2394 | | $strPlatformID, |
|---|
| 2395 | | $Height, |
|---|
| 2396 | | $strUnits, |
|---|
| 2397 | | $rObsHash ); |
|---|
| | 2367 | #DWR v1.1.0.0 |
|---|
| | 2368 | #Make sure we don't have any unprintable characters. |
|---|
| | 2369 | $strUnits = obsKMLSubRoutines::CleanString( $wind_from_direction[$i]{'units'} ); |
|---|
| | 2370 | } |
|---|
| | 2371 | obsKMLSubRoutines::KMLAddObsToHash( 'wind_from_direction', |
|---|
| | 2372 | $KMLTimeStamp[$k], |
|---|
| | 2373 | $WindDirDataVal, |
|---|
| | 2374 | 1, |
|---|
| | 2375 | $strPlatformID, |
|---|
| | 2376 | $Height, |
|---|
| | 2377 | $strUnits, |
|---|
| | 2378 | $rObsHash ); |
|---|
| | 2379 | $strUnits = ''; |
|---|
| | 2380 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $wind_gust[$i]{'units'}, $XMLControlFile ); |
|---|
| | 2381 | if( length( $strUnits ) == 0 ) |
|---|
| | 2382 | { |
|---|
| | 2383 | #DWR v1.1.0.0 |
|---|
| | 2384 | #Make sure we don't have any unprintable characters. |
|---|
| | 2385 | $strUnits = obsKMLSubRoutines::CleanString( $wind_gust[$i]{'units'} ); |
|---|
| | 2386 | } |
|---|
| | 2387 | obsKMLSubRoutines::KMLAddObsToHash( 'wind_gust', |
|---|
| | 2388 | $KMLTimeStamp[$k], |
|---|
| | 2389 | $WindGstDataVal, |
|---|
| | 2390 | 1, |
|---|
| | 2391 | $strPlatformID, |
|---|
| | 2392 | $Height, |
|---|
| | 2393 | $strUnits, |
|---|
| | 2394 | $rObsHash ); |
|---|
| | 2395 | } |
|---|
| 2485 | | if ($air_pressure[$i]{'data'}[$j] != $missing_value_value |
|---|
| 2486 | | && $air_pressure[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 2487 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 2488 | | && $this_time_stamp_sec > $oldest_ok_timestamp) { |
|---|
| 2489 | | if ($air_pressure[$i]{'height'} != $missing_value_value |
|---|
| 2490 | | && $air_pressure[$i]{'height'} != $Fill_value_value) |
|---|
| | 2483 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 2484 | { |
|---|
| | 2485 | if ($air_pressure[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 2486 | && $air_pressure[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 2487 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 2488 | ) { |
|---|
| | 2489 | if ($air_pressure[$i]{'height'} != $missing_value_value |
|---|
| | 2490 | && $air_pressure[$i]{'height'} != $Fill_value_value) |
|---|
| | 2491 | { |
|---|
| | 2492 | $Height = sprintf("%.2f",$air_pressure[$i]{'height'}); |
|---|
| | 2493 | } |
|---|
| | 2494 | $DataVal = sprintf("%.2f",$air_pressure[$i]{'data'}[$j]); |
|---|
| | 2495 | } |
|---|
| | 2496 | #DWR 4/3/2008 |
|---|
| | 2497 | my $strUnits; |
|---|
| | 2498 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_pressure[$i]{'units'}, $XMLControlFile ); |
|---|
| | 2499 | if( length( $strUnits ) == 0 ) |
|---|
| 2492 | | $Height = sprintf("%.2f",$air_pressure[$i]{'height'}); |
|---|
| 2493 | | } |
|---|
| 2494 | | $DataVal = sprintf("%.2f",$air_pressure[$i]{'data'}[$j]); |
|---|
| 2495 | | } |
|---|
| 2496 | | #DWR 4/3/2008 |
|---|
| 2497 | | my $strUnits; |
|---|
| 2498 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $air_pressure[$i]{'units'}, $XMLControlFile ); |
|---|
| 2499 | | if( length( $strUnits ) == 0 ) |
|---|
| 2500 | | { |
|---|
| 2501 | | #DWR v1.1.0.0 |
|---|
| 2502 | | #Make sure we don't have any unprintable characters. |
|---|
| 2503 | | $strUnits = obsKMLSubRoutines::CleanString( $air_pressure[$i]{'units'} ); |
|---|
| 2504 | | } |
|---|
| 2505 | | obsKMLSubRoutines::KMLAddObsToHash( 'air_pressure', |
|---|
| 2506 | | $KMLTimeStamp[$j], |
|---|
| 2507 | | $DataVal, |
|---|
| 2508 | | 1, |
|---|
| 2509 | | $strPlatformID, |
|---|
| 2510 | | $Height, |
|---|
| 2511 | | $strUnits, |
|---|
| 2512 | | $rObsHash ); |
|---|
| | 2501 | #DWR v1.1.0.0 |
|---|
| | 2502 | #Make sure we don't have any unprintable characters. |
|---|
| | 2503 | $strUnits = obsKMLSubRoutines::CleanString( $air_pressure[$i]{'units'} ); |
|---|
| | 2504 | } |
|---|
| | 2505 | obsKMLSubRoutines::KMLAddObsToHash( 'air_pressure', |
|---|
| | 2506 | $KMLTimeStamp[$j], |
|---|
| | 2507 | $DataVal, |
|---|
| | 2508 | 1, |
|---|
| | 2509 | $strPlatformID, |
|---|
| | 2510 | $Height, |
|---|
| | 2511 | $strUnits, |
|---|
| | 2512 | $rObsHash ); |
|---|
| | 2513 | } |
|---|
| 2599 | | if ($salinity[$i]{'data'}[$j] != $missing_value_value |
|---|
| 2600 | | && $salinity[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 2601 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 2602 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 2603 | | { |
|---|
| 2604 | | if ($salinity[$i]{'height'} != $missing_value_value |
|---|
| 2605 | | && $salinity[$i]{'height'} != $Fill_value_value) |
|---|
| | 2600 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 2601 | { |
|---|
| | 2602 | if ($salinity[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 2603 | && $salinity[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 2604 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 2605 | ) |
|---|
| 2607 | | $Height = sprintf("%.2f",$salinity[$i]{'height'}); |
|---|
| 2608 | | } |
|---|
| 2609 | | $DataVal = sprintf("%.2f",$salinity[$i]{'data'}[$j]); |
|---|
| 2610 | | } |
|---|
| 2611 | | my $strUnits; |
|---|
| 2612 | | if( lc( $salinity[$i]{'units'} ) eq 'ppt' ) |
|---|
| 2613 | | { |
|---|
| 2614 | | $strUnits = 'psu'; |
|---|
| 2615 | | } |
|---|
| 2616 | | if( length( $strUnits ) == 0 ) |
|---|
| 2617 | | { |
|---|
| 2618 | | #DWR v1.1.0.0 |
|---|
| 2619 | | #Make sure we don't have any unprintable characters. |
|---|
| 2620 | | $strUnits = obsKMLSubRoutines::CleanString( $salinity[$i]{'units'} ); |
|---|
| 2621 | | } |
|---|
| 2622 | | |
|---|
| 2623 | | obsKMLSubRoutines::KMLAddObsToHash( 'salinity', |
|---|
| 2624 | | $KMLTimeStamp[$j], |
|---|
| 2625 | | $DataVal, |
|---|
| 2626 | | 1, |
|---|
| 2627 | | $strPlatformID, |
|---|
| 2628 | | $Height, |
|---|
| 2629 | | $strUnits, |
|---|
| 2630 | | $rObsHash ); |
|---|
| | 2607 | if ($salinity[$i]{'height'} != $missing_value_value |
|---|
| | 2608 | && $salinity[$i]{'height'} != $Fill_value_value) |
|---|
| | 2609 | { |
|---|
| | 2610 | $Height = sprintf("%.2f",$salinity[$i]{'height'}); |
|---|
| | 2611 | } |
|---|
| | 2612 | $DataVal = sprintf("%.2f",$salinity[$i]{'data'}[$j]); |
|---|
| | 2613 | } |
|---|
| | 2614 | my $strUnits; |
|---|
| | 2615 | if( lc( $salinity[$i]{'units'} ) eq 'ppt' ) |
|---|
| | 2616 | { |
|---|
| | 2617 | $strUnits = 'psu'; |
|---|
| | 2618 | } |
|---|
| | 2619 | if( length( $strUnits ) == 0 ) |
|---|
| | 2620 | { |
|---|
| | 2621 | #DWR v1.1.0.0 |
|---|
| | 2622 | #Make sure we don't have any unprintable characters. |
|---|
| | 2623 | $strUnits = obsKMLSubRoutines::CleanString( $salinity[$i]{'units'} ); |
|---|
| | 2624 | } |
|---|
| | 2625 | |
|---|
| | 2626 | obsKMLSubRoutines::KMLAddObsToHash( 'salinity', |
|---|
| | 2627 | $KMLTimeStamp[$j], |
|---|
| | 2628 | $DataVal, |
|---|
| | 2629 | 1, |
|---|
| | 2630 | $strPlatformID, |
|---|
| | 2631 | $Height, |
|---|
| | 2632 | $strUnits, |
|---|
| | 2633 | $rObsHash ); |
|---|
| | 2634 | } |
|---|
| 2750 | | |
|---|
| 2751 | | if ($sea_surface_eastward_current[$i]{'data'}[$k] != $missing_value_value |
|---|
| 2752 | | && $sea_surface_eastward_current[$i]{'data'}[$k] != $Fill_value_value |
|---|
| 2753 | | && $sea_surface_northward_current[$j]{'data'}[$k] != $missing_value_value |
|---|
| 2754 | | && $sea_surface_northward_current[$j]{'data'}[$k] != $Fill_value_value |
|---|
| 2755 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 2756 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 2757 | | { |
|---|
| 2758 | | if ($sea_surface_eastward_current[$i]{'height'} != $missing_value_value |
|---|
| 2759 | | && $sea_surface_eastward_current[$i]{'height'} != $Fill_value_value) |
|---|
| | 2754 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 2755 | { |
|---|
| | 2756 | if ($sea_surface_eastward_current[$i]{'data'}[$k] != $missing_value_value |
|---|
| | 2757 | && $sea_surface_eastward_current[$i]{'data'}[$k] != $Fill_value_value |
|---|
| | 2758 | && $sea_surface_northward_current[$j]{'data'}[$k] != $missing_value_value |
|---|
| | 2759 | && $sea_surface_northward_current[$j]{'data'}[$k] != $Fill_value_value |
|---|
| | 2760 | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| | 2761 | ) |
|---|
| 2761 | | $Height = sprintf("%.2f",$sea_surface_eastward_current[$i]{'height'}); |
|---|
| | 2763 | if ($sea_surface_eastward_current[$i]{'height'} != $missing_value_value |
|---|
| | 2764 | && $sea_surface_eastward_current[$i]{'height'} != $Fill_value_value) |
|---|
| | 2765 | { |
|---|
| | 2766 | $Height = sprintf("%.2f",$sea_surface_eastward_current[$i]{'height'}); |
|---|
| | 2767 | } |
|---|
| | 2768 | $ECurrentDataVal = sprintf("%.2f",$sea_surface_eastward_current[$i]{'data'}[$k]); |
|---|
| | 2769 | |
|---|
| | 2770 | $NCurrentDataVal = sprintf("%.2f",$sea_surface_northward_current[$j]{'data'}[$k]); |
|---|
| | 2771 | |
|---|
| 2765 | | $NCurrentDataVal = sprintf("%.2f",$sea_surface_northward_current[$j]{'data'}[$k]); |
|---|
| 2766 | | |
|---|
| 2767 | | } |
|---|
| 2768 | | my $strUnits; |
|---|
| 2769 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_eastward_current[$i]{'units'}, $XMLControlFile ); |
|---|
| 2770 | | if( length( $strUnits ) == 0 ) |
|---|
| 2771 | | { |
|---|
| 2772 | | #DWR v1.1.0.0 |
|---|
| 2773 | | #Make sure we don't have any unprintable characters. |
|---|
| 2774 | | $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_eastward_current[$i]{'units'} ); |
|---|
| 2775 | | } |
|---|
| 2776 | | |
|---|
| 2777 | | obsKMLSubRoutines::KMLAddObsToHash( 'eastward_current', |
|---|
| 2778 | | $KMLTimeStamp[$k], |
|---|
| 2779 | | $ECurrentDataVal, |
|---|
| 2780 | | 1, |
|---|
| 2781 | | $strPlatformID, |
|---|
| 2782 | | $Height, |
|---|
| 2783 | | $strUnits, |
|---|
| 2784 | | $rObsHash ); |
|---|
| 2785 | | $strUnits = ''; |
|---|
| 2786 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_northward_current[$i]{'units'}, $XMLControlFile ); |
|---|
| 2787 | | if( length( $strUnits ) == 0 ) |
|---|
| 2788 | | { |
|---|
| 2789 | | #DWR v1.1.0.0 |
|---|
| 2790 | | #Make sure we don't have any unprintable characters. |
|---|
| 2791 | | $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_northward_current[$i]{'units'} ); |
|---|
| 2792 | | } |
|---|
| 2793 | | obsKMLSubRoutines::KMLAddObsToHash( 'northward_current', |
|---|
| 2794 | | $KMLTimeStamp[$k], |
|---|
| 2795 | | $NCurrentDataVal, |
|---|
| 2796 | | 1, |
|---|
| 2797 | | $strPlatformID, |
|---|
| 2798 | | $Height, |
|---|
| 2799 | | $strUnits, |
|---|
| 2800 | | $rObsHash ); |
|---|
| | 2782 | obsKMLSubRoutines::KMLAddObsToHash( 'eastward_current', |
|---|
| | 2783 | $KMLTimeStamp[$k], |
|---|
| | 2784 | $ECurrentDataVal, |
|---|
| | 2785 | 1, |
|---|
| | 2786 | $strPlatformID, |
|---|
| | 2787 | $Height, |
|---|
| | 2788 | $strUnits, |
|---|
| | 2789 | $rObsHash ); |
|---|
| | 2790 | $strUnits = ''; |
|---|
| | 2791 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $sea_surface_northward_current[$i]{'units'}, $XMLControlFile ); |
|---|
| | 2792 | if( length( $strUnits ) == 0 ) |
|---|
| | 2793 | { |
|---|
| | 2794 | #DWR v1.1.0.0 |
|---|
| | 2795 | #Make sure we don't have any unprintable characters. |
|---|
| | 2796 | $strUnits = obsKMLSubRoutines::CleanString( $sea_surface_northward_current[$i]{'units'} ); |
|---|
| | 2797 | } |
|---|
| | 2798 | obsKMLSubRoutines::KMLAddObsToHash( 'northward_current', |
|---|
| | 2799 | $KMLTimeStamp[$k], |
|---|
| | 2800 | $NCurrentDataVal, |
|---|
| | 2801 | 1, |
|---|
| | 2802 | $strPlatformID, |
|---|
| | 2803 | $Height, |
|---|
| | 2804 | $strUnits, |
|---|
| | 2805 | $rObsHash ); |
|---|
| | 2806 | } |
|---|
| 2913 | | |
|---|
| 2914 | | if ($significant_wave_height[$i]{'data'}[$j] != $missing_value_value |
|---|
| 2915 | | && $significant_wave_height[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 2916 | | && $this_station_id_top_ts < $this_time_stamp_sec |
|---|
| 2917 | | && $this_time_stamp_sec > $oldest_ok_timestamp) |
|---|
| 2918 | | { |
|---|
| 2919 | | if ($significant_wave_height[$i]{'height'} != $missing_value_value |
|---|
| 2920 | | && $significant_wave_height[$i]{'height'} != $Fill_value_value) |
|---|
| 2921 | | { |
|---|
| 2922 | | $Height = sprintf("%.2f",$significant_wave_height[$i]{'height'}); |
|---|
| 2923 | | } |
|---|
| | 2919 | if( $this_time_stamp_sec > $oldest_ok_timestamp ) |
|---|
| | 2920 | { |
|---|
| 2928 | | $SigWaveHgtDataVal = sprintf("%.2f",$significant_wave_height[$i]{'data'}[$j]); |
|---|
| 2929 | | } |
|---|
| 2930 | | if ($dominant_wave_period[$i]{'data'}[$j] != $missing_value_value |
|---|
| 2931 | | && $dominant_wave_period[$i]{'data'}[$j] != $Fill_value_value |
|---|
| 2932 | | && $dominant_wave_period[$i]{'data'}[$j] != '') |
|---|
| | 2926 | if ($significant_wave_height[$i]{'height'} != $missing_value_value |
|---|
| | 2927 | && $significant_wave_height[$i]{'height'} != $Fill_value_value) |
|---|
| | 2928 | { |
|---|
| | 2929 | $Height = sprintf("%.2f",$significant_wave_height[$i]{'height'}); |
|---|
| | 2930 | } |
|---|
| | 2931 | if ($significant_wave_height[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 2932 | && $significant_wave_height[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 2933 | && $significant_wave_height[$i]{'data'}[$j] != '') |
|---|
| | 2934 | { |
|---|
| | 2935 | $SigWaveHgtDataVal = sprintf("%.2f",$significant_wave_height[$i]{'data'}[$j]); |
|---|
| | 2936 | } |
|---|
| | 2937 | if ($dominant_wave_period[$i]{'data'}[$j] != $missing_value_value |
|---|
| | 2938 | && $dominant_wave_period[$i]{'data'}[$j] != $Fill_value_value |
|---|
| | 2939 | && $dominant_wave_period[$i]{'data'}[$j] != '') |
|---|
| | 2940 | { |
|---|
| | 2941 | $DomWaveDataVal = sprintf("%.2f",$dominant_wave_period[$i]{'data'}[$j]); |
|---|
| | 2942 | } |
|---|
| | 2943 | } |
|---|
| | 2944 | my $strUnits; |
|---|
| | 2945 | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $dominant_wave_period[$i]{'units'}, $XMLControlFile ); |
|---|
| | 2946 | if( length( $strUnits ) == 0 ) |
|---|
| 2934 | | $DomWaveDataVal = sprintf("%.2f",$dominant_wave_period[$i]{'data'}[$j]); |
|---|
| 2935 | | } |
|---|
| 2936 | | } |
|---|
| 2937 | | my $strUnits; |
|---|
| 2938 | | $strUnits = obsKMLSubRoutines::UnitsStringConversion( $dominant_wave_period[$i]{'units'}, $XMLControlFile ); |
|---|
| 2939 | | if( length( $strUnits ) == 0 ) |
|---|
| 2940 | | { |
|---|
| 2941 | | $strUnits = obsKMLSubRoutines::CleanString( $dominant_wave_period[$i]{'units'} ); |
|---|
| 2942 | | } |
|---|
| 2943 | | |
|---|
| 2944 | | obsKMLSubRoutines::KMLAddObsToHash( 'dominant_wave_period', |
|---|
| 2945 | | $KMLTimeStamp[$j], |
|---|
| 2946 | | $DomWaveDataVal, |
|---|
| 2947 | | 1, |
|---|
| 2948 | | $strPlatformID, |
|---|
| 2949 | | $Height, |
|---|
| 2950 | | $strUnits, |
|---|
| 2951 | | $rObsHash ); |
|---|
| 2952 | | $strUnits = ''; |
|---|
| 2953 | | $strUnits = obsKMLSubRoutines::CleanString( obsKMLSubRoutines::UnitsStringConversion( $significant_wave_height[$i]{'units'}, $XMLControlFile ) ); |
|---|
| 2954 | | if( length( $strUnits ) == 0 ) |
|---|
| 2955 | | { |
|---|
| 2956 | | $strUnits = $significant_wave_height[$i]{'units'}; |
|---|
| 2957 | | } |
|---|
| 2958 | | obsKMLSubRoutines::KMLAddObsToHash( 'significant_wave_height', |
|---|
| 2959 | | $KMLTimeStamp[$j], |
|---|
| 2960 | | $SigWaveHgtDataVal, |
|---|
| 2961 | | 1, |
|---|
| 2962 | | $strPlatformID, |
|---|
| 2963 | | $Height, |
|---|
| 2964 | | $strUnits, |
|---|
| 2965 | | $rObsHash ); |
|---|
| | 2948 | $strUnits = obsKMLSubRoutines::CleanString( $dominant_wave_period[$i]{'units'} ); |
|---|
| | 2949 | } |
|---|
| | 2950 | |
|---|
| | 2951 | obsKMLSubRoutines::KMLAddObsToHash( 'dominant_wave_period', |
|---|
| | 2952 | $KMLTimeStamp[$j], |
|---|
| | 2953 | $DomWaveDataVal, |
|---|
| | 2954 | 1, |
|---|
| | 2955 | $strPlatformID, |
|---|
| | 2956 | $Height, |
|---|
| | 2957 | $strUnits, |
|---|
| | 2958 | $rObsHash ); |
|---|
| | 2959 | $strUnits = ''; |
|---|
| | 2960 | $strUnits = obsKMLSubRoutines::CleanString( obsKMLSubRoutines::UnitsStringConversion( $significant_wave_height[$i]{'units'}, $XMLControlFile ) ); |
|---|
| | 2961 | if( length( $strUnits ) == 0 ) |
|---|
| | 2962 | { |
|---|
| | 2963 | $strUnits = $significant_wave_height[$i]{'units'}; |
|---|
| | 2964 | } |
|---|
| | 2965 | obsKMLSubRoutines::KMLAddObsToHash( 'significant_wave_height', |
|---|
| | 2966 | $KMLTimeStamp[$j], |
|---|
| | 2967 | $SigWaveHgtDataVal, |
|---|
| | 2968 | 1, |
|---|
| | 2969 | $strPlatformID, |
|---|
| | 2970 | $Height, |
|---|
| | 2971 | $strUnits, |
|---|
| | 2972 | $rObsHash ); |
|---|
| | 2973 | } |
|---|
| 2973 | | my $strXMLPath; |
|---|
| 2974 | | #my $strDate = `date +%Y-%m-%dT%H-%M-%S`; |
|---|
| 2975 | | #chomp( $strDate ); |
|---|
| 2976 | | $strXMLPath = "$strObsKMLFilePath/$this_station_id"; |
|---|
| 2977 | | $strXMLPath = $strXMLPath . '_latest.kml'; |
|---|
| 2978 | | print( "XMLFilePath: $strXMLPath\n" ); |
|---|
| 2979 | | obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath ); |
|---|
| | 2981 | my $iCnt = keys( %$rObsHash ); |
|---|
| | 2982 | if( $iCnt ) |
|---|
| | 2983 | { |
|---|
| | 2984 | #DWR v1.1.0.0 |
|---|
| | 2985 | #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 |
|---|
| | 2986 | #to verify the data is no older than 2 weeks. |
|---|
| | 2987 | #Implemented code to write the obsKML files. |
|---|
| | 2988 | my %ObsHash; |
|---|
| | 2989 | my $rObsHash = \%ObsHash; |
|---|
| | 2990 | my $strPlatformID = $institution_code_value.'.'.$platform_code_value.'.'.$package_code_value; |
|---|
| | 2991 | obsKMLSubRoutines::KMLAddPlatformHashEntry( $strPlatformID, $institution_url_value, $latitude_value[0], $longitude_value[0], $rObsHash ); |
|---|
| | 2992 | |
|---|
| | 2993 | my $strXMLPath; |
|---|
| | 2994 | #my $strDate = `date +%Y-%m-%dT%H-%M-%S`; |
|---|
| | 2995 | #chomp( $strDate ); |
|---|
| | 2996 | $strXMLPath = "$strObsKMLFilePath/$this_station_id"; |
|---|
| | 2997 | $strXMLPath = $strXMLPath . '_latest.kml'; |
|---|
| | 2998 | print( "XMLFilePath: $strXMLPath\n" ); |
|---|
| | 2999 | obsKMLSubRoutines::BuildKMLFile( \%ObsHash, $strXMLPath ); |
|---|
| | 3000 | } |
|---|
| | 3001 | else |
|---|
| | 3002 | { |
|---|
| | 3003 | #DWR v1.1.0.0 |
|---|
| | 3004 | #Check to see if the last entry is older than our $oldest_ok_timestamp, if so let's log a message. |
|---|
| | 3005 | my $this_time_stamp = $time_formatted_values[-1]; |
|---|
| | 3006 | 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)); |
|---|
| | 3007 | |
|---|
| | 3008 | 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" ); |
|---|
| | 3009 | |
|---|
| | 3010 | if( $time_values[-1] < $ThreeDaysAgo ) |
|---|
| | 3011 | { |
|---|
| | 3012 | print( "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" ); |
|---|
| | 3013 | } |
|---|
| | 3014 | } |
|---|