var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1773270003000,5.70000000],[1773270195000,5.70000000],[1773270451000,5.62000000],[1773270771000,5.46000000],[1773271091000,4.94000000],[1773271411000,4.87500000],[1773271667000,4.76000000],[1773271987000,4.50000000],[1773272307000,4.67500000],[1773272563000,4.74000000],[1773272883000,4.60000000],[1773273203000,4.32500000],[1773273459000,4.16000000],[1773273779000,3.90000000],[1773274099000,3.82500000],[1773274351000,3.76000000],[1773274675000,3.54000000],[1773274995000,3.60000000],[1773275251000,3.46000000],[1773275571000,3.14000000],[1773275891000,3.06000000],[1773276211000,2.92500000],[1773276467000,2.80000000],[1773276787000,2.92000000],[1773277107000,3.05000000],[1773277363000,2.86666667],[1773277653000,2.77500000],[1773278020000,3.30000000],[1773278346000,3.50000000],[1773278612000,3.60000000],[1773278884000,3.50000000],[1773279164000,3.40000000],[1773279571000,3.40000000],[1773279764000,3.13333333],[1773280052000,2.80000000],[1773280382000,2.90000000],[1773280783000,2.70000000],[1773280979000,2.40000000],[1773281299000,2.37500000],[1773281551000,2.40000000],[1773281875000,2.06000000],[1773282195000,2.05000000],[1773282451000,2.02000000],[1773282771000,1.74000000],[1773283091000,1.68000000],[1773283411000,1.55000000],[1773283656000,1.28000000],[1773283987000,1.16000000],[1773284307000,1.10000000],[1773284553000,1.18000000],[1773284883000,1.36000000],[1773285203000,0.77500000],[1773285451000,0.62000000],[1773285779000,0.96000000],[1773286099000,1.22500000],[1773286351000,0.82000000],[1773286675000,0.64000000],[1773286995000,0.80000000],[1773287251000,0.80000000],[1773287571000,0.30000000],[1773287891000,0.30000000],[1773288211000,0.50000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1773270003000,2.9],[1773270195000,3],[1773270451000,2.9],[1773270771000,2.7],[1773271091000,2.4],[1773271411000,2.4],[1773271667000,2.4],[1773271987000,2.2],[1773272307000,2.4],[1773272563000,2.4],[1773272883000,2.3],[1773273203000,2.1],[1773273459000,2],[1773273779000,1.8],[1773274099000,1.8],[1773274351000,1.8],[1773274675000,1.6],[1773274995000,1.8],[1773275251000,1.6],[1773275571000,1.3],[1773275891000,1.4],[1773276211000,1.3],[1773276467000,1.2],[1773276787000,1.4],[1773277107000,1.5],[1773277363000,1.3],[1773277653000,1.3],[1773278020000,1.8],[1773278346000,1.8],[1773278612000,1.9],[1773278884000,1.8],[1773279164000,1.7],[1773279571000,1.7],[1773279764000,1.5],[1773280052000,1.1],[1773280382000,1.4],[1773280783000,1.2],[1773280979000,0.9],[1773281299000,1],[1773281551000,1],[1773281875000,0.7],[1773282195000,0.8],[1773282451000,0.7],[1773282771000,0.5],[1773283091000,0.5],[1773283411000,0.4],[1773283656000,0.1],[1773283987000,-0],[1773284307000,0.1],[1773284553000,0.2],[1773284883000,0.4],[1773285203000,-0.2],[1773285451000,-0.4],[1773285779000,0.1],[1773286099000,0.3],[1773286351000,-0.2],[1773286675000,-0.2],[1773286995000,-0.1],[1773287251000,-0.1],[1773287571000,-0.6],[1773287891000,-0.6],[1773288211000,-0.4],], 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() { dataset = [ { label: 'Vlhkosť (%)', data: [[1773270003000,82.33333333],[1773270195000,82.75000000],[1773270451000,83.00000000],[1773270771000,82.60000000],[1773271091000,83.60000000],[1773271411000,84.00000000],[1773271667000,85.00000000],[1773271987000,85.20000000],[1773272307000,85.50000000],[1773272563000,85.00000000],[1773272883000,85.00000000],[1773273203000,85.50000000],[1773273459000,86.00000000],[1773273779000,86.60000000],[1773274099000,87.00000000],[1773274351000,87.00000000],[1773274675000,87.60000000],[1773274995000,88.00000000],[1773275251000,88.00000000],[1773275571000,88.00000000],[1773275891000,89.00000000],[1773276211000,89.00000000],[1773276467000,89.60000000],[1773276787000,90.00000000],[1773277107000,90.00000000],[1773277363000,89.33333333],[1773277653000,90.00000000],[1773278020000,90.00000000],[1773278346000,89.00000000],[1773278612000,89.00000000],[1773278884000,89.00000000],[1773279164000,89.00000000],[1773279571000,89.00000000],[1773279764000,89.00000000],[1773280052000,89.00000000],[1773280382000,90.00000000],[1773280783000,90.00000000],[1773280979000,90.00000000],[1773281299000,91.00000000],[1773281551000,90.80000000],[1773281875000,91.00000000],[1773282195000,91.25000000],[1773282451000,91.20000000],[1773282771000,91.60000000],[1773283091000,92.00000000],[1773283411000,92.00000000],[1773283656000,92.00000000],[1773283987000,92.00000000],[1773284307000,93.00000000],[1773284553000,93.00000000],[1773284883000,93.40000000],[1773285203000,93.00000000],[1773285451000,93.00000000],[1773285779000,94.00000000],[1773286099000,93.75000000],[1773286351000,93.00000000],[1773286675000,94.00000000],[1773286995000,94.00000000],[1773287251000,94.00000000],[1773287571000,94.00000000],[1773287891000,94.00000000],[1773288211000,94.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: 'Atmosférický tlak (hPa)', data: [[1773270003000,1022.7],[1773270195000,1022.8],[1773270451000,1022.8],[1773270771000,1022.7],[1773271091000,1022.8],[1773271411000,1022.7],[1773271667000,1022.8],[1773271987000,1022.8],[1773272307000,1022.9],[1773272563000,1022.9],[1773272883000,1023],[1773273203000,1023],[1773273459000,1023],[1773273779000,1022.9],[1773274099000,1023],[1773274351000,1022.9],[1773274675000,1023],[1773274995000,1023.1],[1773275251000,1023],[1773275571000,1022.9],[1773275891000,1023.1],[1773276211000,1023],[1773276467000,1023],[1773276787000,1023],[1773277107000,1023],[1773277363000,1022.9],[1773277653000,1022.9],[1773278020000,1022.8],[1773278346000,1022.8],[1773278612000,1022.7],[1773278884000,1022.7],[1773279164000,1022.7],[1773279571000,1022.9],[1773279764000,1022.7],[1773280052000,1022.9],[1773280382000,1022.8],[1773280783000,1022.9],[1773280979000,1022.8],[1773281299000,1022.9],[1773281551000,1022.8],[1773281875000,1022.8],[1773282195000,1023],[1773282451000,1022.8],[1773282771000,1023],[1773283091000,1022.9],[1773283411000,1023.1],[1773283656000,1023.1],[1773283987000,1023.1],[1773284307000,1023.1],[1773284553000,1023.1],[1773284883000,1023.1],[1773285203000,1023.2],[1773285451000,1023.2],[1773285779000,1023.2],[1773286099000,1023.4],[1773286351000,1023.3],[1773286675000,1023.3],[1773286995000,1023.5],[1773287251000,1023.4],[1773287571000,1023.5],[1773287891000,1023.6],[1773288211000,1023.7],], color: '#000000' } ]; var options = { xaxes: [{ axisLabel: 'pressure', }], 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.1hPa' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-pressure-legend' } }; graphs['#chart-pressure'] = $.plot('#chart-pressure', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Rýchlosť vetra (km/h)', data: [[1773270003000,0],[1773270195000,0],[1773270451000,0.216],[1773270771000,0.648],[1773271091000,0.432],[1773271411000,0],[1773271667000,0],[1773271987000,0],[1773272307000,0.36],[1773272563000,0.288],[1773272883000,0.432],[1773273203000,0],[1773273459000,0],[1773273779000,0],[1773274099000,0],[1773274351000,0],[1773274675000,0],[1773274995000,0],[1773275251000,0],[1773275571000,0],[1773275891000,0],[1773276211000,0],[1773276467000,0.072],[1773276787000,0.288],[1773277107000,0.63],[1773277363000,0],[1773277653000,0.63],[1773278020000,0.36],[1773278346000,0],[1773278612000,0],[1773278884000,0],[1773279164000,0],[1773279571000,0],[1773279764000,0.119999988],[1773280052000,0.09],[1773280382000,0.216],[1773280783000,0],[1773280979000,0],[1773281299000,0],[1773281551000,0],[1773281875000,0],[1773282195000,0],[1773282451000,0],[1773282771000,0],[1773283091000,0],[1773283411000,0],[1773283656000,0],[1773283987000,0],[1773284307000,0],[1773284553000,0],[1773284883000,0.072],[1773285203000,0],[1773285451000,0],[1773285779000,0.072],[1773286099000,0],[1773286351000,0],[1773286675000,0],[1773286995000,0],[1773287251000,0],[1773287571000,0],[1773287891000,0],[1773288211000,0],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1773270003000,0],[1773270195000,0],[1773270451000,1.008],[1773270771000,1.512],[1773271091000,0.504],[1773271411000,0],[1773271667000,0],[1773271987000,0],[1773272307000,0.63],[1773272563000,0.504],[1773272883000,0.504],[1773273203000,0],[1773273459000,0],[1773273779000,0],[1773274099000,0],[1773274351000,0],[1773274675000,0],[1773274995000,0],[1773275251000,0],[1773275571000,0],[1773275891000,0],[1773276211000,0],[1773276467000,0.504],[1773276787000,0.504],[1773277107000,1.26],[1773277363000,0],[1773277653000,0.63],[1773278020000,0.63],[1773278346000,0],[1773278612000,0],[1773278884000,0],[1773279164000,0],[1773279571000,0],[1773279764000,0.839999988],[1773280052000,0.63],[1773280382000,1.008],[1773280783000,0],[1773280979000,0],[1773281299000,0],[1773281551000,0],[1773281875000,0],[1773282195000,0],[1773282451000,0],[1773282771000,0],[1773283091000,0],[1773283411000,0],[1773283656000,0],[1773283987000,0],[1773284307000,0],[1773284553000,0],[1773284883000,0.504],[1773285203000,0],[1773285451000,0],[1773285779000,0.504],[1773286099000,0],[1773286351000,0],[1773286675000,0],[1773286995000,0],[1773287251000,0],[1773287571000,0],[1773287891000,0],[1773288211000,0],], 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: [[1773270003000,226.33333333],[1773270195000,337.50000000],[1773270451000,325.20000000],[1773270771000,22.20000000],[1773271091000,278.20000000],[1773271411000,349.75000000],[1773271667000,216.00000000],[1773271987000,277.40000000],[1773272307000,339.75000000],[1773272563000,142.00000000],[1773272883000,70.60000000],[1773273203000,90.00000000],[1773273459000,143.20000000],[1773273779000,351.40000000],[1773274099000,354.25000000],[1773274351000,357.80000000],[1773274675000,353.40000000],[1773274995000,181.50000000],[1773275251000,73.80000000],[1773275571000,3.20000000],[1773275891000,2.60000000],[1773276211000,8.50000000],[1773276467000,212.40000000],[1773276787000,209.60000000],[1773277107000,101.25000000],[1773277363000,5.33333333],[1773277653000,335.75000000],[1773278020000,329.50000000],[1773278346000,171.50000000],[1773278612000,225.66666667],[1773278884000,117.66666667],[1773279164000,337.80000000],[1773279571000,235.00000000],[1773279764000,15.66666667],[1773280052000,160.25000000],[1773280382000,218.20000000],[1773280783000,7.00000000],[1773280979000,143.60000000],[1773281299000,341.25000000],[1773281551000,78.00000000],[1773281875000,142.80000000],[1773282195000,96.00000000],[1773282451000,73.00000000],[1773282771000,354.20000000],[1773283091000,355.00000000],[1773283411000,92.50000000],[1773283656000,2.60000000],[1773283987000,1.00000000],[1773284307000,0.75000000],[1773284553000,282.00000000],[1773284883000,212.80000000],[1773285203000,12.00000000],[1773285451000,6.40000000],[1773285779000,343.00000000],[1773286099000,95.50000000],[1773286351000,5.40000000],[1773286675000,282.20000000],[1773286995000,346.00000000],[1773287251000,352.80000000],[1773287571000,7.00000000],[1773287891000,349.20000000],[1773288211000,352.00000000],], 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: 'Slnečné žiarenie (W/m2)', data: [[1773270003000,0.00000000],[1773270195000,0.00000000],[1773270451000,0.00000000],[1773270771000,0.00000000],[1773271091000,0.00000000],[1773271411000,0.00000000],[1773271667000,0.00000000],[1773271987000,0.00000000],[1773272307000,0.00000000],[1773272563000,0.00000000],[1773272883000,0.00000000],[1773273203000,0.00000000],[1773273459000,0.00000000],[1773273779000,0.00000000],[1773274099000,0.00000000],[1773274351000,0.00000000],[1773274675000,0.00000000],[1773274995000,0.00000000],[1773275251000,0.00000000],[1773275571000,0.00000000],[1773275891000,0.00000000],[1773276211000,0.00000000],[1773276467000,0.00000000],[1773276787000,0.00000000],[1773277107000,0.00000000],[1773277363000,0.00000000],[1773277653000,0.00000000],[1773278020000,0.00000000],[1773278346000,0.00000000],[1773278612000,0.00000000],[1773278884000,0.00000000],[1773279164000,0.00000000],[1773279571000,0.00000000],[1773279764000,0.00000000],[1773280052000,0.00000000],[1773280382000,0.00000000],[1773280783000,0.00000000],[1773280979000,0.00000000],[1773281299000,0.00000000],[1773281551000,0.00000000],[1773281875000,0.00000000],[1773282195000,0.00000000],[1773282451000,0.00000000],[1773282771000,0.00000000],[1773283091000,0.00000000],[1773283411000,0.00000000],[1773283656000,0.00000000],[1773283987000,0.00000000],[1773284307000,0.00000000],[1773284553000,0.00000000],[1773284883000,0.00000000],[1773285203000,0.00000000],[1773285451000,0.00000000],[1773285779000,0.00000000],[1773286099000,0.00000000],[1773286351000,0.00000000],[1773286675000,0.00000000],[1773286995000,0.00000000],[1773287251000,0.00000000],[1773287571000,0.00000000],[1773287891000,0.00000000],[1773288211000,0.00000000],], color: '#ffb92f' } ]; var options = { xaxes: [{ axisLabel: 'solar_radiation', }], 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.1W/m2' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-solar-radiation-legend' } }; graphs['#chart-solar-radiation'] = $.plot('#chart-solar-radiation', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'UV žiarenie', data: [[1773270003000,0.00000000],[1773270195000,0.00000000],[1773270451000,0.00000000],[1773270771000,0.00000000],[1773271091000,0.00000000],[1773271411000,0.00000000],[1773271667000,0.00000000],[1773271987000,0.00000000],[1773272307000,0.00000000],[1773272563000,0.00000000],[1773272883000,0.00000000],[1773273203000,0.00000000],[1773273459000,0.00000000],[1773273779000,0.00000000],[1773274099000,0.00000000],[1773274351000,0.00000000],[1773274675000,0.00000000],[1773274995000,0.00000000],[1773275251000,0.00000000],[1773275571000,0.00000000],[1773275891000,0.00000000],[1773276211000,0.00000000],[1773276467000,0.00000000],[1773276787000,0.00000000],[1773277107000,0.00000000],[1773277363000,0.00000000],[1773277653000,0.00000000],[1773278020000,0.00000000],[1773278346000,0.00000000],[1773278612000,0.00000000],[1773278884000,0.00000000],[1773279164000,0.00000000],[1773279571000,0.00000000],[1773279764000,0.00000000],[1773280052000,0.00000000],[1773280382000,0.00000000],[1773280783000,0.00000000],[1773280979000,0.00000000],[1773281299000,0.00000000],[1773281551000,0.00000000],[1773281875000,0.00000000],[1773282195000,0.00000000],[1773282451000,0.00000000],[1773282771000,0.00000000],[1773283091000,0.00000000],[1773283411000,0.00000000],[1773283656000,0.00000000],[1773283987000,0.00000000],[1773284307000,0.00000000],[1773284553000,0.00000000],[1773284883000,0.00000000],[1773285203000,0.00000000],[1773285451000,0.00000000],[1773285779000,0.00000000],[1773286099000,0.00000000],[1773286351000,0.00000000],[1773286675000,0.00000000],[1773286995000,0.00000000],[1773287251000,0.00000000],[1773287571000,0.00000000],[1773287891000,0.00000000],[1773288211000,0.00000000],], color: '#802674' } ]; var options = { xaxes: [{ axisLabel: 'uv', }], 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.0' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-uv-legend' } }; graphs['#chart-uv'] = $.plot('#chart-uv', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Zrážky', data: [[1773270003000,0.00000000],[1773270195000,0.00000000],[1773270451000,0.00000000],[1773270771000,0.00000000],[1773271091000,0.00000000],[1773271411000,0.00000000],[1773271667000,0.00000000],[1773271987000,0.00000000],[1773272307000,0.00000000],[1773272563000,0.00000000],[1773272883000,0.00000000],[1773273203000,0.00000000],[1773273459000,0.00000000],[1773273779000,0.00000000],[1773274099000,0.00000000],[1773274351000,0.00000000],[1773274675000,0.00000000],[1773274995000,0.00000000],[1773275251000,0.00000000],[1773275571000,0.00000000],[1773275891000,0.00000000],[1773276211000,0.00000000],[1773276467000,0.00000000],[1773276787000,0.00000000],[1773277107000,0.00000000],[1773277363000,0.00000000],[1773277653000,0.00000000],[1773278020000,0.00000000],[1773278346000,0.00000000],[1773278612000,0.00000000],[1773278884000,0.00000000],[1773279164000,0.00000000],[1773279571000,0.00000000],[1773279764000,0.00000000],[1773280052000,0.00000000],[1773280382000,0.00000000],[1773280783000,0.00000000],[1773280979000,0.00000000],[1773281299000,0.00000000],[1773281551000,0.00000000],[1773281875000,0.00000000],[1773282195000,0.00000000],[1773282451000,0.00000000],[1773282771000,0.00000000],[1773283091000,0.00000000],[1773283411000,0.00000000],[1773283656000,0.00000000],[1773283987000,0.00000000],[1773284307000,0.00000000],[1773284553000,0.00000000],[1773284883000,0.00000000],[1773285203000,0.00000000],[1773285451000,0.00000000],[1773285779000,0.00000000],[1773286099000,0.00000000],[1773286351000,0.00000000],[1773286675000,0.00000000],[1773286995000,0.00000000],[1773287251000,0.00000000],[1773287571000,0.00000000],[1773287891000,0.00000000],[1773288211000,0.00000000],], 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; }