Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody
I need to plot wind direction data from various weather stations against time stamps continiously. My data is currently presented in wind directions (0 - 360 degrees) but this needs to be displayed in a line chart using compass directione ie N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW,NW, NNW.
Please could somebody assist wt script or expressions to achieve this.
Note that I do not want to use a radar chart as that would not allow me to express wind direction against time.
Hi,
maybe one solution might be to hide the expression axis and add reference lines instead:
hope this helps
regards
Marco
You can use Interval match for get compass direction. But i can't figure out how you will represent in line chart Timestamp VS Compass_direction?
Ref_wind:
LOAD * INLINE [
B1, B2, Direction
0, 90, North-East
91, 180,South-East
181,270,South-West
271,360,North-West
];
Wind:
LOAD * INLINE [
Timestamp, Wind_deg, Speed
26/10/2017 08:01:55, 356, 56
26/10/2017 09:01:55, 356, 59
26/10/2017 10:01:55, 345, 67
26/10/2017 11:01:55, 358, 63
26/10/2017 12:01:55, 234, 83
26/10/2017 13:01:55, 278, 91
26/10/2017 14:01:55, 234, 45
26/10/2017 15:01:55, 237, 57
26/10/2017 16:01:55, 167, 23
26/10/2017 17:01:55, 134, 26
26/10/2017 18:01:55, 73, 34
];
IntervalMatch (Wind_deg) LOAD B1, B2 Resident Ref_wind;
Hi,
There may be a better way using Pick(Match()) functions but I couldnt figure out how to get range of values in the Match criteria so I have made it in an if statement.
You will need to add some lines and change the criteria but that the gist of it. I have attached a QVW where it is applied
Code used:
if(Degree>=0 and Degree<=30 ,'N',
if(Degree>=31 and Degree<=60,'NE',
if(Degree>=61 and Degree<=120,'E',
if(Degree>=121 and Degree<=150,'SE',
if(Degree>=151 and Degree<=210,'S',
if(Degree>=211 and Degree<=240,'SW',
if(Degree>=241 and Degree<=300,'W',
if(Degree>=301 and Degree<=330,'NW','N'))))))))
Hope it helps
So I'm not 100% sure on the output you are trying to get could you draw a mock up of what it should look like once done.
You should be able to convert your degree's (0°) into N NE E... etc by doing the following resident load in your script:
Load *,
if(Degree>=0 and Degree<=30 ,'N',if(Degree>=31 and Degree<=60,'NE',if(Degree>=61 and Degree<=120,'E',if(Degree>=121 and Degree<=150,'SE',if(Degree>=151 and Degree<=210,'S',if(Degree>=211 and Degree<=240,'SW',if(Degree>=241 and Degree<=300,'W',if(Degree>=301 and Degree<=330,'NW','N')))))))) as Compas;
Load * Inline
[
County,Degree,WindSpeed,
Suffolk,248,40
Norfolk,123,10
Essex,42,10
Devon,350,40
Cornwall,230,60
];
??
Thank you for the responses received
Below is part of a dataset from one of the monitors that I need to plot
On my graph I require time on the one axis and the compass direction on the other axis. As said above, instead of showing the degrees we require the compass directions.
The graph below does not relate to this specific dataset but gives an ide of what the graph looks like. Instead of showing degreed on the X axis this needs to be replaced with compass directions starting from N at the top and ending with NNW closest to the 0 point
WindDirection704P | Date704P | Time704P |
277.000 | 2017-03-16 | 04:04:00 AM |
297.000 | 2017-03-16 | 04:14:00 AM |
294.000 | 2017-03-16 | 04:24:00 AM |
303.000 | 2017-03-16 | 04:34:00 AM |
274.000 | 2017-03-16 | 04:44:00 AM |
260.000 | 2017-03-16 | 04:54:00 AM |
285.000 | 2017-03-16 | 05:04:00 AM |
240.000 | 2017-03-16 | 05:14:00 AM |
297.000 | 2017-03-16 | 05:24:00 AM |
294.000 | 2017-03-16 | 05:34:00 AM |
311.000 | 2017-03-16 | 05:44:00 AM |
286.000 | 2017-03-16 | 05:54:00 AM |
275.000 | 2017-03-16 | 06:04:00 AM |
268.000 | 2017-03-16 | 06:14:00 AM |
295.000 | 2017-03-16 | 06:24:00 AM |
271.000 | 2017-03-16 | 06:34:00 AM |
262.000 | 2017-03-16 | 06:44:00 AM |
242.000 | 2017-03-16 | 06:54:00 AM |
315.000 | 2017-03-16 | 07:04:00 AM |
301.000 | 2017-03-16 | 07:14:00 AM |
281.000 | 2017-03-16 | 07:24:00 AM |
211.000 | 2017-03-16 | 07:34:00 AM |
165.000 | 2017-03-16 | 07:44:00 AM |
238.000 | 2017-03-16 | 07:54:00 AM |
282.000 | 2017-03-16 | 08:04:00 AM |
235.000 | 2017-03-16 | 08:14:00 AM |
185.000 | 2017-03-16 | 08:24:00 AM |
238.000 | 2017-03-16 | 08:34:00 AM |
173.000 | 2017-03-16 | 08:44:00 AM |
179.000 | 2017-03-16 | 08:54:00 AM |
172.000 | 2017-03-16 | 09:04:00 AM |
153.000 | 2017-03-16 | 09:14:00 AM |
153.000 | 2017-03-16 | 09:24:00 AM |
151.000 | 2017-03-16 | 09:34:00 AM |
HI Aaron
Thank you but I probably explained poorly. My graph requires compass direction on the X axis, Time on the Y axis and will show emissions recorded by a number of monitors in a line graph. See my dataset and a snip of a current graph of which the degrees need to be relaced by wind compass direction
Thank you for your reply. Please refer to my further response to Aaron below
Best regards
Neil
Hi Neil.,
try:
=Pick(Ceil((WindBearing+11.25 - Floor((WindBearing+11.25)/360)*360)/22.5),'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW','NW', 'NNW')
Regards
Andrew
Using your data we get:
WindDirection704P | Compass Bearing |
---|---|
151.000 | SSE |
153.000 | SSE |
165.000 | SSE |
172.000 | S |
173.000 | S |
179.000 | S |
185.000 | S |
211.000 | SSW |
235.000 | SW |
238.000 | WSW |
240.000 | WSW |
242.000 | WSW |
260.000 | W |
262.000 | W |
268.000 | W |
271.000 | W |
274.000 | W |
275.000 | W |
277.000 | W |
281.000 | W |
282.000 | WNW |
285.000 | WNW |
286.000 | WNW |
294.000 | WNW |
295.000 | WNW |
297.000 | WNW |
301.000 | WNW |
303.000 | WNW |
311.000 | NW |
315.000 | NW |
Thanks Andrew
I can get to this point in various ways but my challenge is getting this into a graph as described earlier
Hi Aaron
I still have not been able to solve this challenge.
I notcice that I had my X and my Y mixed up earlier.
I require the ime on the X axis (Dimension) and the compass directions on the Y axis (expression)
I am graphing the wind direction over time