How to combine results of multiple Overlays as timeframes in a Combo Overlay

From Tygron Support wiki
Jump to navigation Jump to search

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

Editor → Current Situation (Ribbon tab) → Overlays (Ribbon bar)
How to combine results of multiple Overlays as timeframes in a Combo Overlay:
  1. Have Grid Overlays present in the Project, the results of which should be combined in a Combo Overlay.
  2. 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".
  3. Set the name of the Global to something recognizable, such as "TIMEFRAMES_FOR_OVERLAY".
  4. 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.
  5. 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 )
    )
  6. Recalculate the Project.
  7. The Combo Overlay now has, on each of its timeframes, the results of specific other Grid Overlays.

Notes

See also