Loading

REDUCE

reducer framework

The REDUCE framework groups Geo Time Series™ by equivalence classes based on label values and applies a function on each equivalence class of Geo Time Series™, considering the values of each tick and producing one GTS per equivalence class.

As the selected reducer function is applied tick by tick, it is usually wise to BUCKETIZE the GTS first with a common value of lastbucket.

The labels whose values are common to all the GTS in an equivalence class will be retained.

If all the inputs are bucketized with the same bucket span and bucket end, the output of reduce will be bucketized too. Use UNBUCKETIZE if needed after REDUCE.

Since 2.1 you can make REDUCE override the GTSs ticks. This usage in mainly to be used in conjuction with MACROREDUCER.

REDUCE is available since version 1.0.0.

See also

Signatures

Examples

NEWGTS 'a' RENAME { 'type' '1' } RELABEL 1 10 <% NaN NaN NaN 1 ADDVALUE %> FOR NEWGTS 'b' RENAME { 'type' '1' } RELABEL 1 10 <% NaN NaN NaN 1 ADDVALUE %> FOR NEWGTS 'a' RENAME { 'type' '2' } RELABEL 1 10 <% NaN NaN NaN 2 ADDVALUE %> FOR NEWGTS 'b' RENAME { 'type' '2' } RELABEL 1 10 <% NaN NaN NaN 2 ADDVALUE %> FOR 4 ->LIST [ SWAP [ 'type' ] reducer.product ] REDUCE
[ NEWGTS 1 10 <% NaN NaN NaN 1 ADDVALUE %> FOR NEWGTS 1 5 <% 2 * NaN NaN NaN 2 ADDVALUE %> FOR ] [ SWAP [] <% 'rw' STORE $rw 0 GET 5 * // Tick * 5 NaN NaN NaN // Loc & Elev 0 $rw 7 GET <% DUP ISNULL <% DROP %> <% + %> IFTE %> FOREACH // Value %> MACROREDUCER T ] REDUCE