var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1787954400000,15.10000000],[1787954580000,15.00000000],[1787954880000,14.56000000],[1787955180000,14.24000000],[1787955480000,14.18000000],[1787955780000,14.26000000],[1787956080000,14.38000000],[1787956380000,14.40000000],[1787956680000,14.52000000],[1787956980000,14.64000000],[1787957280000,14.70000000],[1787957580000,14.80000000],[1787957880000,14.76000000],[1787958180000,14.68000000],[1787958480000,14.60000000],[1787958780000,14.46000000],[1787959080000,14.48000000],[1787959380000,14.58000000],[1787959680000,14.60000000],[1787959980000,14.64000000],[1787960280000,14.68000000],[1787960580000,14.86000000],[1787960880000,15.14000000],[1787961180000,15.30000000],[1787961480000,15.32000000],[1787961780000,15.26000000],[1787962080000,15.10000000],[1787962380000,14.78000000],[1787962680000,14.58000000],[1787962980000,14.36000000],[1787963280000,14.16000000],[1787963580000,14.10000000],[1787963880000,14.18000000],[1787964180000,14.10000000],[1787964480000,14.10000000],[1787964780000,14.10000000],[1787965080000,14.10000000],[1787965380000,14.12000000],[1787965680000,14.46000000],[1787965980000,14.84000000],[1787966280000,15.00000000],[1787966580000,15.02000000],[1787966880000,15.16000000],[1787967180000,15.46000000],[1787967480000,15.70000000],[1787967780000,16.08000000],[1787968080000,16.22000000],[1787968380000,16.26000000],[1787968680000,16.30000000],[1787968980000,16.38000000],[1787969280000,16.58000000],[1787969580000,16.58000000],[1787969880000,16.40000000],[1787970180000,16.60000000],[1787970480000,16.66000000],[1787970780000,16.50000000],[1787971080000,16.50000000],[1787971380000,16.40000000],[1787971680000,16.30000000],[1787971980000,16.30000000],[1787972280000,16.20000000],[1787972580000,16.20000000],[1787972880000,16.12000000],[1787973180000,16.10000000],[1787973480000,15.98000000],[1787973780000,15.88000000],[1787974080000,15.74000000],[1787974380000,15.66000000],[1787974680000,15.60000000],[1787974980000,15.58000000],[1787975280000,15.54000000],[1787975580000,15.52000000],[1787975880000,15.50000000],[1787976180000,15.52000000],[1787976480000,15.60000000],[1787976780000,15.66000000],[1787977080000,15.70000000],[1787977380000,15.70000000],[1787977680000,15.60000000],[1787977980000,15.52000000],[1787978280000,15.36666667],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1787954400000,6.2],[1787954580000,6.9],[1787954880000,8.3],[1787955180000,8],[1787955480000,7],[1787955780000,6.7],[1787956080000,6.9],[1787956380000,7.3],[1787956680000,7.2],[1787956980000,7.2],[1787957280000,7.1],[1787957580000,7.3],[1787957880000,7.4],[1787958180000,7.5],[1787958480000,7.4],[1787958780000,7.5],[1787959080000,7],[1787959380000,7.2],[1787959680000,7.3],[1787959980000,7.1],[1787960280000,7.2],[1787960580000,6.8],[1787960880000,6.6],[1787961180000,6.7],[1787961480000,7.1],[1787961780000,7.2],[1787962080000,8.4],[1787962380000,8.3],[1787962680000,8.5],[1787962980000,8.5],[1787963280000,8.3],[1787963580000,8.3],[1787963880000,8.2],[1787964180000,8.2],[1787964480000,7.9],[1787964780000,8],[1787965080000,8.1],[1787965380000,7.9],[1787965680000,7.3],[1787965980000,7.2],[1787966280000,7.7],[1787966580000,7.6],[1787966880000,7.4],[1787967180000,7.4],[1787967480000,7.5],[1787967780000,7.7],[1787968080000,7.8],[1787968380000,7.9],[1787968680000,7.6],[1787968980000,6.9],[1787969280000,6.7],[1787969580000,8.1],[1787969880000,7.2],[1787970180000,6.1],[1787970480000,6.6],[1787970780000,6.5],[1787971080000,6.7],[1787971380000,7.6],[1787971680000,7.1],[1787971980000,7.8],[1787972280000,7.9],[1787972580000,7.7],[1787972880000,8],[1787973180000,8.2],[1787973480000,8.7],[1787973780000,8.9],[1787974080000,9],[1787974380000,9.2],[1787974680000,9.1],[1787974980000,9.3],[1787975280000,9.1],[1787975580000,9.4],[1787975880000,8.8],[1787976180000,8.4],[1787976480000,8.2],[1787976780000,8],[1787977080000,8],[1787977380000,8.1],[1787977680000,8.2],[1787977980000,8.8],[1787978280000,9.8],], 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,10.50000000],[1787954580000,10.42000000],[1787954880000,10.40000000],[1787955180000,10.32000000],[1787955480000,10.36000000],[1787955780000,10.52000000],[1787956080000,10.80000000],[1787956380000,11.00000000],[1787956680000,11.14000000],[1787956980000,11.20000000],[1787957280000,11.04000000],[1787957580000,11.00000000],[1787957880000,11.00000000],[1787958180000,11.00000000],[1787958480000,10.98000000],[1787958780000,10.90000000],[1787959080000,10.96000000],[1787959380000,11.16000000],[1787959680000,11.28000000],[1787959980000,11.60000000],[1787960280000,12.14000000],[1787960640000,12.77500000],[1787960880000,12.74000000],[1787961180000,12.42000000],[1787961480000,12.20000000],[1787961780000,12.12000000],[1787962080000,12.02000000],[1787962380000,12.04000000],[1787962740000,12.35000000],[1787962980000,12.22000000],[1787963280000,11.78000000],[1787963580000,11.44000000],[1787963880000,11.40000000],[1787964180000,11.40000000],[1787964480000,11.42000000],[1787964780000,11.60000000],[1787965080000,11.90000000],[1787965380000,12.26000000],[1787965680000,12.54000000],[1787965980000,12.52000000],[1787966280000,12.72000000],[1787966580000,13.00000000],[1787966880000,13.28000000],[1787967180000,13.50000000],[1787967480000,13.88000000],[1787967780000,14.18000000],[1787968080000,14.40000000],[1787968380000,14.50000000],[1787968680000,14.58000000],[1787968980000,14.62000000],[1787969280000,14.66000000],[1787969580000,14.60000000],[1787969880000,14.52000000],[1787970180000,14.50000000],[1787970480000,14.44000000],[1787970780000,14.40000000],[1787971080000,14.40000000],[1787971380000,14.40000000],[1787971680000,14.40000000],[1787971980000,14.44000000],[1787972280000,14.50000000],[1787972580000,14.50000000],[1787972880000,14.50000000],[1787973180000,14.48000000],[1787973480000,14.50000000],[1787973780000,14.48000000],[1787974080000,14.40000000],[1787974380000,14.40000000],[1787974680000,14.40000000],[1787974980000,14.40000000],[1787975280000,14.38000000],[1787975580000,14.30000000],[1787975880000,14.26000000],[1787976180000,14.22000000],[1787976480000,14.18000000],[1787976780000,14.20000000],[1787977080000,14.20000000],[1787977380000,14.30000000],[1787977680000,14.35000000],[1787977980000,14.38000000],[1787978280000,14.30000000],], 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,55.43333333],[1787954580000,58.60000000],[1787954880000,66.54000000],[1787955180000,66.32000000],[1787955480000,62.24000000],[1787955780000,60.80000000],[1787956080000,60.92000000],[1787956380000,62.42000000],[1787956680000,61.78000000],[1787956980000,61.28000000],[1787957280000,60.64000000],[1787957580000,61.12000000],[1787957880000,61.52000000],[1787958180000,62.38000000],[1787958480000,62.32000000],[1787958780000,63.04000000],[1787959080000,61.20000000],[1787959380000,61.48000000],[1787959680000,61.66000000],[1787959980000,61.04000000],[1787960280000,61.08000000],[1787960580000,58.78000000],[1787960880000,57.02000000],[1787961180000,56.92000000],[1787961480000,58.08000000],[1787961780000,58.90000000],[1787962080000,64.68000000],[1787962380000,65.50000000],[1787962680000,66.96000000],[1787962980000,68.28000000],[1787963280000,67.92000000],[1787963580000,68.30000000],[1787963880000,67.40000000],[1787964180000,67.90000000],[1787964480000,66.34000000],[1787964780000,66.76000000],[1787965080000,67.30000000],[1787965380000,66.26000000],[1787965680000,62.28000000],[1787965980000,60.32000000],[1787966280000,62.12000000],[1787966580000,61.32000000],[1787966880000,60.20000000],[1787967180000,59.06000000],[1787967480000,58.56000000],[1787967780000,57.62000000],[1787968080000,57.56000000],[1787968380000,57.96000000],[1787968680000,56.74000000],[1787968980000,53.72000000],[1787969280000,52.18000000],[1787969580000,57.64000000],[1787969880000,54.62000000],[1787970180000,50.24000000],[1787970480000,51.54000000],[1787970780000,51.72000000],[1787971080000,52.60000000],[1787971380000,56.42000000],[1787971680000,54.82000000],[1787971980000,57.50000000],[1787972280000,58.04000000],[1787972580000,57.22000000],[1787972880000,58.64000000],[1787973180000,59.70000000],[1787973480000,62.26000000],[1787973780000,63.34000000],[1787974080000,64.36000000],[1787974380000,65.70000000],[1787974680000,65.40000000],[1787974980000,66.60000000],[1787975280000,65.90000000],[1787975580000,67.04000000],[1787975880000,64.76000000],[1787976180000,62.62000000],[1787976480000,61.82000000],[1787976780000,60.64000000],[1787977080000,60.36000000],[1787977380000,60.68000000],[1787977680000,61.70000000],[1787977980000,64.52000000],[1787978280000,69.53333333],], 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,1.559999988],[1787954580000,1.44],[1787954880000,1.728],[1787955180000,1.8],[1787955480000,2.448],[1787955780000,1.944],[1787956080000,1.584],[1787956380000,1.872],[1787956680000,3.024],[1787956980000,3.672],[1787957280000,3.168],[1787957580000,3.24],[1787957880000,3.096],[1787958180000,2.52],[1787958480000,3.024],[1787958780000,2.808],[1787959080000,3.24],[1787959380000,3.528],[1787959680000,3.816],[1787959980000,4.176],[1787960280000,3.384],[1787960580000,4.392],[1787960880000,3.096],[1787961180000,2.376],[1787961480000,1.656],[1787961780000,1.728],[1787962080000,1.224],[1787962380000,1.872],[1787962680000,1.368],[1787962980000,1.08],[1787963280000,1.224],[1787963580000,1.44],[1787963880000,0.936],[1787964180000,2.088],[1787964480000,3.24],[1787964780000,3.384],[1787965080000,2.736],[1787965380000,3.816],[1787965680000,4.392],[1787965980000,3.528],[1787966280000,2.52],[1787966580000,3.168],[1787966880000,3.816],[1787967180000,3.672],[1787967480000,3.456],[1787967780000,2.88],[1787968080000,2.52],[1787968380000,3.312],[1787968680000,3.096],[1787968980000,3.312],[1787969280000,1.872],[1787969580000,1.44],[1787969880000,3.456],[1787970180000,3.744],[1787970480000,1.728],[1787970780000,3.672],[1787971080000,2.88],[1787971380000,4.392],[1787971680000,4.104],[1787971980000,2.952],[1787972280000,3.168],[1787972580000,2.376],[1787972880000,2.52],[1787973180000,2.304],[1787973480000,1.944],[1787973780000,2.664],[1787974080000,2.448],[1787974380000,3.312],[1787974680000,2.232],[1787974980000,2.88],[1787975280000,3.672],[1787975580000,3.96],[1787975880000,2.664],[1787976180000,2.88],[1787976480000,1.872],[1787976780000,3.384],[1787977080000,2.16],[1787977380000,1.08],[1787977680000,1.152],[1787977980000,1.008],[1787978280000,1.199999988],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1787954400000,2.400000012],[1787954580000,2.52],[1787954880000,3.6],[1787955180000,2.592],[1787955480000,3.816],[1787955780000,3.672],[1787956080000,2.376],[1787956380000,2.664],[1787956680000,4.104],[1787956980000,5.256],[1787957280000,4.464],[1787957580000,4.392],[1787957880000,4.104],[1787958180000,3.744],[1787958480000,4.608],[1787958780000,3.96],[1787959080000,4.752],[1787959380000,5.184],[1787959680000,5.616],[1787959980000,6.408],[1787960280000,5.04],[1787960580000,6.912],[1787960880000,4.32],[1787961180000,3.672],[1787961480000,2.664],[1787961780000,2.376],[1787962080000,2.016],[1787962380000,3.024],[1787962680000,2.952],[1787962980000,1.656],[1787963280000,1.728],[1787963580000,2.16],[1787963880000,1.44],[1787964180000,2.736],[1787964480000,3.744],[1787964780000,4.248],[1787965080000,3.96],[1787965380000,5.616],[1787965680000,7.2],[1787965980000,6.768],[1787966280000,3.888],[1787966580000,5.688],[1787966880000,6.12],[1787967180000,5.112],[1787967480000,5.256],[1787967780000,4.824],[1787968080000,4.968],[1787968380000,5.688],[1787968680000,5.544],[1787968980000,6.12],[1787969280000,3.672],[1787969580000,2.952],[1787969880000,5.616],[1787970180000,6.264],[1787970480000,2.52],[1787970780000,5.112],[1787971080000,4.104],[1787971380000,6.408],[1787971680000,7.2],[1787971980000,4.392],[1787972280000,4.32],[1787972580000,3.888],[1787972880000,3.384],[1787973180000,3.384],[1787973480000,2.736],[1787973780000,3.816],[1787974080000,3.312],[1787974380000,4.248],[1787974680000,3.168],[1787974980000,3.888],[1787975280000,5.04],[1787975580000,5.256],[1787975880000,3.744],[1787976180000,5.04],[1787976480000,3.528],[1787976780000,5.832],[1787977080000,4.176],[1787977380000,1.8],[1787977680000,1.872],[1787977980000,1.584],[1787978280000,1.559999988],], 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,278.20000000],[1787954580000,250.54000000],[1787954880000,259.10000000],[1787955180000,276.12000000],[1787955480000,286.98000000],[1787955780000,270.78000000],[1787956080000,279.44000000],[1787956380000,280.92000000],[1787956680000,270.46000000],[1787956980000,263.42000000],[1787957280000,273.66000000],[1787957580000,275.14000000],[1787957880000,277.12000000],[1787958180000,278.04000000],[1787958480000,274.32000000],[1787958780000,272.26000000],[1787959080000,278.56000000],[1787959380000,269.70000000],[1787959680000,264.62000000],[1787959980000,260.24000000],[1787960280000,264.92000000],[1787960580000,246.86000000],[1787960880000,254.90000000],[1787961180000,269.78000000],[1787961480000,256.36000000],[1787961780000,284.50000000],[1787962080000,254.38000000],[1787962380000,264.50000000],[1787962680000,192.62000000],[1787962980000,221.22000000],[1787963280000,122.88000000],[1787963580000,273.82000000],[1787963880000,297.84000000],[1787964180000,258.74000000],[1787964480000,259.80000000],[1787964780000,250.96000000],[1787965080000,249.44000000],[1787965380000,260.10000000],[1787965680000,261.70000000],[1787965980000,255.22000000],[1787966280000,201.40000000],[1787966580000,260.94000000],[1787966880000,250.64000000],[1787967180000,246.50000000],[1787967480000,245.68000000],[1787967780000,249.60000000],[1787968080000,211.14000000],[1787968380000,211.40000000],[1787968680000,192.86000000],[1787968980000,179.60000000],[1787969280000,167.06000000],[1787969580000,238.54000000],[1787969880000,221.98000000],[1787970180000,226.04000000],[1787970480000,232.30000000],[1787970780000,268.40000000],[1787971080000,271.48000000],[1787971380000,241.28000000],[1787971680000,263.26000000],[1787971980000,240.42000000],[1787972280000,261.36000000],[1787972580000,281.64000000],[1787972880000,263.88000000],[1787973180000,259.26000000],[1787973480000,268.46000000],[1787973780000,265.72000000],[1787974080000,275.06000000],[1787974380000,247.64000000],[1787974680000,248.44000000],[1787974980000,262.66000000],[1787975280000,264.14000000],[1787975580000,240.16000000],[1787975880000,269.26000000],[1787976180000,223.80000000],[1787976480000,204.28000000],[1787976780000,259.88000000],[1787977080000,278.78000000],[1787977380000,281.98000000],[1787977680000,308.86000000],[1787977980000,297.22000000],[1787978280000,120.66666667],], 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],[1787966280000,0],[1787966580000,0],[1787966880000,0],[1787967180000,0],[1787967480000,0],[1787967780000,0],[1787968080000,0],[1787968380000,0],[1787968680000,0],[1787968980000,0],[1787969280000,0],[1787969580000,0],[1787969880000,0],[1787970180000,0],[1787970480000,0],[1787970780000,0],[1787971080000,0],[1787971380000,0],[1787971680000,0],[1787971980000,0],[1787972280000,0],[1787972580000,0],[1787972880000,0],[1787973180000,0],[1787973480000,0],[1787973780000,0],[1787974080000,0],[1787974380000,0],[1787974680000,0],[1787974980000,0],[1787975280000,0],[1787975580000,0],[1787975880000,0],[1787976180000,0],[1787976480000,0],[1787976780000,0],[1787977080000,0],[1787977380000,0],[1787977680000,0],[1787977980000,0],[1787978280000,0],], 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; }