Loading

MACROMAPPER


mapper
Since v1.0.0
Available on all platforms
See also

MACROMAPPER converts a macro into a mapper which can be used with the MAP framework

For each tick in the mapped Geo Time Series™, the macro will be called with a list containing the following elements on the stack:

[tick_of_computation,[gts_classes],[label_maps],[ticks],[latitudes],[longitudes],[elevations],[values]]

After each call the macro is expected to leave on the stack a list with the following elements:

[tick, latitude, longitude, elevation, value]

MACROMAPPER can also create a multivariate mapper, that is, a mapper that outputs multiple results. To do this, macro calls shall leave on the stack a map:

{
'result_1': [tick, latitude, longitude, elevation, value],
'result_2': [tick, latitude, longitude, elevation, value],
...
}

When using a multivariate mapper with MAP, each input GTS produces as much output GTS in a list, whose classnames are the keys found in the map left by the macro call on the stack.

Signature

Examples

1434600618629894 3600000000 15 * - 1200000000 + 'now' STORE [ NEWGTS $now NaN NaN NaN 0 ADDVALUE $now 1 + NaN NaN NaN 1 ADDVALUE $now 2 + NaN NaN NaN 2 ADDVALUE $now 3 + NaN NaN NaN 3 ADDVALUE $now 4 + NaN NaN NaN 4 ADDVALUE $now 5 + NaN NaN NaN 5 ADDVALUE $now 6 + NaN NaN NaN 6 ADDVALUE $now 7 + NaN NaN NaN 7 ADDVALUE $now 8 + NaN NaN NaN 8 ADDVALUE $now 9 + NaN NaN NaN 9 ADDVALUE $now 10 + NaN NaN NaN 10 ADDVALUE <% 'mapping_window' STORE // Storing macro input information $mapping_window 0 GET // Extract the current tick <% 3 % 0 == %> // Condition: the current tick % 3 == 0 <% $mapping_window 0 GET // Tick $mapping_window 4 GET 0 GET // Latitude $mapping_window 5 GET 0 GET // Longitude $mapping_window 6 GET 0 GET // Elevation $mapping_window 7 GET 0 GET // Value %> // Then <% $mapping_window 0 GET NaN NaN NaN NULL %> // Else IFTE %> MACROMAPPER 0 0 0 ] MAP