var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1787954400000,15.93333333],[1787954580000,15.86000000],[1787954880000,15.86000000],[1787955180000,15.90000000],[1787955480000,15.90000000],[1787955780000,15.90000000],[1787956080000,15.90000000],[1787956380000,15.90000000],[1787956680000,15.84000000],[1787956980000,15.70000000],[1787957280000,15.78000000],[1787957580000,15.80000000],[1787957880000,15.70000000],[1787958180000,15.70000000],[1787958480000,15.70000000],[1787958780000,15.70000000],[1787959080000,15.70000000],[1787959380000,15.74000000],[1787959680000,15.70000000],[1787959980000,15.64000000],[1787960280000,15.60000000],[1787960580000,15.60000000],[1787960880000,15.52000000],[1787961180000,15.50000000],[1787961480000,15.42000000],[1787961780000,15.42000000],[1787962080000,15.56000000],[1787962380000,15.52000000],[1787962680000,15.44000000],[1787962980000,15.40000000],[1787963280000,15.38000000],[1787963580000,15.34000000],[1787963880000,15.28000000],[1787964180000,15.20000000],[1787964480000,15.20000000],[1787964780000,15.20000000],[1787965080000,15.18000000],[1787965380000,15.20000000],[1787965680000,15.12000000],[1787965980000,15.02000000],[1787966280000,15.00000000],[1787966580000,15.06000000],[1787966880000,15.00000000],[1787967180000,15.00000000],[1787967480000,15.00000000],[1787967780000,15.00000000],[1787968080000,15.02000000],[1787968380000,15.14000000],[1787968680000,15.28000000],[1787968980000,15.40000000],[1787969280000,15.40000000],[1787969580000,15.42000000],[1787969880000,15.60000000],[1787970180000,15.74000000],[1787970480000,15.78000000],[1787970780000,15.74000000],[1787971080000,15.82000000],[1787971380000,15.84000000],[1787971680000,15.90000000],[1787971980000,15.90000000],[1787972280000,15.96000000],[1787972580000,16.20000000],[1787972880000,16.20000000],[1787973180000,16.10000000],[1787973480000,16.10000000],[1787973780000,16.10000000],[1787974080000,16.10000000],[1787974380000,16.10000000],[1787974680000,16.12000000],[1787974980000,16.22000000],[1787975280000,16.26000000],[1787975580000,16.16000000],[1787975880000,16.02000000],[1787976180000,15.94000000],[1787976480000,15.88000000],[1787976780000,15.80000000],[1787977080000,15.80000000],[1787977380000,15.84000000],[1787977680000,15.98000000],[1787977980000,16.12000000],[1787978280000,16.20000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1787954400000,8.9],[1787954580000,8.8],[1787954880000,8.7],[1787955180000,8.7],[1787955480000,8.7],[1787955780000,8.7],[1787956080000,8.6],[1787956380000,8.6],[1787956680000,8.7],[1787956980000,8.7],[1787957280000,8.6],[1787957580000,8.6],[1787957880000,8.6],[1787958180000,8.6],[1787958480000,8.5],[1787958780000,8.5],[1787959080000,8.5],[1787959380000,8.4],[1787959680000,8.5],[1787959980000,8.5],[1787960280000,8.5],[1787960580000,8.6],[1787960880000,8.6],[1787961180000,8.6],[1787961480000,8.7],[1787961780000,8.6],[1787962080000,8.6],[1787962380000,8.7],[1787962680000,8.7],[1787962980000,8.7],[1787963280000,8.7],[1787963580000,8.7],[1787963880000,8.8],[1787964180000,8.9],[1787964480000,8.9],[1787964780000,8.9],[1787965080000,8.8],[1787965380000,8.9],[1787965680000,8.8],[1787965980000,8.9],[1787966280000,8.8],[1787966580000,8.8],[1787966880000,8.8],[1787967180000,8.9],[1787967480000,9],[1787967780000,9],[1787968080000,9.1],[1787968380000,9.1],[1787968680000,9.1],[1787968980000,9.2],[1787969280000,9.2],[1787969580000,9.2],[1787969880000,9.2],[1787970180000,9.1],[1787970480000,9.3],[1787970780000,9.2],[1787971080000,9.1],[1787971380000,9.2],[1787971680000,9.3],[1787971980000,9.4],[1787972280000,9.3],[1787972580000,9.3],[1787972880000,9.4],[1787973180000,9.3],[1787973480000,9.4],[1787973780000,9.5],[1787974080000,9.6],[1787974380000,9.6],[1787974680000,9.6],[1787974980000,9.6],[1787975280000,9.6],[1787975580000,9.8],[1787975880000,9.8],[1787976180000,9.8],[1787976480000,9.9],[1787976780000,9.9],[1787977080000,10],[1787977380000,10],[1787977680000,10],[1787977980000,10.1],[1787978280000,10.2],], 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.73333333],[1787954580000,14.82000000],[1787954880000,14.90000000],[1787955180000,15.00000000],[1787955480000,14.98000000],[1787955780000,14.96000000],[1787956080000,15.02000000],[1787956380000,15.10000000],[1787956680000,14.96000000],[1787956980000,14.82000000],[1787957280000,14.86000000],[1787957580000,14.70000000],[1787957880000,14.68000000],[1787958180000,14.80000000],[1787958480000,14.82000000],[1787958780000,14.90000000],[1787959080000,14.86000000],[1787959380000,14.96000000],[1787959680000,14.84000000],[1787959980000,14.78000000],[1787960280000,14.70000000],[1787960580000,14.80000000],[1787960880000,14.78000000],[1787961180000,14.74000000],[1787961480000,14.68000000],[1787961780000,14.68000000],[1787962080000,14.84000000],[1787962380000,14.82000000],[1787962680000,14.70000000],[1787962980000,14.64000000],[1787963280000,14.60000000],[1787963580000,14.56000000],[1787963880000,14.58000000],[1787964180000,14.50000000],[1787964480000,14.38000000],[1787964780000,14.28000000],[1787965080000,14.18000000],[1787965380000,14.30000000],[1787965680000,14.28000000],[1787965980000,14.10000000],[1787966280000,14.12000000],[1787966580000,14.22000000],[1787966880000,14.20000000],[1787967180000,14.42000000],[1787967480000,14.50000000],[1787967780000,14.60000000],[1787968080000,14.74000000],[1787968380000,14.96000000],[1787968680000,15.10000000],[1787968980000,15.10000000],[1787969280000,15.18000000],[1787969580000,15.28000000],[1787969880000,15.52000000],[1787970180000,15.66000000],[1787970480000,15.60000000],[1787970780000,15.60000000],[1787971080000,15.62000000],[1787971380000,15.62000000],[1787971680000,15.70000000],[1787971980000,15.70000000],[1787972280000,15.82000000],[1787972580000,16.08000000],[1787972880000,15.90000000],[1787973180000,15.64000000],[1787973480000,15.70000000],[1787973780000,15.72000000],[1787974080000,15.82000000],[1787974380000,15.90000000],[1787974680000,15.90000000],[1787974980000,15.96000000],[1787975280000,15.90000000],[1787975580000,15.62000000],[1787975880000,15.46000000],[1787976180000,15.44000000],[1787976480000,15.56000000],[1787976780000,15.60000000],[1787977080000,15.64000000],[1787977380000,15.86000000],[1787977680000,16.18000000],[1787977980000,16.44000000],[1787978280000,16.60000000],], 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,63.03333333],[1787954580000,63.10000000],[1787954880000,62.82000000],[1787955180000,62.38000000],[1787955480000,62.70000000],[1787955780000,62.44000000],[1787956080000,62.28000000],[1787956380000,62.02000000],[1787956680000,62.82000000],[1787956980000,63.16000000],[1787957280000,62.52000000],[1787957580000,62.50000000],[1787957880000,62.82000000],[1787958180000,62.96000000],[1787958480000,62.52000000],[1787958780000,62.46000000],[1787959080000,62.68000000],[1787959380000,61.88000000],[1787959680000,62.28000000],[1787959980000,62.74000000],[1787960280000,63.00000000],[1787960580000,63.22000000],[1787960880000,63.70000000],[1787961180000,63.92000000],[1787961480000,64.52000000],[1787961780000,64.18000000],[1787962080000,63.40000000],[1787962380000,63.86000000],[1787962680000,64.40000000],[1787962980000,64.62000000],[1787963280000,64.48000000],[1787963580000,64.78000000],[1787963880000,65.46000000],[1787964180000,66.26000000],[1787964480000,66.18000000],[1787964780000,66.12000000],[1787965080000,66.02000000],[1787965380000,66.08000000],[1787965680000,66.32000000],[1787965980000,67.02000000],[1787966280000,66.86000000],[1787966580000,66.52000000],[1787966880000,66.88000000],[1787967180000,67.32000000],[1787967480000,67.54000000],[1787967780000,67.80000000],[1787968080000,67.96000000],[1787968380000,67.58000000],[1787968680000,66.82000000],[1787968980000,66.66000000],[1787969280000,66.82000000],[1787969580000,66.48000000],[1787969880000,65.76000000],[1787970180000,65.10000000],[1787970480000,65.46000000],[1787970780000,65.42000000],[1787971080000,64.72000000],[1787971380000,64.78000000],[1787971680000,64.90000000],[1787971980000,65.40000000],[1787972280000,64.90000000],[1787972580000,63.66000000],[1787972880000,64.22000000],[1787973180000,64.48000000],[1787973480000,64.80000000],[1787973780000,65.10000000],[1787974080000,65.48000000],[1787974380000,65.52000000],[1787974680000,65.52000000],[1787974980000,65.12000000],[1787975280000,64.86000000],[1787975580000,65.98000000],[1787975880000,66.66000000],[1787976180000,66.94000000],[1787976480000,67.68000000],[1787976780000,68.38000000],[1787977080000,68.76000000],[1787977380000,68.62000000],[1787977680000,68.08000000],[1787977980000,67.90000000],[1787978280000,67.80000000],], 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.839999988],[1787954580000,11.088],[1787954880000,10.8],[1787955180000,10.512],[1787955480000,11.448],[1787955780000,11.088],[1787956080000,10.656],[1787956380000,11.52],[1787956680000,14.112],[1787956980000,12.528],[1787957280000,11.16],[1787957580000,8.352],[1787957880000,10.44],[1787958180000,12.672],[1787958480000,10.44],[1787958780000,11.664],[1787959080000,10.44],[1787959380000,11.88],[1787959680000,10.152],[1787959980000,9.504],[1787960280000,9.36],[1787960580000,10.944],[1787960880000,10.08],[1787961180000,9.288],[1787961480000,9.936],[1787961780000,9.792],[1787962080000,10.656],[1787962380000,9.936],[1787962680000,10.296],[1787962980000,10.44],[1787963280000,10.008],[1787963580000,9.504],[1787963880000,10.224],[1787964180000,10.584],[1787964480000,8.568],[1787964780000,8.928],[1787965080000,7.704],[1787965380000,9.072],[1787965680000,8.784],[1787965980000,8.424],[1787966280000,7.56],[1787966580000,9.936],[1787966880000,9.36],[1787967180000,9.864],[1787967480000,8.064],[1787967780000,10.008],[1787968080000,10.224],[1787968380000,10.8],[1787968680000,9.288],[1787968980000,9.936],[1787969280000,10.44],[1787969580000,8.28],[1787969880000,8.568],[1787970180000,9.648],[1787970480000,7.128],[1787970780000,8.352],[1787971080000,9.576],[1787971380000,11.52],[1787971680000,8.64],[1787971980000,9.144],[1787972280000,8.28],[1787972580000,8.712],[1787972880000,9.216],[1787973180000,8.856],[1787973480000,6.408],[1787973780000,4.32],[1787974080000,5.472],[1787974380000,5.832],[1787974680000,6.336],[1787974980000,6.696],[1787975280000,6.696],[1787975580000,6.984],[1787975880000,7.056],[1787976180000,7.992],[1787976480000,8.712],[1787976780000,9.144],[1787977080000,8.784],[1787977380000,8.136],[1787977680000,9.648],[1787977980000,9.36],[1787978280000,6.48],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1787954400000,12.96],[1787954580000,15.192],[1787954880000,14.76],[1787955180000,14.04],[1787955480000,15.912],[1787955780000,14.472],[1787956080000,15.12],[1787956380000,15.624],[1787956680000,18.432],[1787956980000,15.696],[1787957280000,14.832],[1787957580000,11.304],[1787957880000,15.192],[1787958180000,17.28],[1787958480000,14.904],[1787958780000,15.336],[1787959080000,14.112],[1787959380000,16.488],[1787959680000,15.84],[1787959980000,12.888],[1787960280000,14.112],[1787960580000,15.408],[1787960880000,13.824],[1787961180000,11.952],[1787961480000,13.392],[1787961780000,13.176],[1787962080000,14.184],[1787962380000,14.184],[1787962680000,13.68],[1787962980000,13.536],[1787963280000,14.256],[1787963580000,13.824],[1787963880000,13.68],[1787964180000,14.688],[1787964480000,11.16],[1787964780000,11.088],[1787965080000,10.872],[1787965380000,13.104],[1787965680000,12.168],[1787965980000,11.592],[1787966280000,10.44],[1787966580000,12.96],[1787966880000,11.808],[1787967180000,12.96],[1787967480000,12.384],[1787967780000,14.832],[1787968080000,13.752],[1787968380000,13.464],[1787968680000,13.032],[1787968980000,13.824],[1787969280000,14.76],[1787969580000,10.872],[1787969880000,11.664],[1787970180000,12.6],[1787970480000,11.448],[1787970780000,12.384],[1787971080000,13.176],[1787971380000,15.48],[1787971680000,12.096],[1787971980000,12.384],[1787972280000,11.736],[1787972580000,12.456],[1787972880000,13.032],[1787973180000,11.736],[1787973480000,8.712],[1787973780000,5.976],[1787974080000,7.2],[1787974380000,7.272],[1787974680000,8.28],[1787974980000,9.216],[1787975280000,9.576],[1787975580000,9.288],[1787975880000,9.72],[1787976180000,11.376],[1787976480000,11.808],[1787976780000,11.808],[1787977080000,11.808],[1787977380000,10.872],[1787977680000,13.536],[1787977980000,12.96],[1787978280000,9.72],], 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,122.36666667],[1787954580000,4.30000000],[1787954880000,144.94000000],[1787955180000,145.36000000],[1787955480000,214.40000000],[1787955780000,75.22000000],[1787956080000,285.36000000],[1787956380000,284.88000000],[1787956680000,4.30000000],[1787956980000,144.52000000],[1787957280000,76.68000000],[1787957580000,9.82000000],[1787957880000,352.60000000],[1787958180000,355.32000000],[1787958480000,353.78000000],[1787958780000,286.68000000],[1787959080000,144.62000000],[1787959380000,73.76000000],[1787959680000,356.06000000],[1787959980000,281.30000000],[1787960280000,283.30000000],[1787960580000,353.06000000],[1787960880000,353.04000000],[1787961180000,215.22000000],[1787961480000,285.10000000],[1787961780000,282.90000000],[1787962080000,348.82000000],[1787962380000,281.90000000],[1787962680000,213.78000000],[1787962980000,356.70000000],[1787963280000,144.90000000],[1787963580000,355.56000000],[1787963880000,349.96000000],[1787964180000,350.92000000],[1787964480000,353.64000000],[1787964780000,218.54000000],[1787965080000,215.18000000],[1787965380000,351.78000000],[1787965680000,215.16000000],[1787965980000,13.90000000],[1787966280000,145.78000000],[1787966580000,145.72000000],[1787966880000,13.30000000],[1787967180000,145.34000000],[1787967480000,145.56000000],[1787967780000,283.68000000],[1787968080000,355.38000000],[1787968380000,215.96000000],[1787968680000,282.80000000],[1787968980000,282.64000000],[1787969280000,352.72000000],[1787969580000,351.86000000],[1787969880000,77.38000000],[1787970180000,214.76000000],[1787970480000,148.38000000],[1787970780000,151.92000000],[1787971080000,282.14000000],[1787971380000,349.78000000],[1787971680000,282.64000000],[1787971980000,215.44000000],[1787972280000,75.84000000],[1787972580000,142.72000000],[1787972880000,145.06000000],[1787973180000,350.14000000],[1787973480000,346.38000000],[1787973780000,283.00000000],[1787974080000,77.32000000],[1787974380000,21.10000000],[1787974680000,87.36000000],[1787974980000,280.64000000],[1787975280000,208.38000000],[1787975580000,9.22000000],[1787975880000,74.68000000],[1787976180000,284.94000000],[1787976480000,283.14000000],[1787976780000,74.56000000],[1787977080000,286.42000000],[1787977380000,216.70000000],[1787977680000,216.64000000],[1787977980000,73.48000000],[1787978280000,349.20000000],], 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; }