LTTB
gts
The LTTB
function downsamples a Geo Time Series™ or list thereof using the LTTB (Largest Triangle Three Buckets) algorithm. This algorithm downsamples a GTS by selecting datapoints from the original GTS which will preserve the overall shape of the graphical representation of the data.
LTTB is available since version 1.0.11.
See also
Signatures
Examples
NEWGTS
1 1000
<%
'i' STORE
$i NaN NaN NaN $i 250. / PI * COS ADDVALUE
%> FOR
DUP
// Keep 50 datapoints
50 LTTB
Examples
gts = NEWGTS()
FOR(1, 1000, (i) -> {
ADDVALUE(gts, i, NaN, NaN, NaN, COS(i / 250.0 * PI()))
}
)
// Keep 50 datapoints
newGts = LTTB(gts, 50)
return gts, newGts