WIP: Feature/ec 111 seasonal forecast
Seasonal Forecasts (Dominant quintile maps and graphs)
The following merge request consolidates all of our work done on the creation of quintile maps, rendering of the maps (dominant quintiles) and seasonal forecast graphs.
The data
As with the climate change maps, we are storing and transporting the vast majority of data using png files. Given that a png has 4 8-bit channels, we can store the values for the Q1-Q4 quintiles in these channels. The fifth quintile can be calculated by subtracting 100 from the sum of all the Q1..Q4. Each channel can be populated with values from 0-100 and 255 (to represent no data). Each image (5 quintiles for 6 grids) will be approx 1.6mb.
Unfortunately, the original approach of drawing an image to an html5 canvas and then reading pixel data out no longer works with the inclusion of alpha channel data (this is due to alpha premultiplication). We originally tried using WebGL textures, however the maximum size allowed for textures in Firefox is below what we need. The current approach is to load the image (using ajax) and then decompress the png data into a binary array using client side tools. Performance seems pretty good, and has defined the way in which we can move away from PNGs and potentially load any data format in the browser (e.g. NetCDF).
Dominant quintile maps
We have used the same colour scheme which was defined in @mfry's document. The time slider will move through the 6 months from the selected timestep. Each quintile cell has a level of transparency applied, where 20% certainty represents transparent and 100% is fully opaque.
The legend slider allows customisation of the display by altering the transparency based upon the certainty of a dominant cell. The range is fixed to 20 - 100%.
Seasonal forecast graphs
Given the approach for data storage, there is no call to the server when loading a quintile graph for a selected square.