var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1787954400000,26.10000000],[1787954580000,26.02000000],[1787954880000,25.90000000],[1787955180000,25.82000000],[1787955480000,25.88000000],[1787955780000,25.94000000],[1787956080000,25.90000000],[1787956380000,25.76000000],[1787956680000,25.50000000],[1787956980000,25.42000000],[1787957280000,25.08000000],[1787957580000,24.84000000],[1787957880000,24.82000000],[1787958180000,24.80000000],[1787958480000,24.94000000],[1787958780000,25.00000000],[1787959080000,25.00000000],[1787959380000,24.90000000],[1787959680000,24.68000000],[1787959980000,24.12000000],[1787960280000,23.84000000],[1787960580000,23.68000000],[1787960880000,23.56000000],[1787961180000,23.42000000],[1787961480000,23.38000000],[1787961780000,23.26000000],[1787962080000,23.10000000],[1787962380000,22.88000000],[1787962680000,22.74000000],[1787962980000,22.48000000],[1787963280000,21.74000000],[1787963580000,20.70000000],[1787963880000,19.92000000],[1787964180000,19.46000000],[1787964480000,19.14000000],[1787964780000,18.66000000],[1787965080000,18.60000000],[1787965380000,18.68000000],[1787965680000,18.70000000],[1787965980000,18.80000000],[1787966280000,18.90000000],[1787966580000,18.90000000],[1787966880000,18.82000000],[1787967180000,18.66000000],[1787967480000,18.60000000],[1787967780000,18.58000000],[1787968080000,18.42000000],[1787968380000,18.38000000],[1787968680000,18.30000000],[1787968980000,18.24000000],[1787969280000,18.14000000],[1787969580000,18.06000000],[1787969880000,18.00000000],[1787970180000,17.92000000],[1787970480000,17.90000000],[1787970780000,17.90000000],[1787971080000,17.86000000],[1787971380000,17.80000000],[1787971680000,17.80000000],[1787971980000,17.80000000],[1787972280000,17.90000000],[1787972580000,17.98000000],[1787972880000,18.00000000],[1787973180000,17.94000000],[1787973480000,17.90000000],[1787973780000,17.90000000],[1787974080000,17.90000000],[1787974380000,17.90000000],[1787974680000,17.80000000],[1787974980000,17.78000000],[1787975280000,17.68000000],[1787975580000,17.60000000],[1787975880000,17.58000000],[1787976180000,17.62000000],[1787976480000,17.62000000],[1787976780000,17.60000000],[1787977080000,17.50000000],[1787977380000,17.42000000],[1787977680000,17.32000000],[1787977980000,17.30000000],[1787978280000,17.30000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1787954400000,9.1],[1787954580000,9.1],[1787954880000,9.1],[1787955180000,9.1],[1787955480000,9.1],[1787955780000,9],[1787956080000,9.1],[1787956380000,9.1],[1787956680000,9.3],[1787956980000,9.1],[1787957280000,9.7],[1787957580000,9.1],[1787957880000,9.1],[1787958180000,9.2],[1787958480000,9],[1787958780000,9.1],[1787959080000,9.2],[1787959380000,9.4],[1787959680000,13.4],[1787959980000,16.5],[1787960280000,16.9],[1787960580000,17],[1787960880000,17.1],[1787961180000,17.1],[1787961480000,17.1],[1787961780000,17],[1787962080000,17],[1787962380000,16.9],[1787962680000,16.9],[1787962980000,16.7],[1787963280000,16.4],[1787963580000,16.7],[1787963880000,16.9],[1787964180000,17.1],[1787964480000,17.2],[1787964780000,17.2],[1787965080000,17.5],[1787965380000,17.7],[1787965680000,17.7],[1787965980000,17.7],[1787966280000,17.4],[1787966580000,17.2],[1787966880000,17],[1787967180000,16.8],[1787967480000,16.5],[1787967780000,15.7],[1787968080000,15.5],[1787968380000,15.6],[1787968680000,15.7],[1787968980000,15.8],[1787969280000,15.8],[1787969580000,15.9],[1787969880000,16],[1787970180000,16],[1787970480000,16.1],[1787970780000,16.1],[1787971080000,16.2],[1787971380000,16.2],[1787971680000,16.1],[1787971980000,16.1],[1787972280000,16],[1787972580000,16.1],[1787972880000,16.1],[1787973180000,16.1],[1787973480000,16.1],[1787973780000,16.2],[1787974080000,16.2],[1787974380000,16.3],[1787974680000,16.2],[1787974980000,16.4],[1787975280000,16.2],[1787975580000,16.1],[1787975880000,16.1],[1787976180000,15.9],[1787976480000,15.9],[1787976780000,15.8],[1787977080000,15.8],[1787977380000,15.8],[1787977680000,15.7],[1787977980000,15.6],[1787978280000,15.6],], 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,24.60000000],[1787954580000,24.46000000],[1787954880000,24.34000000],[1787955180000,24.46000000],[1787955480000,24.66000000],[1787955780000,24.80000000],[1787956080000,24.60000000],[1787956380000,24.28000000],[1787956680000,23.78000000],[1787956980000,23.72000000],[1787957280000,22.78000000],[1787957580000,22.72000000],[1787957880000,23.00000000],[1787958180000,23.08000000],[1787958480000,23.46000000],[1787958780000,23.68000000],[1787959080000,23.66000000],[1787959380000,23.54000000],[1787959680000,23.48000000],[1787959980000,23.40000000],[1787960280000,23.30000000],[1787960580000,23.20000000],[1787960880000,23.08000000],[1787961180000,22.88000000],[1787961480000,22.78000000],[1787961780000,22.66000000],[1787962080000,22.56000000],[1787962380000,22.44000000],[1787962680000,22.26000000],[1787962980000,22.06000000],[1787963280000,21.54000000],[1787963580000,19.98000000],[1787963880000,19.20000000],[1787964180000,18.92000000],[1787964480000,18.60000000],[1787964780000,18.22000000],[1787965080000,18.28000000],[1787965380000,18.40000000],[1787965680000,18.40000000],[1787965980000,18.40000000],[1787966280000,18.24000000],[1787966580000,18.18000000],[1787966880000,17.98000000],[1787967180000,17.88000000],[1787967480000,17.66000000],[1787967780000,17.10000000],[1787968080000,16.90000000],[1787968380000,16.92000000],[1787968680000,17.00000000],[1787968980000,17.00000000],[1787969280000,17.02000000],[1787969580000,17.06000000],[1787969880000,17.10000000],[1787970180000,17.10000000],[1787970480000,17.12000000],[1787970780000,17.20000000],[1787971080000,17.20000000],[1787971380000,17.20000000],[1787971680000,17.20000000],[1787971980000,17.20000000],[1787972280000,17.16000000],[1787972580000,17.14000000],[1787972880000,17.14000000],[1787973180000,17.10000000],[1787973480000,17.14000000],[1787973780000,17.20000000],[1787974080000,17.20000000],[1787974380000,17.16000000],[1787974680000,17.00000000],[1787974980000,16.96000000],[1787975280000,16.72000000],[1787975580000,16.70000000],[1787975880000,16.70000000],[1787976180000,16.62000000],[1787976480000,16.52000000],[1787976780000,16.44000000],[1787977080000,16.30000000],[1787977380000,16.30000000],[1787977680000,16.22000000],[1787977980000,16.24000000],[1787978280000,16.20000000],], 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,34.20000000],[1787954580000,34.30000000],[1787954880000,34.54000000],[1787955180000,34.74000000],[1787955480000,34.60000000],[1787955780000,34.38000000],[1787956080000,34.74000000],[1787956380000,35.00000000],[1787956680000,35.84000000],[1787956980000,35.70000000],[1787957280000,37.78000000],[1787957580000,36.92000000],[1787957880000,36.90000000],[1787958180000,37.26000000],[1787958480000,36.50000000],[1787958780000,36.50000000],[1787959080000,36.76000000],[1787959380000,37.54000000],[1787959680000,49.66000000],[1787959980000,62.68000000],[1787960280000,65.16000000],[1787960580000,66.26000000],[1787960880000,67.06000000],[1787961180000,67.86000000],[1787961480000,67.84000000],[1787961780000,67.92000000],[1787962080000,68.62000000],[1787962380000,69.26000000],[1787962680000,69.70000000],[1787962980000,70.02000000],[1787963280000,71.98000000],[1787963580000,77.84000000],[1787963880000,82.80000000],[1787964180000,86.42000000],[1787964480000,88.52000000],[1787964780000,91.32000000],[1787965080000,93.22000000],[1787965380000,93.80000000],[1787965680000,94.08000000],[1787965980000,93.22000000],[1787966280000,90.84000000],[1787966580000,89.98000000],[1787966880000,89.30000000],[1787967180000,89.26000000],[1787967480000,87.56000000],[1787967780000,83.28000000],[1787968080000,83.40000000],[1787968380000,84.00000000],[1787968680000,85.10000000],[1787968980000,85.56000000],[1787969280000,86.56000000],[1787969580000,87.32000000],[1787969880000,88.10000000],[1787970180000,88.80000000],[1787970480000,89.18000000],[1787970780000,89.54000000],[1787971080000,89.88000000],[1787971380000,90.16000000],[1787971680000,90.14000000],[1787971980000,89.72000000],[1787972280000,88.88000000],[1787972580000,88.62000000],[1787972880000,88.82000000],[1787973180000,89.28000000],[1787973480000,89.38000000],[1787973780000,89.68000000],[1787974080000,89.74000000],[1787974380000,90.16000000],[1787974680000,90.56000000],[1787974980000,91.42000000],[1787975280000,91.34000000],[1787975580000,91.18000000],[1787975880000,90.90000000],[1787976180000,89.78000000],[1787976480000,89.56000000],[1787976780000,89.28000000],[1787977080000,89.58000000],[1787977380000,90.10000000],[1787977680000,90.16000000],[1787977980000,89.80000000],[1787978280000,89.60000000],], 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,11.999999988],[1787954580000,11.088],[1787954880000,12.168],[1787955180000,11.16],[1787955480000,13.608],[1787955780000,12.888],[1787956080000,6.984],[1787956380000,5.904],[1787956680000,7.776],[1787956980000,9],[1787957280000,7.416],[1787957580000,8.784],[1787957880000,9.576],[1787958180000,12.96],[1787958480000,12.744],[1787958780000,10.872],[1787959080000,11.16],[1787959380000,11.592],[1787959680000,14.688],[1787959980000,17.352],[1787960280000,17.784],[1787960580000,13.464],[1787960880000,11.664],[1787961180000,10.872],[1787961480000,10.08],[1787961780000,12.24],[1787962080000,14.04],[1787962380000,13.104],[1787962680000,11.232],[1787962980000,16.56],[1787963280000,18],[1787963580000,20.736],[1787963880000,17.784],[1787964180000,15.48],[1787964480000,23.976],[1787964780000,19.728],[1787965080000,15.696],[1787965380000,18.288],[1787965680000,17.064],[1787965980000,20.736],[1787966280000,23.976],[1787966580000,22.104],[1787966880000,22.32],[1787967180000,20.16],[1787967480000,22.104],[1787967780000,24.696],[1787968080000,19.872],[1787968380000,17.424],[1787968680000,14.904],[1787968980000,14.328],[1787969280000,9.936],[1787969580000,10.152],[1787969880000,8.208],[1787970180000,5.832],[1787970480000,9.144],[1787970780000,8.64],[1787971080000,5.76],[1787971380000,5.472],[1787971680000,4.824],[1787971980000,6.264],[1787972280000,7.2],[1787972580000,6.264],[1787972880000,4.824],[1787973180000,5.4],[1787973480000,6.192],[1787973780000,5.04],[1787974080000,4.104],[1787974380000,6.84],[1787974680000,6.552],[1787974980000,9.072],[1787975280000,10.584],[1787975580000,13.752],[1787975880000,10.728],[1787976180000,9.36],[1787976480000,7.704],[1787976780000,7.704],[1787977080000,8.712],[1787977380000,7.056],[1787977680000,4.968],[1787977980000,4.392],[1787978280000,4.5],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1787954400000,17.160000012],[1787954580000,15.84],[1787954880000,18.216],[1787955180000,16.488],[1787955480000,19.224],[1787955780000,17.568],[1787956080000,10.368],[1787956380000,7.92],[1787956680000,11.736],[1787956980000,11.088],[1787957280000,10.08],[1787957580000,12.384],[1787957880000,12.672],[1787958180000,17.64],[1787958480000,16.92],[1787958780000,14.328],[1787959080000,13.824],[1787959380000,16.776],[1787959680000,20.016],[1787959980000,22.104],[1787960280000,22.752],[1787960580000,17.856],[1787960880000,14.976],[1787961180000,13.536],[1787961480000,13.32],[1787961780000,16.056],[1787962080000,18],[1787962380000,16.992],[1787962680000,14.184],[1787962980000,22.032],[1787963280000,25.416],[1787963580000,30.312],[1787963880000,22.248],[1787964180000,20.808],[1787964480000,32.256],[1787964780000,24.48],[1787965080000,19.728],[1787965380000,26.136],[1787965680000,23.184],[1787965980000,27.864],[1787966280000,30.24],[1787966580000,30.168],[1787966880000,29.736],[1787967180000,27.504],[1787967480000,30.6],[1787967780000,36.216],[1787968080000,29.16],[1787968380000,26.136],[1787968680000,22.248],[1787968980000,21.528],[1787969280000,15.552],[1787969580000,15.12],[1787969880000,10.944],[1787970180000,8.64],[1787970480000,11.664],[1787970780000,10.584],[1787971080000,7.488],[1787971380000,9.144],[1787971680000,7.632],[1787971980000,9.576],[1787972280000,9.864],[1787972580000,8.496],[1787972880000,6.696],[1787973180000,7.128],[1787973480000,8.064],[1787973780000,6.696],[1787974080000,5.976],[1787974380000,8.856],[1787974680000,8.28],[1787974980000,11.088],[1787975280000,12.816],[1787975580000,16.92],[1787975880000,13.968],[1787976180000,11.808],[1787976480000,10.44],[1787976780000,10.008],[1787977080000,10.656],[1787977380000,8.928],[1787977680000,6.696],[1787977980000,5.76],[1787978280000,6.66],], 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,156.26666667],[1787954580000,159.92000000],[1787954880000,173.50000000],[1787955180000,163.80000000],[1787955480000,154.64000000],[1787955780000,146.48000000],[1787956080000,145.52000000],[1787956380000,165.40000000],[1787956680000,186.88000000],[1787956980000,195.76000000],[1787957280000,202.30000000],[1787957580000,173.40000000],[1787957880000,204.48000000],[1787958180000,201.02000000],[1787958480000,186.72000000],[1787958780000,186.02000000],[1787959080000,199.22000000],[1787959380000,217.86000000],[1787959680000,237.80000000],[1787959980000,242.60000000],[1787960280000,236.96000000],[1787960580000,245.84000000],[1787960880000,255.60000000],[1787961180000,259.58000000],[1787961480000,264.48000000],[1787961780000,256.80000000],[1787962080000,250.26000000],[1787962380000,259.88000000],[1787962680000,269.90000000],[1787962980000,278.38000000],[1787963280000,286.56000000],[1787963580000,282.00000000],[1787963880000,272.64000000],[1787964180000,270.98000000],[1787964480000,269.94000000],[1787964780000,272.46000000],[1787965080000,271.58000000],[1787965380000,274.38000000],[1787965680000,271.00000000],[1787965980000,266.82000000],[1787966280000,271.08000000],[1787966580000,276.16000000],[1787966880000,278.30000000],[1787967180000,275.82000000],[1787967480000,276.26000000],[1787967780000,298.40000000],[1787968080000,302.58000000],[1787968380000,299.22000000],[1787968680000,296.32000000],[1787968980000,296.22000000],[1787969280000,296.58000000],[1787969580000,295.84000000],[1787969880000,286.04000000],[1787970180000,291.92000000],[1787970480000,274.42000000],[1787970780000,268.32000000],[1787971080000,285.94000000],[1787971380000,289.64000000],[1787971680000,294.10000000],[1787971980000,309.58000000],[1787972280000,349.70000000],[1787972580000,210.54000000],[1787972880000,273.62000000],[1787973180000,294.68000000],[1787973480000,305.16000000],[1787973780000,352.78000000],[1787974080000,342.14000000],[1787974380000,50.38000000],[1787974680000,169.82000000],[1787974980000,267.04000000],[1787975280000,257.84000000],[1787975580000,250.48000000],[1787975880000,260.06000000],[1787976180000,267.50000000],[1787976480000,261.06000000],[1787976780000,257.12000000],[1787977080000,253.28000000],[1787977380000,260.16000000],[1787977680000,255.50000000],[1787977980000,287.82000000],[1787978280000,299.35000000],], 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.024],[1787963880000,0.084],[1787964180000,0.156],[1787964480000,0.334],[1787964780000,0.702],[1787965080000,1.118],[1787965380000,1.354],[1787965680000,1.66],[1787965980000,1.778],[1787966280000,1.868],[1787966580000,1.914],[1787966880000,1.938],[1787967180000,1.942],[1787967480000,1.942],[1787967780000,1.942],[1787968080000,1.942],[1787968380000,1.942],[1787968680000,1.942],[1787968980000,1.942],[1787969280000,1.942],[1787969580000,1.942],[1787969880000,1.942],[1787970180000,1.942],[1787970480000,1.942],[1787970780000,1.942],[1787971080000,1.942],[1787971380000,1.942],[1787971680000,1.942],[1787971980000,1.942],[1787972280000,1.972],[1787972580000,1.972],[1787972880000,1.976],[1787973180000,1.976],[1787973480000,1.976],[1787973780000,1.976],[1787974080000,1.976],[1787974380000,1.976],[1787974680000,1.976],[1787974980000,1.976],[1787975280000,1.976],[1787975580000,1.976],[1787975880000,1.976],[1787976180000,1.976],[1787976480000,1.976],[1787976780000,1.976],[1787977080000,1.976],[1787977380000,1.976],[1787977680000,1.976],[1787977980000,1.976],[1787978280000,1.976],], 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; }