Loading

ATINDEX

gts

The ATINDEX function consumes a Geo Time Series™ or a list thereof from the stack, looks at its index-th point and put on the stack a list with the timestamp, longitude, latitude, elevation and value for the index-th point of the GTS.

Since 2.1, the index can be negative. In this case, the effective index is index + size of the GTS.

ATINDEX is available since version 1.0.0.

See also

Signatures

Examples

// Create a new GTS with ten values NEWGTS 100 NaN NaN NaN 10 ADDVALUE 200 NaN NaN NaN 9 ADDVALUE 300 NaN NaN NaN 8 ADDVALUE 400 NaN NaN NaN 7 ADDVALUE 500 NaN NaN NaN 6 ADDVALUE 700 NaN NaN NaN 5 ADDVALUE 800 NaN NaN NaN 4 ADDVALUE 900 NaN NaN NaN 3 ADDVALUE 1000 NaN NaN NaN 2 ADDVALUE 1100 NaN NaN NaN 1 ADDVALUE 'gts' STORE $gts 4 ATINDEX // Get data of the 5th point starting at the beginning $gts -2 ATINDEX // Get data of the second point starting at the end

Examples

// Create a new GTS with ten values A = NEWGTS() ADDVALUE(A, 100, NaN, NaN, NaN, 10) ADDVALUE(A, 200, NaN, NaN, NaN, 9) ADDVALUE(A, 300, NaN, NaN, NaN, 8) ADDVALUE(A, 400, NaN, NaN, NaN, 7) ADDVALUE(A, 500, NaN, NaN, NaN, 6) ADDVALUE(A, 700, NaN, NaN, NaN, 5) ADDVALUE(A, 800, NaN, NaN, NaN, 4) ADDVALUE(A, 900, NaN, NaN, NaN, 3) ADDVALUE(A, 1000, NaN, NaN, NaN, 2) ADDVALUE(A, 1100, NaN, NaN, NaN, 1) return [ ATINDEX(A, 4), // Get data of the 5th point starting at the beginning ATINDEX(A, -2) // Get data of the second point starting at the end ]