var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1787954400000,18.16666667],[1787954580000,17.92000000],[1787954880000,17.48000000],[1787955180000,17.44000000],[1787955480000,17.74000000],[1787955780000,18.18000000],[1787956080000,18.56000000],[1787956380000,18.76000000],[1787956680000,18.86000000],[1787956980000,18.72000000],[1787957280000,18.70000000],[1787957580000,18.82000000],[1787957880000,18.82000000],[1787958180000,18.80000000],[1787958480000,18.70000000],[1787958780000,18.68000000],[1787959080000,18.52000000],[1787959380000,18.34000000],[1787959680000,18.24000000],[1787959980000,18.20000000],[1787960280000,18.10000000],[1787960580000,17.96000000],[1787960880000,17.90000000],[1787961180000,17.88000000],[1787961480000,17.80000000],[1787961780000,17.76000000],[1787962080000,17.68000000],[1787962380000,17.50000000],[1787962680000,17.32000000],[1787962980000,17.30000000],[1787963280000,17.26000000],[1787963580000,17.22000000],[1787963880000,17.24000000],[1787964180000,17.14000000],[1787964480000,17.02000000],[1787964780000,16.88000000],[1787965080000,16.58000000],[1787965380000,16.38000000],[1787965680000,16.08000000],[1787965980000,15.92000000],[1787966280000,15.72000000],[1787966580000,15.50000000],[1787966880000,15.44000000],[1787967180000,15.58000000],[1787967480000,15.76000000],[1787967780000,15.66000000],[1787968080000,15.48000000],[1787968380000,15.98000000],[1787968680000,16.08000000],[1787968980000,16.50000000],[1787969280000,17.02000000],[1787969580000,17.36000000],[1787969880000,17.60000000],[1787970180000,17.92000000],[1787970480000,18.08000000],[1787970780000,18.12000000],[1787971080000,18.10000000],[1787971380000,18.20000000],[1787971680000,18.30000000],[1787971980000,18.36000000],[1787972280000,18.48000000],[1787972580000,18.44000000],[1787972880000,18.34000000],[1787973180000,18.30000000],[1787973480000,18.28000000],[1787973780000,18.28000000],[1787974080000,18.28000000],[1787974380000,18.08000000],[1787974680000,17.96000000],[1787974980000,17.86000000],[1787975280000,17.68000000],[1787975580000,17.36000000],[1787975880000,17.12000000],[1787976180000,17.08000000],[1787976480000,17.00000000],[1787976780000,16.90000000],[1787977080000,16.94000000],[1787977380000,17.02000000],[1787977680000,17.14000000],[1787977980000,17.32000000],[1787978280000,17.40000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1787954400000,6.1],[1787954580000,5.9],[1787954880000,6.1],[1787955180000,5.7],[1787955480000,5.5],[1787955780000,5.4],[1787956080000,5.5],[1787956380000,5.6],[1787956680000,5.8],[1787956980000,6],[1787957280000,5.8],[1787957580000,5.8],[1787957880000,5.9],[1787958180000,6],[1787958480000,6],[1787958780000,6.1],[1787959080000,6.2],[1787959380000,6.3],[1787959680000,6.3],[1787959980000,6.3],[1787960280000,6.4],[1787960580000,6.5],[1787960880000,6.5],[1787961180000,6.5],[1787961480000,6.5],[1787961780000,6.5],[1787962080000,6.7],[1787962380000,6.8],[1787962680000,6.8],[1787962980000,6.7],[1787963280000,6.8],[1787963580000,6.7],[1787963880000,6.8],[1787964180000,6.9],[1787964480000,7.2],[1787964780000,7.2],[1787965080000,7.3],[1787965380000,7.3],[1787965680000,7.7],[1787965980000,7.6],[1787966280000,7.8],[1787966580000,7.7],[1787966880000,7.7],[1787967180000,7.4],[1787967480000,7.6],[1787967780000,7.9],[1787968080000,8],[1787968380000,7.2],[1787968680000,8],[1787968980000,7.2],[1787969280000,7.2],[1787969580000,7.3],[1787969880000,7.3],[1787970180000,7.2],[1787970480000,7.3],[1787970780000,7.4],[1787971080000,7.4],[1787971380000,7.4],[1787971680000,7.5],[1787971980000,7.4],[1787972280000,7.4],[1787972580000,7.5],[1787972880000,7.5],[1787973180000,7.5],[1787973480000,7.4],[1787973780000,7.3],[1787974080000,7.5],[1787974380000,7.5],[1787974680000,7.5],[1787974980000,7.5],[1787975280000,7.9],[1787975580000,8.2],[1787975880000,7.9],[1787976180000,7.7],[1787976480000,7.8],[1787976780000,7.6],[1787977080000,7.7],[1787977380000,7.6],[1787977680000,7.7],[1787977980000,7.8],[1787978280000,7.9],], 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,14.80000000],[1787954580000,14.48000000],[1787954880000,14.08000000],[1787955180000,14.60000000],[1787955480000,15.32000000],[1787955780000,16.22000000],[1787956080000,16.50000000],[1787956380000,16.78000000],[1787956680000,16.44000000],[1787956980000,16.16000000],[1787957280000,16.30000000],[1787957580000,16.78000000],[1787957880000,16.44000000],[1787958180000,16.52000000],[1787958480000,16.14000000],[1787958780000,16.04000000],[1787959080000,15.74000000],[1787959380000,15.54000000],[1787959680000,15.90000000],[1787959980000,16.12000000],[1787960280000,15.88000000],[1787960580000,16.04000000],[1787960880000,15.92000000],[1787961180000,16.00000000],[1787961480000,15.92000000],[1787961780000,15.76000000],[1787962080000,15.22000000],[1787962380000,14.96000000],[1787962680000,14.74000000],[1787962980000,14.78000000],[1787963280000,15.12000000],[1787963580000,15.22000000],[1787963880000,15.42000000],[1787964180000,14.96000000],[1787964480000,14.80000000],[1787964780000,14.06000000],[1787965080000,13.82000000],[1787965380000,13.52000000],[1787965680000,13.20000000],[1787965980000,13.00000000],[1787966280000,13.08000000],[1787966580000,12.96000000],[1787966880000,12.90000000],[1787967180000,13.22000000],[1787967480000,13.40000000],[1787967780000,13.36000000],[1787968080000,13.14000000],[1787968380000,14.44000000],[1787968680000,14.08000000],[1787968980000,15.20000000],[1787969280000,15.92000000],[1787969580000,16.18000000],[1787969880000,16.58000000],[1787970180000,16.86000000],[1787970480000,16.90000000],[1787970780000,16.84000000],[1787971080000,16.88000000],[1787971380000,17.26000000],[1787971680000,17.46000000],[1787971980000,17.50000000],[1787972280000,17.50000000],[1787972580000,17.18000000],[1787972880000,16.96000000],[1787973180000,16.86000000],[1787973480000,16.78000000],[1787973780000,16.80000000],[1787974080000,16.42000000],[1787974380000,16.14000000],[1787974680000,16.12000000],[1787974980000,15.90000000],[1787975280000,15.50000000],[1787975580000,15.08000000],[1787975880000,15.16000000],[1787976180000,15.18000000],[1787976480000,15.32000000],[1787976780000,15.34000000],[1787977080000,15.78000000],[1787977380000,16.12000000],[1787977680000,16.36000000],[1787977980000,16.66000000],[1787978280000,16.90000000],], 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,45.33333333],[1787954580000,45.32000000],[1787954880000,47.48000000],[1787955180000,46.08000000],[1787955480000,44.82000000],[1787955780000,43.28000000],[1787956080000,42.60000000],[1787956380000,42.24000000],[1787956680000,42.44000000],[1787956980000,43.50000000],[1787957280000,42.98000000],[1787957580000,42.60000000],[1787957880000,42.92000000],[1787958180000,43.18000000],[1787958480000,43.66000000],[1787958780000,43.84000000],[1787959080000,44.78000000],[1787959380000,45.42000000],[1787959680000,45.84000000],[1787959980000,45.94000000],[1787960280000,46.68000000],[1787960580000,47.24000000],[1787960880000,47.30000000],[1787961180000,47.60000000],[1787961480000,47.90000000],[1787961780000,47.94000000],[1787962080000,48.78000000],[1787962380000,49.60000000],[1787962680000,50.34000000],[1787962980000,50.08000000],[1787963280000,50.30000000],[1787963580000,50.34000000],[1787963880000,50.44000000],[1787964180000,51.04000000],[1787964480000,52.54000000],[1787964780000,53.22000000],[1787965080000,54.66000000],[1787965380000,55.26000000],[1787965680000,57.84000000],[1787965980000,57.80000000],[1787966280000,59.34000000],[1787966580000,60.10000000],[1787966880000,60.04000000],[1787967180000,58.54000000],[1787967480000,58.66000000],[1787967780000,60.22000000],[1787968080000,61.24000000],[1787968380000,56.38000000],[1787968680000,58.78000000],[1787968980000,54.28000000],[1787969280000,52.68000000],[1787969580000,51.92000000],[1787969880000,50.96000000],[1787970180000,49.72000000],[1787970480000,49.56000000],[1787970780000,49.86000000],[1787971080000,49.96000000],[1787971380000,49.60000000],[1787971680000,49.38000000],[1787971980000,48.96000000],[1787972280000,48.56000000],[1787972580000,48.96000000],[1787972880000,49.38000000],[1787973180000,49.56000000],[1787973480000,49.18000000],[1787973780000,49.08000000],[1787974080000,49.50000000],[1787974380000,50.22000000],[1787974680000,50.74000000],[1787974980000,50.94000000],[1787975280000,52.92000000],[1787975580000,55.00000000],[1787975880000,54.70000000],[1787976180000,54.24000000],[1787976480000,54.70000000],[1787976780000,54.60000000],[1787977080000,54.64000000],[1787977380000,54.16000000],[1787977680000,53.98000000],[1787977980000,53.94000000],[1787978280000,53.70000000],], 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,3.120000012],[1787954580000,2.736],[1787954880000,4.32],[1787955180000,8.352],[1787955480000,7.776],[1787955780000,9.792],[1787956080000,9.504],[1787956380000,7.632],[1787956680000,5.256],[1787956980000,9.504],[1787957280000,5.76],[1787957580000,7.56],[1787957880000,5.904],[1787958180000,5.976],[1787958480000,6.768],[1787958780000,7.2],[1787959080000,7.416],[1787959380000,7.848],[1787959680000,10.44],[1787959980000,7.128],[1787960280000,5.472],[1787960580000,7.416],[1787960880000,7.128],[1787961180000,8.64],[1787961480000,7.92],[1787961780000,6.84],[1787962080000,3.096],[1787962380000,6.408],[1787962680000,4.896],[1787962980000,6.192],[1787963280000,5.904],[1787963580000,6.84],[1787963880000,4.464],[1787964180000,4.68],[1787964480000,2.16],[1787964780000,2.232],[1787965080000,1.728],[1787965380000,2.592],[1787965680000,1.944],[1787965980000,3.672],[1787966280000,2.88],[1787966580000,2.52],[1787966880000,1.8],[1787967180000,3.96],[1787967480000,4.248],[1787967780000,2.52],[1787968080000,2.736],[1787968380000,4.536],[1787968680000,5.256],[1787968980000,6.768],[1787969280000,6.12],[1787969580000,6.408],[1787969880000,6.984],[1787970180000,7.92],[1787970480000,9.432],[1787970780000,6.336],[1787971080000,7.776],[1787971380000,10.728],[1787971680000,10.368],[1787971980000,10.368],[1787972280000,12.168],[1787972580000,11.16],[1787972880000,5.832],[1787973180000,7.056],[1787973480000,5.976],[1787973780000,7.128],[1787974080000,3.024],[1787974380000,4.464],[1787974680000,4.752],[1787974980000,3.672],[1787975280000,3.456],[1787975580000,5.328],[1787975880000,3.888],[1787976180000,3.816],[1787976480000,4.752],[1787976780000,4.32],[1787977080000,3.744],[1787977380000,5.616],[1787977680000,5.832],[1787977980000,4.824],[1787978280000,5.4],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1787954400000,5.04],[1787954580000,5.328],[1787954880000,8.064],[1787955180000,12.672],[1787955480000,12.384],[1787955780000,14.976],[1787956080000,14.04],[1787956380000,10.728],[1787956680000,7.488],[1787956980000,15.984],[1787957280000,10.44],[1787957580000,11.664],[1787957880000,9.792],[1787958180000,8.784],[1787958480000,10.512],[1787958780000,10.008],[1787959080000,10.728],[1787959380000,11.736],[1787959680000,15.048],[1787959980000,10.224],[1787960280000,8.64],[1787960580000,11.448],[1787960880000,11.736],[1787961180000,12.744],[1787961480000,12.168],[1787961780000,9.864],[1787962080000,4.968],[1787962380000,9.576],[1787962680000,7.488],[1787962980000,9.576],[1787963280000,9.864],[1787963580000,10.152],[1787963880000,6.696],[1787964180000,6.84],[1787964480000,3.888],[1787964780000,3.672],[1787965080000,2.52],[1787965380000,4.824],[1787965680000,3.528],[1787965980000,5.112],[1787966280000,4.32],[1787966580000,4.104],[1787966880000,2.736],[1787967180000,5.688],[1787967480000,6.336],[1787967780000,3.96],[1787968080000,4.752],[1787968380000,7.488],[1787968680000,8.496],[1787968980000,10.296],[1787969280000,9.936],[1787969580000,9.936],[1787969880000,11.088],[1787970180000,12.528],[1787970480000,14.04],[1787970780000,9.072],[1787971080000,12.672],[1787971380000,16.704],[1787971680000,16.776],[1787971980000,15.984],[1787972280000,17.28],[1787972580000,17.568],[1787972880000,8.64],[1787973180000,11.52],[1787973480000,10.008],[1787973780000,9.936],[1787974080000,5.328],[1787974380000,6.84],[1787974680000,7.992],[1787974980000,5.904],[1787975280000,5.544],[1787975580000,7.848],[1787975880000,5.544],[1787976180000,6.336],[1787976480000,6.552],[1787976780000,6.552],[1787977080000,7.056],[1787977380000,8.28],[1787977680000,8.208],[1787977980000,7.344],[1787978280000,6.84],], 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,151.26666667],[1787954580000,120.90000000],[1787954880000,109.94000000],[1787955180000,121.74000000],[1787955480000,125.82000000],[1787955780000,123.44000000],[1787956080000,122.86000000],[1787956380000,125.48000000],[1787956680000,110.04000000],[1787956980000,145.20000000],[1787957280000,135.84000000],[1787957580000,124.34000000],[1787957880000,126.54000000],[1787958180000,130.32000000],[1787958480000,122.84000000],[1787958780000,125.22000000],[1787959080000,124.28000000],[1787959380000,119.86000000],[1787959680000,120.82000000],[1787959980000,111.20000000],[1787960280000,121.66000000],[1787960580000,113.90000000],[1787960880000,115.38000000],[1787961180000,111.90000000],[1787961480000,123.06000000],[1787961780000,109.26000000],[1787962080000,90.46000000],[1787962380000,104.54000000],[1787962680000,122.96000000],[1787962980000,124.68000000],[1787963280000,105.28000000],[1787963580000,100.78000000],[1787963880000,57.36000000],[1787964180000,79.34000000],[1787964480000,99.48000000],[1787964780000,149.90000000],[1787965080000,175.00000000],[1787965380000,142.26000000],[1787965680000,266.68000000],[1787965980000,58.08000000],[1787966280000,126.76000000],[1787966580000,69.30000000],[1787966880000,178.92000000],[1787967180000,18.20000000],[1787967480000,110.84000000],[1787967780000,135.74000000],[1787968080000,92.12000000],[1787968380000,52.98000000],[1787968680000,149.82000000],[1787968980000,108.44000000],[1787969280000,92.34000000],[1787969580000,104.00000000],[1787969880000,93.10000000],[1787970180000,95.86000000],[1787970480000,99.54000000],[1787970780000,75.88000000],[1787971080000,99.82000000],[1787971380000,106.88000000],[1787971680000,108.62000000],[1787971980000,114.80000000],[1787972280000,114.20000000],[1787972580000,123.44000000],[1787972880000,99.98000000],[1787973180000,101.84000000],[1787973480000,101.08000000],[1787973780000,92.62000000],[1787974080000,80.64000000],[1787974380000,66.46000000],[1787974680000,80.14000000],[1787974980000,93.62000000],[1787975280000,128.46000000],[1787975580000,129.14000000],[1787975880000,86.24000000],[1787976180000,115.20000000],[1787976480000,72.98000000],[1787976780000,60.00000000],[1787977080000,54.34000000],[1787977380000,49.20000000],[1787977680000,41.10000000],[1787977980000,54.08000000],[1787978280000,34.50000000],], 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; }