MACROREDUCER
reducerMACROREDUCER
converts a macro into a reducer which can be used with the REDUCE
framework
For each tick in the Geo Time Series™ to reduce, 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]]
Each list have a length of the number of GTSs in the partition. Each missing value are replaced by null
, each missing tick by the minimum value of long and each missing latitude, longitude or elevation by NaN. The label_maps
list as one more element at the end compared to the other lists: the common labels for the GTSs of the partition.
After each call the macro is expected to leave on the stack a list with the following elements:
[tick, latitude, longitude, elevation, value]
MACROREDUCER
can also create a multivariate reducer, that is, a reducer 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 reducer with REDUCE, each input List of 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.