How to combine results of multiple Overlays as timeframes in a Combo Overlay
The timeframes functionality of Grid Overlays is a user-friendly way to show multiple results in succession, and most commonly used to show multiple results which follow one another across time. This functionality is built-in for time-based calculation models such as the Heat Stress Overlay or the Water Overlay, but in these cases the results per timeframe are all the result of the same calculation. Leveraging this functionality to combine the results of multiple different Grid Overlays takes a bit more setup, but is doable through a specific approach.
Formula
The formula used in the Combo Overlay will consist of individual checks of which Grid Overlay's results to add to which timeframe. The formula for an individual check will be structured as follows:
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,0), A )
In which "0" is the intended timeframe, A is the intended Grid Overlay, and TIMEFRAMES_FOR_OVERLAY is a Global which lists timeframes.
Multiple of these entries can be combined. For example, to combine the results of 3 Grid Overlays together, the formulas for individual checks can simply be added together:
ADD( MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,0), A ), MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,1), B ), MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,2), C ) )
In which each individual check will either output the Grid Overlay, if it's the correct timeframe for the Grid Overlay, or 0. This will result in the timeframes computing as:
- Timeframe 0: A + 0 + 0
- Timeframe 1: 0 + B + 0
- Timeframe 2: 0 + 0 + C
Steps
- Have Grid Overlays present in the Project, the results of which should be combined in a Combo Overlay.
- Add a Global to the Project, with a global array value of "0 1 2 3" etc. The amount of numbers should match the amount of intended timeframes.
(e.g. if there are 3 intended timeframes, set the value of the Global to "0 1 2". - Set the name of the Global to something recognizable, such as "TIMEFRAMES_FOR_OVERLAY".
- Add a Combo Overlay. Set the Grid Overlay intended for timeframe 0 to input A, the Grid Overlay intended for timeframe 1 to input B, etc.
- For the formula for the Combo Overlay, add the formula listed above with as many individual checks as intended timeframes and Grid Overlays. E.g. for 3 timeframes, the formula should be:
ADD(
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,0), A ),
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,1), B ),
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,2), C )
)
For 4 timeframes, the formula should be:
ADD(
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,0), A ),
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,1), B ),
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,2), C ),
MUL( EQ(GLOBAL_TIMEFRAMES_FOR_OVERLAY,3), D )
) - Recalculate the Project.
- The Combo Overlay now has, on each of its timeframes, the results of specific other Grid Overlays.
Notes
- Since all results are displayed with the same legend of the Combo Overlay, using this method to combine results into one Combo Overlay across multiple timeframes is primarily only useful when the data of the individual Grid Overlays is of the same type, and in the same order of magnitude.
- A maximum of 10 Grid Overlays can be combined in this way.
- More Grid Overlays can be combined in "batches" of 9 at a time, by creating a Combo Overlay which combines 9 results, storing each on a separate timeframe, then adding that Combo Overlay as input for another Combo Overlay and reading out the first Combo Overlay multiple times, each time a different timeframe. This way the 9 Grid Overlays providing input for the first Combo Overlay only take up one Input Overlay slot in the second Combo Overlay, freeing up room for 9 more.
- If the Global has more values than Grid Overlays, more timeframes will be created than strictly necessary. If it has fewer values, the Combo Overlay will have insufficient timeframes.