Difference between revisions of "Lw-preparation"
(Created page with "<!--title--> <div style=background:#1976D2> <table border=0><tr> <td>250px</td> <td width=50%><font size=5 color="#FFFFFF">VAST Challenge 2017 - Mini Chal...") |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<!--title--> | <!--title--> | ||
− | <div style=background:#1976D2> | + | <div style='background:#1976D2'> |
− | <table border=0><tr> | + | <table border=0 width=100%><tr> |
− | <td>[[File:Lw-VAST.jpg|250px]]</td> | + | <td width=40%>[[File:Lw-VAST.jpg|250px]]</td> |
− | <td | + | <td><font size=5 color="#FFFFFF">VAST Challenge 2017 - Mini Challenge 2</font></td> |
</tr></table> | </tr></table> | ||
</div> | </div> | ||
Line 10: | Line 10: | ||
<!--header panel--> | <!--header panel--> | ||
− | {|style='background:# | + | {|style='background:#FFFFFF; cellspacing=0; cellpadding=0; valign=center; border=0' width=100%| |
|style='background:#1976D2; text-align:center' width=25%| | |style='background:#1976D2; text-align:center' width=25%| | ||
[[ISSS608_2016-17_T3_Assign_HUANG_LIWEI|<font color="#FFFFFF">Introduction</font>]] | [[ISSS608_2016-17_T3_Assign_HUANG_LIWEI|<font color="#FFFFFF">Introduction</font>]] | ||
Line 22: | Line 22: | ||
<br> | <br> | ||
− | == | + | == Data Preparations == |
− | < | + | === Modifications on Source Table === |
− | + | * Create an excel file for recording coordinates of monitors/factories.<br> | |
− | + | Set an additional row for max values of x and y as 200.<br> | |
− | + | [[File:Lw-Coordinates.png]] | |
− | + | * Modify "Meteorological Data.xlsx", create two new columns for order index, 'index' is for overall order, 'time order' is for representing the order of each month.<br> | |
− | </ | + | [[File:Lw-Index.png]] |
− | < | + | * Create another sheet in "Meteorological Data.xlsx", calculate the x-y coordinates based on wind directions & speed. |
− | < | + | The formular of x coordinates is:<br> |
− | == | + | '''''WindSpeed'''*SIN(RADIANS('''WindDirection'''))*(-1)+''''TimeOrder'''''<br> |
− | The | + | The formular of y coordinates is:<br> |
− | + | '''''WindSpeed'''*COS(RADIANS('''WindDirection'''))*(-1)''<br> | |
− | + | Append a set of same-length values representing the original points of x-y coordinates. x is as same as the 'time order', y is 0.<br> | |
− | === | + | Add a new column as index for matching with the index in the former sheet.<br> |
− | + | <br> | |
− | <br><br> | + | === Data Import === |
− | < | + | * Table join. |
− | < | + | Open tableau. Import file Sensor Data, Coordinates and Meteorological Data.<br> |
− | < | + | Full outer join the tables based on monitor no. (Sensor Data & Coordinates) and date time (Sensor Data & Meteorological Data) respectively.<br> |
− | + | [[File:Lw-Join.png]] | |
− | + | * New Datasource. | |
− | < | + | Add new datasource, join two sheets within Meteorological Data (wind & direction) together, inner join with index.<br> |
− | < | + | [[File:Lw-Join2.png]] |
− | < | + | <br> |
− | + | === Trellis Graph (Lines) === | |
− | + | * Create new calculated fields as row & column divider.<br> | |
− | + | The formular of row divider:<br> | |
− | + | ''int((index()-1)/(round(sqrt(size()))))''<br> | |
+ | The formular of column divider:<br> | ||
+ | ''(index()-1)%(round(sqrt(size())))''<br> | ||
+ | * Set filters. | ||
+ | Set month, chemical, monitor as filters with single value.<br> | ||
+ | [[File:Lw-Filters.png]] | ||
+ | * Plot graph. | ||
+ | Set hour (discrete) as columns, readings as rows with unaggreagated measures.<br> | ||
+ | Put column divider and row divider into columns and rows respectively, both computing using day of the month.<br> | ||
+ | Put day of the month as detail. Set marks as line.<br> | ||
+ | Supply the information tooltips with related attributes.<br> | ||
+ | [[File:Lw-Trellies-made.png]] | ||
+ | <br> | ||
+ | === Trellis Graph (Counts) === | ||
+ | * Create new calucated field as count deviation.<br> | ||
+ | The formula is:<br> | ||
+ | ''sum([Number of Records])-max([Day of Month])''<br> | ||
+ | * Set month, chemical as filters. | ||
+ | Only keep chemical AGOC-3A and Methylosmolene since we only want to compare the record counts of this pair.<br> | ||
+ | * Plot graph. | ||
+ | Set hour (discrete) as columns, set chemicals and count deviation as rows with aggreagated measures.<br> | ||
+ | Put column divider and row divider into columns and rows respectively, both computing using monitor.<br> | ||
+ | Put monitor as detail. Set marks as bar.<br> | ||
+ | Add labels for showing the monitor names in each cell.<br> | ||
+ | Supply the information tooltips with related attributes.<br> | ||
+ | [[File:Lw-Trellies-made2.png]] | ||
+ | <br> | ||
+ | === Calendar Graph (Days) === | ||
+ | * Set filters. | ||
+ | Set chemical as filters with single value.<br> | ||
+ | * Set columns and rows. | ||
+ | Put weekday into columns, put month, week into rows.<br> | ||
+ | * Set Other attributes. | ||
+ | Set average reading as color, the darker the higher.<br> | ||
+ | Set day of the month as labels so that each cell is labelled with day number accordingly.<br> | ||
+ | [[File:Lw-Calendar-made.png]] | ||
+ | <br> | ||
+ | === Line Chart === | ||
+ | * Set filters. | ||
+ | Set month, day as filters. Month is single value and day can be multiple values.<br> | ||
+ | * Plot graph. | ||
+ | Set day and hour as columns, monitor and reading as rows with unaggregated measures.<br> | ||
+ | Set chemical as color.<br> | ||
+ | [[File:Lw-Line-made.png]] | ||
+ | <br> | ||
+ | === Map === | ||
+ | * Set max(x) and max(y) as columns and rows respectively. | ||
+ | So that the graph is 200*200 units.<br> | ||
+ | * Set marks. | ||
+ | Set monitor/factory no. as details and labels. Set type as color.<br> | ||
+ | * Embed map picture. | ||
+ | Embed map picture as background, lock the field as 0-200 for both x and y.<br> | ||
+ | [[File:Lw-Map-made.png]] | ||
+ | We will have the final graph:<br> | ||
+ | [[File:Lw-Map-made2.png]] | ||
+ | <br> | ||
+ | === Horizontal Graph === | ||
+ | * Create paramter. | ||
+ | Create band size as paramter do that we can tune the band size to shifting granularity.<br> | ||
+ | [[File:Lw-Horizontal-made.png]] | ||
+ | * Create measurement. | ||
+ | Create calculated field as different of speed, calculating the percentage different of wind speed based on median speed for each record.<br> | ||
+ | The formular is:<br> | ||
+ | (avg([Wind Speed (m/s)])/[Speed (window median)])-1 | ||
+ | * Create horizontal bands. | ||
+ | Create calculated fields as differenct bands of speed differences.<br> | ||
+ | The formular for band is like (take example of +1 band):<br> | ||
+ | ''if (([Speed (% of diff)]>=0) and ([Speed (% of diff)]<=[Horizon - band size]))''<br> | ||
+ | ''then ([Speed (% of diff)]/[Horizon - band size])''<br> | ||
+ | ''elseif ([Speed (% of diff)]>[Horizon - band size])''<br> | ||
+ | ''then 1 else 0 end''<br> | ||
+ | The formular of the following band is like (+2 band):<br> | ||
+ | ''if (([Speed (% of diff)]>=[Horizon - band size]) and ([Speed (% of diff)]<=2*[Horizon - band size]))''<br> | ||
+ | ''then (([Speed (% of diff)]-[Horizon - band size])/[Horizon - band size])''<br> | ||
+ | ''elseif ([Speed (% of diff)]>2*[Horizon - band size])''<br> | ||
+ | ''then 1 else 0 end''<br> | ||
+ | So on and so forth.<br> | ||
+ | * Plot graph. | ||
+ | Set month as filter with single value.<br> | ||
+ | Set hour of day as columns, day of month as rows. Put measure values into rows, only retain those horizontal bands.<br> | ||
+ | Set differenct of speed as detail, set marks as area, set measure names as color with gradiant colors from the lowest band (negative) to the highest band (positive).<br> | ||
+ | [[File:Lw-Horizontal-made2.png|800px]] | ||
<br> | <br> | ||
− | === | + | === Wind Stick Graph === |
− | '' | + | * Use the calculated sheet on 'Meteorological Data.xlsx'. |
− | + | * Set filters. | |
− | + | Set month, day as filters.<br> | |
− | + | * Plot graph. | |
− | + | Set x, y as columns and rows respectively. Set day of the month as columns in front of x.<br> | |
− | + | Set index as detail, set hour of the day as color, set mark as line.<br> | |
− | + | Supply the information tooltips with related attributes.<br> | |
− | < | + | [[File:Lw-Wind Stick-made.png]] |
− | |||
− | |||
− | |||
− | |||
− | |||
<br> | <br> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<br> | <br> | ||
− | + | '''Data preparations are all done.''' | |
− | |||
− | ''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ''' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 01:22, 17 July 2017
Presented by: HUANG Liwei (liwei.huang.2016@mitb.smu.edu.sg)
Visualization tool: Tableau
Contents
Data Preparations
Modifications on Source Table
- Create an excel file for recording coordinates of monitors/factories.
Set an additional row for max values of x and y as 200.
- Modify "Meteorological Data.xlsx", create two new columns for order index, 'index' is for overall order, 'time order' is for representing the order of each month.
- Create another sheet in "Meteorological Data.xlsx", calculate the x-y coordinates based on wind directions & speed.
The formular of x coordinates is:
WindSpeed*SIN(RADIANS(WindDirection))*(-1)+'TimeOrder
The formular of y coordinates is:
WindSpeed*COS(RADIANS(WindDirection))*(-1)
Append a set of same-length values representing the original points of x-y coordinates. x is as same as the 'time order', y is 0.
Add a new column as index for matching with the index in the former sheet.
Data Import
- Table join.
Open tableau. Import file Sensor Data, Coordinates and Meteorological Data.
Full outer join the tables based on monitor no. (Sensor Data & Coordinates) and date time (Sensor Data & Meteorological Data) respectively.
- New Datasource.
Add new datasource, join two sheets within Meteorological Data (wind & direction) together, inner join with index.
Trellis Graph (Lines)
- Create new calculated fields as row & column divider.
The formular of row divider:
int((index()-1)/(round(sqrt(size()))))
The formular of column divider:
(index()-1)%(round(sqrt(size())))
- Set filters.
Set month, chemical, monitor as filters with single value.
- Plot graph.
Set hour (discrete) as columns, readings as rows with unaggreagated measures.
Put column divider and row divider into columns and rows respectively, both computing using day of the month.
Put day of the month as detail. Set marks as line.
Supply the information tooltips with related attributes.
Trellis Graph (Counts)
- Create new calucated field as count deviation.
The formula is:
sum([Number of Records])-max([Day of Month])
- Set month, chemical as filters.
Only keep chemical AGOC-3A and Methylosmolene since we only want to compare the record counts of this pair.
- Plot graph.
Set hour (discrete) as columns, set chemicals and count deviation as rows with aggreagated measures.
Put column divider and row divider into columns and rows respectively, both computing using monitor.
Put monitor as detail. Set marks as bar.
Add labels for showing the monitor names in each cell.
Supply the information tooltips with related attributes.
Calendar Graph (Days)
- Set filters.
Set chemical as filters with single value.
- Set columns and rows.
Put weekday into columns, put month, week into rows.
- Set Other attributes.
Set average reading as color, the darker the higher.
Set day of the month as labels so that each cell is labelled with day number accordingly.
Line Chart
- Set filters.
Set month, day as filters. Month is single value and day can be multiple values.
- Plot graph.
Set day and hour as columns, monitor and reading as rows with unaggregated measures.
Set chemical as color.
Map
- Set max(x) and max(y) as columns and rows respectively.
So that the graph is 200*200 units.
- Set marks.
Set monitor/factory no. as details and labels. Set type as color.
- Embed map picture.
Embed map picture as background, lock the field as 0-200 for both x and y.
We will have the final graph:
Horizontal Graph
- Create paramter.
Create band size as paramter do that we can tune the band size to shifting granularity.
- Create measurement.
Create calculated field as different of speed, calculating the percentage different of wind speed based on median speed for each record.
The formular is:
(avg([Wind Speed (m/s)])/[Speed (window median)])-1
- Create horizontal bands.
Create calculated fields as differenct bands of speed differences.
The formular for band is like (take example of +1 band):
if (([Speed (% of diff)]>=0) and ([Speed (% of diff)]<=[Horizon - band size]))
then ([Speed (% of diff)]/[Horizon - band size])
elseif ([Speed (% of diff)]>[Horizon - band size])
then 1 else 0 end
The formular of the following band is like (+2 band):
if (([Speed (% of diff)]>=[Horizon - band size]) and ([Speed (% of diff)]<=2*[Horizon - band size]))
then (([Speed (% of diff)]-[Horizon - band size])/[Horizon - band size])
elseif ([Speed (% of diff)]>2*[Horizon - band size])
then 1 else 0 end
So on and so forth.
- Plot graph.
Set month as filter with single value.
Set hour of day as columns, day of month as rows. Put measure values into rows, only retain those horizontal bands.
Set differenct of speed as detail, set marks as area, set measure names as color with gradiant colors from the lowest band (negative) to the highest band (positive).
Wind Stick Graph
- Use the calculated sheet on 'Meteorological Data.xlsx'.
- Set filters.
Set month, day as filters.
- Plot graph.
Set x, y as columns and rows respectively. Set day of the month as columns in front of x.
Set index as detail, set hour of the day as color, set mark as line.
Supply the information tooltips with related attributes.
Data preparations are all done.