var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1787954400000,13.50000000],[1787954580000,13.38000000],[1787954880000,13.16000000],[1787955180000,12.98000000],[1787955480000,12.84000000],[1787955780000,12.92000000],[1787956080000,13.02000000],[1787956380000,13.18000000],[1787956680000,13.76000000],[1787956980000,16.22000000],[1787957280000,18.04000000],[1787957580000,19.00000000],[1787957880000,19.82000000],[1787958180000,20.40000000],[1787958480000,20.62000000],[1787958780000,20.88000000],[1787959080000,21.00000000],[1787959380000,21.10000000],[1787959680000,21.20000000],[1787959980000,21.18000000],[1787960280000,21.08000000],[1787960580000,20.92000000],[1787960880000,20.90000000],[1787961180000,20.90000000],[1787961480000,20.86000000],[1787961780000,20.78000000],[1787962080000,20.66000000],[1787962380000,20.66000000],[1787962680000,20.66000000],[1787962980000,20.50000000],[1787963280000,20.50000000],[1787963580000,20.42000000],[1787963880000,20.40000000],[1787964180000,20.30000000],[1787964480000,20.18000000],[1787964780000,20.16000000],[1787965080000,20.20000000],[1787965380000,20.10000000],[1787965680000,20.14000000],[1787965980000,20.20000000],[1787966280000,20.10000000],[1787966580000,20.12000000],[1787966880000,20.08000000],[1787967180000,20.04000000],[1787967480000,20.00000000],[1787967780000,20.00000000],[1787968080000,19.92000000],[1787968380000,19.90000000],[1787968680000,19.90000000],[1787968980000,19.90000000],[1787969280000,19.78000000],[1787969580000,19.80000000],[1787969880000,19.80000000],[1787970180000,19.76000000],[1787970480000,19.64000000],[1787970780000,19.60000000],[1787971080000,19.60000000],[1787971380000,19.60000000],[1787971680000,19.60000000],[1787971980000,19.60000000],[1787972280000,19.56000000],[1787972580000,19.50000000],[1787972880000,19.50000000],[1787973180000,19.52000000],[1787973480000,19.50000000],[1787973780000,19.40000000],[1787974080000,19.38000000],[1787974380000,19.40000000],[1787974680000,19.30000000],[1787974980000,19.30000000],[1787975280000,19.32000000],[1787975580000,19.38000000],[1787975880000,19.32000000],[1787976180000,19.30000000],[1787976480000,19.34000000],[1787976780000,19.46000000],[1787977080000,19.56000000],[1787977380000,19.66000000],[1787977680000,19.76000000],[1787977980000,19.82000000],[1787978280000,19.90000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1787954400000,6.5],[1787954580000,6.4],[1787954880000,6.3],[1787955180000,5.6],[1787955480000,5.8],[1787955780000,5.8],[1787956080000,6],[1787956380000,6.4],[1787956680000,6.6],[1787956980000,7.3],[1787957280000,7.9],[1787957580000,8],[1787957880000,8.1],[1787958180000,8.2],[1787958480000,8.1],[1787958780000,8.2],[1787959080000,8.2],[1787959380000,8.3],[1787959680000,8.3],[1787959980000,8.3],[1787960280000,8.3],[1787960580000,8.4],[1787960880000,8.4],[1787961180000,8.4],[1787961480000,8.4],[1787961780000,8.4],[1787962080000,8.4],[1787962380000,8.4],[1787962680000,8.4],[1787962980000,8.4],[1787963280000,8.4],[1787963580000,8.4],[1787963880000,8.4],[1787964180000,8.5],[1787964480000,8.5],[1787964780000,8.5],[1787965080000,8.6],[1787965380000,8.5],[1787965680000,8.5],[1787965980000,8.6],[1787966280000,8.5],[1787966580000,8.5],[1787966880000,8.4],[1787967180000,8.4],[1787967480000,8.4],[1787967780000,8.4],[1787968080000,8.4],[1787968380000,8.4],[1787968680000,8.4],[1787968980000,8.4],[1787969280000,8.4],[1787969580000,8.4],[1787969880000,8.3],[1787970180000,8.4],[1787970480000,8.4],[1787970780000,8.4],[1787971080000,8.4],[1787971380000,8.4],[1787971680000,8.5],[1787971980000,8.5],[1787972280000,8.5],[1787972580000,8.5],[1787972880000,8.5],[1787973180000,8.4],[1787973480000,8.4],[1787973780000,8.3],[1787974080000,8.3],[1787974380000,8.3],[1787974680000,8.3],[1787974980000,8.2],[1787975280000,8.2],[1787975580000,8.2],[1787975880000,8.2],[1787976180000,8.2],[1787976480000,8.1],[1787976780000,8.1],[1787977080000,8.2],[1787977380000,8.2],[1787977680000,8.2],[1787977980000,8.2],[1787978280000,8.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,9.66666667],[1787954580000,9.52000000],[1787954880000,9.50000000],[1787955180000,9.50000000],[1787955480000,9.72000000],[1787955780000,9.86000000],[1787956080000,9.82000000],[1787956380000,9.76000000],[1787956680000,10.40000000],[1787956980000,13.44000000],[1787957280000,15.22000000],[1787957580000,16.60000000],[1787957880000,17.52000000],[1787958180000,18.38000000],[1787958480000,18.68000000],[1787958780000,18.82000000],[1787959080000,19.04000000],[1787959380000,19.36000000],[1787959680000,19.62000000],[1787959980000,19.40000000],[1787960280000,19.48000000],[1787960580000,19.18000000],[1787960880000,19.20000000],[1787961180000,19.16000000],[1787961480000,19.26000000],[1787961780000,19.12000000],[1787962080000,19.00000000],[1787962380000,19.16000000],[1787962680000,19.02000000],[1787962980000,18.84000000],[1787963280000,19.00000000],[1787963580000,18.92000000],[1787963880000,18.96000000],[1787964180000,18.88000000],[1787964480000,18.76000000],[1787964780000,18.76000000],[1787965080000,18.92000000],[1787965380000,18.96000000],[1787965680000,19.10000000],[1787965980000,19.18000000],[1787966280000,19.16000000],[1787966580000,18.92000000],[1787966880000,18.72000000],[1787967180000,18.66000000],[1787967480000,18.60000000],[1787967780000,18.68000000],[1787968080000,18.48000000],[1787968380000,18.66000000],[1787968680000,18.70000000],[1787968980000,18.60000000],[1787969280000,18.52000000],[1787969580000,18.56000000],[1787969880000,18.64000000],[1787970180000,18.68000000],[1787970480000,18.44000000],[1787970780000,18.56000000],[1787971080000,18.56000000],[1787971380000,18.74000000],[1787971680000,18.84000000],[1787971980000,18.88000000],[1787972280000,18.88000000],[1787972580000,18.90000000],[1787972880000,18.80000000],[1787973180000,18.82000000],[1787973480000,18.46000000],[1787973780000,18.22000000],[1787974080000,18.12000000],[1787974380000,18.16000000],[1787974680000,18.06000000],[1787974980000,18.28000000],[1787975280000,18.42000000],[1787975580000,18.34000000],[1787975880000,18.36000000],[1787976180000,18.30000000],[1787976480000,18.58000000],[1787976780000,18.86000000],[1787977080000,19.12000000],[1787977380000,19.36000000],[1787977680000,19.62000000],[1787977980000,19.70000000],[1787978280000,19.70000000],], 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,62.90000000],[1787954580000,62.78000000],[1787954880000,63.34000000],[1787955180000,61.24000000],[1787955480000,62.40000000],[1787955780000,62.08000000],[1787956080000,62.72000000],[1787956380000,63.68000000],[1787956680000,62.44000000],[1787956980000,55.80000000],[1787957280000,51.62000000],[1787957580000,49.14000000],[1787957880000,46.78000000],[1787958180000,45.46000000],[1787958480000,44.76000000],[1787958780000,44.18000000],[1787959080000,44.02000000],[1787959380000,43.82000000],[1787959680000,43.56000000],[1787959980000,43.80000000],[1787960280000,44.12000000],[1787960580000,44.60000000],[1787960880000,44.66000000],[1787961180000,44.76000000],[1787961480000,44.84000000],[1787961780000,45.16000000],[1787962080000,45.52000000],[1787962380000,45.38000000],[1787962680000,45.52000000],[1787962980000,45.92000000],[1787963280000,45.92000000],[1787963580000,46.26000000],[1787963880000,46.32000000],[1787964180000,46.74000000],[1787964480000,47.08000000],[1787964780000,47.10000000],[1787965080000,47.24000000],[1787965380000,47.48000000],[1787965680000,47.28000000],[1787965980000,47.24000000],[1787966280000,47.44000000],[1787966580000,47.20000000],[1787966880000,47.24000000],[1787967180000,47.22000000],[1787967480000,47.34000000],[1787967780000,47.42000000],[1787968080000,47.70000000],[1787968380000,47.58000000],[1787968680000,47.68000000],[1787968980000,47.78000000],[1787969280000,48.00000000],[1787969580000,47.88000000],[1787969880000,47.76000000],[1787970180000,48.12000000],[1787970480000,48.44000000],[1787970780000,48.66000000],[1787971080000,48.64000000],[1787971380000,48.62000000],[1787971680000,48.88000000],[1787971980000,48.98000000],[1787972280000,49.02000000],[1787972580000,49.06000000],[1787972880000,49.16000000],[1787973180000,48.90000000],[1787973480000,49.00000000],[1787973780000,48.94000000],[1787974080000,48.90000000],[1787974380000,48.88000000],[1787974680000,49.02000000],[1787974980000,48.94000000],[1787975280000,48.60000000],[1787975580000,48.56000000],[1787975880000,48.68000000],[1787976180000,48.74000000],[1787976480000,48.48000000],[1787976780000,48.12000000],[1787977080000,47.88000000],[1787977380000,47.66000000],[1787977680000,47.34000000],[1787977980000,47.14000000],[1787978280000,47.00000000],], 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.480000012],[1787954580000,3.024],[1787954880000,4.464],[1787955180000,4.68],[1787955480000,6.48],[1787955780000,5.904],[1787956080000,5.544],[1787956380000,5.832],[1787956680000,7.488],[1787956980000,10.656],[1787957280000,9.072],[1787957580000,9.576],[1787957880000,10.512],[1787958180000,10.152],[1787958480000,10.44],[1787958780000,13.464],[1787959080000,11.592],[1787959380000,13.392],[1787959680000,14.76],[1787959980000,12.816],[1787960280000,12.456],[1787960580000,11.304],[1787960880000,14.4],[1787961180000,14.328],[1787961480000,14.04],[1787961780000,12.672],[1787962080000,12.456],[1787962380000,17.64],[1787962680000,10.584],[1787962980000,13.536],[1787963280000,10.512],[1787963580000,12.312],[1787963880000,12.24],[1787964180000,10.512],[1787964480000,9],[1787964780000,11.376],[1787965080000,8.712],[1787965380000,8.28],[1787965680000,12.456],[1787965980000,10.368],[1787966280000,9.792],[1787966580000,12.024],[1787966880000,9.576],[1787967180000,10.008],[1787967480000,10.944],[1787967780000,10.152],[1787968080000,9.432],[1787968380000,10.224],[1787968680000,10.656],[1787968980000,8.424],[1787969280000,9.216],[1787969580000,10.728],[1787969880000,9.432],[1787970180000,8.928],[1787970480000,9.216],[1787970780000,8.568],[1787971080000,9.288],[1787971380000,8.712],[1787971680000,7.848],[1787971980000,7.992],[1787972280000,8.928],[1787972580000,7.128],[1787972880000,8.064],[1787973180000,8.784],[1787973480000,8.064],[1787973780000,10.152],[1787974080000,12.24],[1787974380000,10.656],[1787974680000,9.648],[1787974980000,10.512],[1787975280000,11.088],[1787975580000,9.072],[1787975880000,10.728],[1787976180000,8.928],[1787976480000,11.016],[1787976780000,11.52],[1787977080000,9.144],[1787977380000,10.656],[1787977680000,9.144],[1787977980000,11.016],[1787978280000,9],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1787954400000,3.840000012],[1787954580000,3.888],[1787954880000,5.256],[1787955180000,6.192],[1787955480000,7.632],[1787955780000,7.776],[1787956080000,6.912],[1787956380000,7.776],[1787956680000,11.088],[1787956980000,17.496],[1787957280000,13.968],[1787957580000,16.344],[1787957880000,18.36],[1787958180000,17.064],[1787958480000,16.488],[1787958780000,20.808],[1787959080000,19.44],[1787959380000,21.168],[1787959680000,22.248],[1787959980000,20.16],[1787960280000,20.376],[1787960580000,18.576],[1787960880000,23.544],[1787961180000,20.592],[1787961480000,21.456],[1787961780000,22.896],[1787962080000,20.592],[1787962380000,24.192],[1787962680000,17.856],[1787962980000,20.736],[1787963280000,16.992],[1787963580000,19.296],[1787963880000,20.808],[1787964180000,17.496],[1787964480000,15.768],[1787964780000,19.008],[1787965080000,15.192],[1787965380000,15.408],[1787965680000,23.112],[1787965980000,17.928],[1787966280000,18.792],[1787966580000,19.728],[1787966880000,16.488],[1787967180000,16.272],[1787967480000,20.88],[1787967780000,16.56],[1787968080000,17.424],[1787968380000,18.072],[1787968680000,18.864],[1787968980000,14.976],[1787969280000,14.688],[1787969580000,17.064],[1787969880000,16.344],[1787970180000,15.192],[1787970480000,14.76],[1787970780000,13.536],[1787971080000,16.56],[1787971380000,15.264],[1787971680000,13.824],[1787971980000,15.336],[1787972280000,16.488],[1787972580000,12.24],[1787972880000,13.104],[1787973180000,13.824],[1787973480000,13.608],[1787973780000,16.92],[1787974080000,20.088],[1787974380000,17.568],[1787974680000,16.704],[1787974980000,16.056],[1787975280000,20.376],[1787975580000,19.152],[1787975880000,18.576],[1787976180000,15.624],[1787976480000,18.36],[1787976780000,17.784],[1787977080000,15.408],[1787977380000,17.424],[1787977680000,14.904],[1787977980000,19.944],[1787978280000,15.12],], 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,69.53333333],[1787954580000,93.90000000],[1787954880000,82.90000000],[1787955180000,93.70000000],[1787955480000,90.10000000],[1787955780000,99.00000000],[1787956080000,109.22000000],[1787956380000,114.72000000],[1787956680000,115.44000000],[1787956980000,118.34000000],[1787957280000,123.58000000],[1787957580000,119.62000000],[1787957880000,124.56000000],[1787958180000,123.70000000],[1787958480000,120.82000000],[1787958780000,122.20000000],[1787959080000,124.04000000],[1787959380000,123.56000000],[1787959680000,124.00000000],[1787959980000,121.82000000],[1787960280000,122.20000000],[1787960580000,122.58000000],[1787960880000,117.30000000],[1787961180000,114.64000000],[1787961480000,120.82000000],[1787961780000,120.72000000],[1787962080000,121.22000000],[1787962380000,119.22000000],[1787962680000,118.24000000],[1787962980000,122.58000000],[1787963280000,126.12000000],[1787963580000,123.76000000],[1787963880000,124.50000000],[1787964180000,125.50000000],[1787964480000,133.22000000],[1787964780000,130.58000000],[1787965080000,129.38000000],[1787965380000,135.74000000],[1787965680000,133.36000000],[1787965980000,134.34000000],[1787966280000,131.18000000],[1787966580000,126.48000000],[1787966880000,127.68000000],[1787967180000,122.12000000],[1787967480000,125.32000000],[1787967780000,126.08000000],[1787968080000,128.66000000],[1787968380000,131.32000000],[1787968680000,125.78000000],[1787968980000,129.88000000],[1787969280000,127.56000000],[1787969580000,130.44000000],[1787969880000,130.50000000],[1787970180000,128.08000000],[1787970480000,130.56000000],[1787970780000,128.14000000],[1787971080000,130.80000000],[1787971380000,131.82000000],[1787971680000,131.68000000],[1787971980000,126.78000000],[1787972280000,132.44000000],[1787972580000,128.96000000],[1787972880000,132.42000000],[1787973180000,129.68000000],[1787973480000,140.24000000],[1787973780000,128.56000000],[1787974080000,128.78000000],[1787974380000,127.02000000],[1787974680000,130.40000000],[1787974980000,128.52000000],[1787975280000,125.72000000],[1787975580000,136.58000000],[1787975880000,126.90000000],[1787976180000,130.26000000],[1787976480000,128.18000000],[1787976780000,125.52000000],[1787977080000,127.56000000],[1787977380000,131.18000000],[1787977680000,123.26000000],[1787977980000,127.30000000],[1787978280000,131.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; }