var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1787954400000,21.60000000],[1787954580000,21.60000000],[1787954880000,21.56000000],[1787955180000,21.50000000],[1787955480000,21.56000000],[1787955780000,21.60000000],[1787956080000,21.52000000],[1787956380000,21.38000000],[1787956680000,21.34000000],[1787956980000,21.32000000],[1787957280000,21.26000000],[1787957580000,21.28000000],[1787957880000,21.30000000],[1787958180000,21.24000000],[1787958480000,21.16000000],[1787958780000,21.20000000],[1787959080000,21.10000000],[1787959380000,21.04000000],[1787959680000,20.98000000],[1787959980000,20.92000000],[1787960280000,20.76000000],[1787960580000,20.54000000],[1787960880000,20.50000000],[1787961180000,20.44000000],[1787961480000,20.50000000],[1787961780000,20.50000000],[1787962080000,20.76000000],[1787962380000,20.84000000],[1787962680000,20.90000000],[1787962980000,20.88000000],[1787963280000,20.86000000],[1787963580000,20.72000000],[1787963880000,20.60000000],[1787964180000,20.50000000],[1787964480000,20.34000000],[1787964780000,20.18000000],[1787965080000,20.04000000],[1787965380000,19.68000000],[1787965680000,19.06000000],[1787965980000,18.50000000],[1787966280000,18.10000000],[1787966580000,17.84000000],[1787966880000,17.46000000],[1787967180000,16.96000000],[1787967480000,16.68000000],[1787967780000,16.46000000],[1787968080000,16.16000000],[1787968380000,15.68000000],[1787968680000,15.36000000],[1787968980000,15.14000000],[1787969280000,15.10000000],[1787969580000,15.10000000],[1787969880000,15.14000000],[1787970180000,15.20000000],[1787970480000,15.20000000],[1787970780000,15.20000000],[1787971080000,15.20000000],[1787971380000,15.20000000],[1787971680000,15.22000000],[1787971980000,15.24000000],[1787972280000,15.20000000],[1787972580000,15.18000000],[1787972880000,15.24000000],[1787973180000,15.28000000],[1787973480000,15.20000000],[1787973780000,15.26000000],[1787974080000,15.50000000],[1787974380000,15.72000000],[1787974680000,15.84000000],[1787974980000,15.80000000],[1787975280000,15.86000000],[1787975580000,15.84000000],[1787975880000,15.78000000],[1787976180000,15.52000000],[1787976480000,15.26000000],[1787976780000,15.14000000],[1787977080000,15.10000000],[1787977380000,15.10000000],[1787977680000,15.10000000],[1787977980000,15.12000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1787954400000,7.4],[1787954580000,7.4],[1787954880000,7.3],[1787955180000,7.3],[1787955480000,7.3],[1787955780000,7.3],[1787956080000,7.2],[1787956380000,7.2],[1787956680000,7],[1787956980000,7.1],[1787957280000,6.9],[1787957580000,6.9],[1787957880000,6.9],[1787958180000,6.9],[1787958480000,6.9],[1787958780000,6.9],[1787959080000,6.9],[1787959380000,7],[1787959680000,6.9],[1787959980000,7],[1787960280000,7.1],[1787960580000,7.1],[1787960880000,7.1],[1787961180000,7.1],[1787961480000,7.2],[1787961780000,7.3],[1787962080000,7],[1787962380000,7.2],[1787962680000,7.2],[1787962980000,7.3],[1787963280000,8.9],[1787963580000,9.5],[1787963880000,10.3],[1787964180000,11.7],[1787964480000,14.1],[1787964780000,15.1],[1787965080000,15.5],[1787965380000,15.7],[1787965680000,15.8],[1787965980000,16.1],[1787966280000,16.4],[1787966580000,16.4],[1787966880000,16.1],[1787967180000,15.3],[1787967480000,15.2],[1787967780000,15.1],[1787968080000,14.8],[1787968380000,14.2],[1787968680000,14],[1787968980000,14],[1787969280000,14.1],[1787969580000,14.3],[1787969880000,14.3],[1787970180000,14.4],[1787970480000,14.4],[1787970780000,14.5],[1787971080000,14.4],[1787971380000,14.4],[1787971680000,14.4],[1787971980000,14.3],[1787972280000,14.2],[1787972580000,14.2],[1787972880000,14.1],[1787973180000,14.1],[1787973480000,14],[1787973780000,13.9],[1787974080000,13.6],[1787974380000,13.5],[1787974680000,13.5],[1787974980000,13.6],[1787975280000,13.5],[1787975580000,13.6],[1787975880000,13.6],[1787976180000,14],[1787976480000,14.2],[1787976780000,14.3],[1787977080000,14.3],[1787977380000,14.3],[1787977680000,14.2],[1787977980000,14.1],], color: '#5b9f4a' } ]; var options = { xaxes: [{ axisLabel: 'temperature', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1°C' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-temperature-legend' } }; graphs['#chart-temperature'] = $.plot('#chart-temperature', dataset, options); }); $(document).ready(function() { var dataset = [{label: "5 cm nad povrchom (\u00b0C)", data: [[1787954400000,20.46666667],[1787954580000,20.46000000],[1787954880000,20.34000000],[1787955180000,20.24000000],[1787955480000,20.66000000],[1787955780000,20.56000000],[1787956080000,20.28000000],[1787956380000,19.86000000],[1787956680000,20.22000000],[1787956980000,19.96000000],[1787957280000,20.08000000],[1787957580000,20.18000000],[1787957880000,20.24000000],[1787958180000,19.90000000],[1787958480000,19.94000000],[1787958780000,20.20000000],[1787959080000,20.08000000],[1787959380000,19.94000000],[1787959680000,19.70000000],[1787959980000,19.38000000],[1787960280000,18.96000000],[1787960580000,18.72000000],[1787960880000,19.10000000],[1787961180000,19.34000000],[1787961480000,19.40000000],[1787961780000,19.30000000],[1787962080000,20.02000000],[1787962380000,20.26000000],[1787962680000,20.38000000],[1787962980000,20.18000000],[1787963280000,20.10000000],[1787963580000,19.72000000],[1787963880000,19.72000000],[1787964180000,19.78000000],[1787964480000,19.96000000],[1787964780000,19.98000000],[1787965080000,19.86000000],[1787965380000,19.22000000],[1787965680000,17.88000000],[1787965980000,17.52000000],[1787966280000,17.54000000],[1787966580000,17.42000000],[1787966880000,17.08000000],[1787967180000,16.32000000],[1787967480000,16.16000000],[1787967780000,15.98000000],[1787968080000,15.68000000],[1787968380000,15.08000000],[1787968680000,14.80000000],[1787968980000,14.78000000],[1787969280000,14.84000000],[1787969580000,14.92000000],[1787969880000,15.00000000],[1787970180000,15.04000000],[1787970480000,15.00000000],[1787970780000,15.08000000],[1787971080000,15.00000000],[1787971380000,15.00000000],[1787971680000,14.92000000],[1787971980000,14.86000000],[1787972280000,14.76000000],[1787972580000,14.66000000],[1787972880000,14.66000000],[1787973180000,14.60000000],[1787973480000,14.58000000],[1787973780000,14.50000000],[1787974080000,14.58000000],[1787974380000,14.58000000],[1787974680000,14.64000000],[1787974980000,14.62000000],[1787975280000,14.78000000],[1787975580000,14.76000000],[1787975880000,14.82000000],[1787976180000,14.78000000],[1787976480000,14.80000000],[1787976780000,14.86000000],[1787977080000,14.86000000],[1787977380000,14.82000000],[1787977680000,14.88000000],[1787977980000,14.82000000],], color: "#f39c12"}]; var options = { points: { show: false }, lines: { show: true, lineWidth: 2, fill: false }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser' }, grid: { hoverable: true, clickable: true, borderWidth: 0 }, tooltip: { show: true, content: '%x - %y.1°C' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-ground-temperature-legend' } }; graphs['#chart-ground-temperature'] = $.plot('#chart-ground-temperature', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Vlhkosť (%)', data: [[1787954400000,40.13333333],[1787954580000,39.98000000],[1787954880000,39.92000000],[1787955180000,40.04000000],[1787955480000,39.82000000],[1787955780000,39.88000000],[1787956080000,39.66000000],[1787956380000,40.06000000],[1787956680000,39.68000000],[1787956980000,39.84000000],[1787957280000,39.56000000],[1787957580000,39.62000000],[1787957880000,39.38000000],[1787958180000,39.54000000],[1787958480000,39.70000000],[1787958780000,39.82000000],[1787959080000,39.96000000],[1787959380000,40.30000000],[1787959680000,40.20000000],[1787959980000,40.70000000],[1787960280000,41.24000000],[1787960580000,42.04000000],[1787960880000,41.90000000],[1787961180000,42.28000000],[1787961480000,42.28000000],[1787961780000,42.64000000],[1787962080000,41.18000000],[1787962380000,41.42000000],[1787962680000,41.18000000],[1787962980000,41.74000000],[1787963280000,46.44000000],[1787963580000,48.68000000],[1787963880000,51.98000000],[1787964180000,57.36000000],[1787964480000,67.54000000],[1787964780000,72.60000000],[1787965080000,75.22000000],[1787965380000,77.84000000],[1787965680000,81.74000000],[1787965980000,86.26000000],[1787966280000,89.80000000],[1787966580000,91.62000000],[1787966880000,91.64000000],[1787967180000,90.02000000],[1787967480000,91.04000000],[1787967780000,91.58000000],[1787968080000,91.58000000],[1787968380000,90.90000000],[1787968680000,91.42000000],[1787968980000,92.86000000],[1787969280000,94.08000000],[1787969580000,94.74000000],[1787969880000,95.06000000],[1787970180000,95.22000000],[1787970480000,95.20000000],[1787970780000,95.38000000],[1787971080000,95.16000000],[1787971380000,94.94000000],[1787971680000,94.62000000],[1787971980000,94.24000000],[1787972280000,94.10000000],[1787972580000,94.10000000],[1787972880000,93.06000000],[1787973180000,92.46000000],[1787973480000,92.64000000],[1787973780000,91.62000000],[1787974080000,88.28000000],[1787974380000,86.70000000],[1787974680000,86.28000000],[1787974980000,86.74000000],[1787975280000,85.98000000],[1787975580000,86.46000000],[1787975880000,87.14000000],[1787976180000,90.94000000],[1787976480000,93.62000000],[1787976780000,94.72000000],[1787977080000,95.18000000],[1787977380000,95.16000000],[1787977680000,94.62000000],[1787977980000,93.84000000],], color: '#ff9000' } ]; var options = { xaxes: [{ axisLabel: 'humidity', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1%' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-humidity-legend' } }; graphs['#chart-humidity'] = $.plot('#chart-humidity', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Rýchlosť vetra (km/h)', data: [[1787954400000,9],[1787954580000,7.92],[1787954880000,5.904],[1787955180000,6.12],[1787955480000,7.2],[1787955780000,6.48],[1787956080000,5.112],[1787956380000,5.472],[1787956680000,6.264],[1787956980000,4.392],[1787957280000,9.072],[1787957580000,6.48],[1787957880000,7.776],[1787958180000,5.832],[1787958480000,6.12],[1787958780000,5.256],[1787959080000,6.192],[1787959380000,4.032],[1787959680000,5.184],[1787959980000,2.088],[1787960280000,2.736],[1787960580000,2.808],[1787960880000,3.24],[1787961180000,3.168],[1787961480000,3.672],[1787961780000,4.68],[1787962080000,6.768],[1787962380000,5.184],[1787962680000,4.896],[1787962980000,3.888],[1787963280000,4.32],[1787963580000,4.392],[1787963880000,5.688],[1787964180000,5.328],[1787964480000,10.224],[1787964780000,8.208],[1787965080000,9.792],[1787965380000,12.384],[1787965680000,11.808],[1787965980000,8.856],[1787966280000,10.8],[1787966580000,12.672],[1787966880000,18.144],[1787967180000,22.968],[1787967480000,20.232],[1787967780000,15.048],[1787968080000,21.96],[1787968380000,24.84],[1787968680000,24.192],[1787968980000,20.304],[1787969280000,24.192],[1787969580000,22.32],[1787969880000,22.608],[1787970180000,23.904],[1787970480000,24.912],[1787970780000,21.168],[1787971080000,24.696],[1787971380000,20.376],[1787971680000,20.016],[1787971980000,19.224],[1787972280000,22.752],[1787972580000,19.224],[1787972880000,20.736],[1787973180000,18.864],[1787973480000,20.16],[1787973780000,21.816],[1787974080000,23.112],[1787974380000,20.952],[1787974680000,21.888],[1787974980000,19.296],[1787975280000,19.152],[1787975580000,14.4],[1787975880000,17.856],[1787976180000,19.224],[1787976480000,13.896],[1787976780000,15.48],[1787977080000,14.04],[1787977380000,15.336],[1787977680000,14.472],[1787977980000,12.888],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1787954400000,13.560000012],[1787954580000,14.4],[1787954880000,11.736],[1787955180000,10.512],[1787955480000,13.392],[1787955780000,14.256],[1787956080000,11.448],[1787956380000,8.928],[1787956680000,12.672],[1787956980000,8.784],[1787957280000,15.552],[1787957580000,12.024],[1787957880000,15.336],[1787958180000,10.944],[1787958480000,10.296],[1787958780000,10.08],[1787959080000,11.16],[1787959380000,7.56],[1787959680000,9.504],[1787959980000,3.888],[1787960280000,4.824],[1787960580000,4.896],[1787960880000,5.04],[1787961180000,5.04],[1787961480000,6.048],[1787961780000,7.632],[1787962080000,10.296],[1787962380000,9.432],[1787962680000,9.072],[1787962980000,7.128],[1787963280000,7.704],[1787963580000,7.992],[1787963880000,10.08],[1787964180000,9.144],[1787964480000,16.344],[1787964780000,17.136],[1787965080000,18.288],[1787965380000,21.24],[1787965680000,22.104],[1787965980000,15.624],[1787966280000,19.08],[1787966580000,21.312],[1787966880000,30.312],[1787967180000,36.72],[1787967480000,36.864],[1787967780000,30.24],[1787968080000,36.864],[1787968380000,44.352],[1787968680000,43.272],[1787968980000,41.256],[1787969280000,39.96],[1787969580000,39.744],[1787969880000,38.448],[1787970180000,43.848],[1787970480000,41.76],[1787970780000,34.128],[1787971080000,43.416],[1787971380000,38.448],[1787971680000,35.496],[1787971980000,37.728],[1787972280000,38.52],[1787972580000,35.928],[1787972880000,38.88],[1787973180000,33.264],[1787973480000,32.76],[1787973780000,38.16],[1787974080000,39.6],[1787974380000,31.464],[1787974680000,36.288],[1787974980000,33.552],[1787975280000,30.744],[1787975580000,25.704],[1787975880000,31.752],[1787976180000,32.4],[1787976480000,26.424],[1787976780000,26.568],[1787977080000,25.56],[1787977380000,29.448],[1787977680000,27.288],[1787977980000,21.888],], color: '#EF9856', points: { show: true }, lines: { show: false }, } ]; var options = { xaxes: [{ axisLabel: 'wind', }], xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1km/h' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-wind-legend' } }; graphs['#chart-wind'] = $.plot('#chart-wind', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Smer vetra', data: [[1787954400000,114.93333333],[1787954580000,116.02000000],[1787954880000,118.14000000],[1787955180000,138.92000000],[1787955480000,125.68000000],[1787955780000,127.58000000],[1787956080000,126.36000000],[1787956380000,117.42000000],[1787956680000,133.26000000],[1787956980000,117.02000000],[1787957280000,135.54000000],[1787957580000,116.44000000],[1787957880000,132.54000000],[1787958180000,144.76000000],[1787958480000,153.82000000],[1787958780000,162.80000000],[1787959080000,133.62000000],[1787959380000,140.62000000],[1787959680000,127.72000000],[1787959980000,200.14000000],[1787960280000,193.54000000],[1787960580000,158.26000000],[1787960880000,199.40000000],[1787961180000,191.84000000],[1787961480000,220.28000000],[1787961780000,267.66000000],[1787962080000,258.94000000],[1787962380000,243.70000000],[1787962680000,247.18000000],[1787962980000,262.08000000],[1787963280000,272.82000000],[1787963580000,307.56000000],[1787963880000,283.84000000],[1787964180000,256.82000000],[1787964480000,288.64000000],[1787964780000,293.36000000],[1787965080000,305.36000000],[1787965380000,306.90000000],[1787965680000,310.48000000],[1787965980000,320.10000000],[1787966280000,321.08000000],[1787966580000,324.06000000],[1787966880000,324.22000000],[1787967180000,315.64000000],[1787967480000,305.30000000],[1787967780000,307.02000000],[1787968080000,303.52000000],[1787968380000,310.26000000],[1787968680000,306.80000000],[1787968980000,305.18000000],[1787969280000,313.58000000],[1787969580000,314.86000000],[1787969880000,315.18000000],[1787970180000,315.04000000],[1787970480000,313.18000000],[1787970780000,311.90000000],[1787971080000,313.20000000],[1787971380000,310.20000000],[1787971680000,317.70000000],[1787971980000,306.62000000],[1787972280000,310.78000000],[1787972580000,311.04000000],[1787972880000,307.42000000],[1787973180000,310.86000000],[1787973480000,314.32000000],[1787973780000,315.82000000],[1787974080000,316.60000000],[1787974380000,322.58000000],[1787974680000,319.86000000],[1787974980000,316.26000000],[1787975280000,317.96000000],[1787975580000,317.92000000],[1787975880000,310.98000000],[1787976180000,310.14000000],[1787976480000,316.16000000],[1787976780000,316.52000000],[1787977080000,312.90000000],[1787977380000,302.92000000],[1787977680000,314.04000000],[1787977980000,299.44000000],], color: '#002f80', points: { show: true }, lines: { show: false }, } ]; var options = { xaxes: [{ axisLabel: 'wind_direction', }], xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, yaxis: { min: 0, max: 360, ticks: [[0, 'S'], [90, 'V'], [180, 'J'], [270, 'Z'], [360, 'S']] }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: function(label, xval, yval, flotItem) { dir = meteo_wind_direction_name(yval); format_date = moment(xval).format('DD.MM., hh:mm') return format_date+' - '+dir; } }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-wind-direction-legend' } }; graphs['#chart-wind-direction'] = $.plot('#chart-wind-direction', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Zrážky', data: [[1787954400000,0],[1787954580000,0],[1787954880000,0],[1787955180000,0],[1787955480000,0],[1787955780000,0],[1787956080000,0],[1787956380000,0],[1787956680000,0],[1787956980000,0],[1787957280000,0],[1787957580000,0],[1787957880000,0],[1787958180000,0],[1787958480000,0],[1787958780000,0],[1787959080000,0],[1787959380000,0],[1787959680000,0],[1787959980000,0],[1787960280000,0],[1787960580000,0],[1787960880000,0],[1787961180000,0],[1787961480000,0],[1787961780000,0],[1787962080000,0],[1787962380000,0],[1787962680000,0],[1787962980000,0],[1787963280000,0],[1787963580000,0],[1787963880000,0],[1787964180000,0],[1787964480000,0],[1787964780000,0],[1787965080000,0],[1787965380000,0],[1787965680000,0],[1787965980000,0.016],[1787966280000,0.04],[1787966580000,0.086],[1787966880000,0.138],[1787967180000,0.162],[1787967480000,0.162],[1787967780000,0.184],[1787968080000,0.192],[1787968380000,0.192],[1787968680000,0.192],[1787968980000,0.192],[1787969280000,0.254],[1787969580000,0.266],[1787969880000,0.27],[1787970180000,0.27],[1787970480000,0.27],[1787970780000,0.27],[1787971080000,0.27],[1787971380000,0.27],[1787971680000,0.27],[1787971980000,0.27],[1787972280000,0.27],[1787972580000,0.27],[1787972880000,0.27],[1787973180000,0.27],[1787973480000,0.27],[1787973780000,0.27],[1787974080000,0.27],[1787974380000,0.27],[1787974680000,0.27],[1787974980000,0.27],[1787975280000,0.27],[1787975580000,0.27],[1787975880000,0.27],[1787976180000,0.27],[1787976480000,0.27],[1787976780000,0.29],[1787977080000,0.29],[1787977380000,0.294],[1787977680000,0.294],[1787977980000,0.294],], color: '#008fbf' } ]; var options = { xaxes: [{ axisLabel: 'rain', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.3mm' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-rain-legend' } }; graphs['#chart-rain'] = $.plot('#chart-rain', dataset, options); }); $('.modal').on('hide.bs.modal', function() { var memory = $(this).html(); $(this).html(memory); }); function meteo_wind_direction_name(wind_direction) { if (wind_direction >= 0.00 && wind_direction <= 11.25) { ret = 'S'; } else if (wind_direction > 11.25 && wind_direction <= 33.75) { ret = 'SSV'; } else if (wind_direction > 33.75 && wind_direction <= 56.25) { ret = 'SV'; } else if (wind_direction > 56.25 && wind_direction <= 78.75) { // 67.5 ret = 'VSV'; } else if (wind_direction > 78.75 && wind_direction <= 101.25) { // 90 ret = 'V'; } else if (wind_direction > 101.25 && wind_direction <= 123.75) { //112.5 ret = 'VJV'; } else if (wind_direction > 123.75 && wind_direction <= 146.25) { // 135 ret = 'JV'; } else if (wind_direction > 146.25 && wind_direction <= 168.75) { // 157.5 ret = 'JJV'; } else if (wind_direction > 168.75 && wind_direction <= 191.25) { // 180 ret = 'J'; } else if (wind_direction > 191.25 && wind_direction <= 213.75) { // 202.5 ret = 'JJZ'; } else if (wind_direction > 213.75 && wind_direction <= 236.25) { // 225 ret = 'JZ'; } else if (wind_direction > 236.25 && wind_direction <= 258.75) { // 247.5 ret = 'ZJZ'; } else if (wind_direction > 258.75 && wind_direction <= 281.25) { // 270 ret = 'Z'; } else if (wind_direction > 281.25 && wind_direction <= 303.75) { // 292.5 ret = 'ZSZ'; } else if (wind_direction > 303.75 && wind_direction <= 326.25) { // 315 ret = 'SZ'; } else if (wind_direction > 326.25 && wind_direction <= 348.75) { // 337.5 ret = 'SSZ'; } else if (wind_direction > 348.75 && wind_direction <= 360.0) { // 337.5 ret = 'S'; } else { return ''; } return ret; }