Value Index Operator (FPScript)

10.10.2019
Analyzing Data Mathematically > Reference > FPScript Operators > Data Access > Value Index

Value Index Operator (FPScript)

Extracts an individual value or a segment from a signal or a signal series. The indexing does not happen via indices, but instead via X or Z values.

Syntax

TermValueIndex1[ValueIndex2]

where ValueIndex1 stands for the following variants:

[[ ]]

or

[[Index]]

or

[[from, to]]

under the optional ValueIndex2 stands for the following structure:

[[Index]]

or

[[from, to]]

The syntax of the value index operator consists of the following elements:

Element

Description

Term

An expression, which describes a variable, formula or data set, calls a function or selects an element from a list, or any expression in brackets. Signal and signal series data structures are allowed. The signal series must contain a one-dimensional X component.

Index

Specifies the X or Z values of the value(s) or signals to be indexed. Can be a numeric scalar value or a data series with numerical values or of the Empty data type.

from

Specifies the X or Z value of the first value or signal of a range to be indexed. Must be a numeric scalar value or of the Empty data type.

to

Specifies the X or Z value of the last value or signal of a range to be indexed. Must be a numeric scalar value or of the Empty data type.

Remarks

The value index operator can extract single values or sections from signals and signal series. Signal series with a two-dimensional X component are not supported.

If Term is a list, then the index operation is carried out by element and the result is also a list.

For the signal series, two indices can be specified one after the other. The first index then refers to the signals in a signal series and the optional second index refers to the values in the signals extracted with the first index. If you leave the first index blank or specify Index as a value of the Empty data type, this indexes all signals. Indexing is only possible in the Z component of a signal series with a two-dimensional X component.When accessing two-dimensional data sets, you can combine the value index operator and the index operator any way you'd like.

As the syntax shows, there are three ways that you can specify the value Index: If you specify a scalar value (scalar value index) in the value index, the index extracts one element, and the rank of the result decreases by one. If you specify as Index a data series (data series index) or a range from, to (range Index), the values listed in the data series or the values in the range will be extracted. Void floating point values are not allowed as indices. If you use from or to as a value with the Empty data type, this corresponds to the first or last element in the data set dimension to be indexed.

If Index, from or to is a quantity, then it has to have the same SI dimension as the corresponding component of Term and is transformed to its unit before indexing. If only numeric values are specified without a unit, then they are interpreted as being present in the relevant unit.

If the X or Z values specified do not occur exactly in the signal or signal series, the positions of those values will be used, which are closest to the values specified. To determine the indices corresponding to the X or Z values specified, the value index operator uses the SearchValue function.

The following table lists all of the possible combinations:

Signal[[ScalarValue]]

Takes the Y value with the X value specified in ScalarValue from the signal. The result is a scalar value.

Signal[[from, to]]

Takes the points lying in the X range from, to from the signal. The result is a signal.

Signal[[Series]]

Takes the points with the X values specified in Series from the signal. The result is a signal.

SignalSeries[[ScalarValue]]

Takes the signal with the Z value specified in ScalarValue from the signal series. The result is a signal.

SignalSeries[[from, to]]

Takes the signals lying in the Z range from, to from the signal series. The result is a signal series.

SignalSeries[[Series]]

Takes the signals with the Z values specified in Series from the signal series. The result is a signal series.

SignalSeries[[ ]][[ScalarValue]]

Takes all Y values with the X value ScalarValue from the signal series. The result is a data series.

SignalSeries[[ ]][[from, to]]

Takes the values lying in the X range from, to from the signal series. The result is a signal series.

SignalSeries[[ ]][[Series]]

Takes the values with the X values specified in Series from the signal series. The result is a signal series.

SignalSeries[[ScalarValue1]][[ScalarValue2]]

Takes the Y value with the X value specified in ScalarValue2 from the signal with the Z value specified in ScalarValue1 from the signal series. The result is a scalar value.

SignalSeries[[ScalarValue]][[from, to]]

Takes the values lying in the X range from, to from the signal with the Z value in ScalarValue from the signal series. The result is a signal.

SignalSeries[[ScalarValue]][[Series]]

Takes the points with the X values specified in Series from the signal with the Z value specified in ScalarValue from the signal series. The result is a signal.

SignalSeries[[from, to]][[ScalarValue]]

Takes the Y values with the X value ScalarValue from the signals lying in the Z range from, to from the signal series. The result is a data series.

SignalSeries[[from1, to1]][[from2, to2]]

Takes the points lying in the X range from2, to2 from the signals lying in the Z range from1, to1 from the signal series. The result is a signal series.

SignalSeries[[from, to]][[Series]]

Takes the points with the X values specified in Series from the signals lying in the Z range from, to from the signal series. The result is a signal series.

SignalSeries[[Series]][[ScalarValue]]

Takes the Y values with the X value ScalarValue from the signals with the Z values listed in Series from the signal series. The result is a data series.

SignalSeries[[Series]][[from, to]]

Takes the points lying in the X range from, to from the signals with the Z values listed in Series from the signal series. The result is a signal series.

SignalSeries[[Series1]][[Series2]]

Takes the points with the X values specified in Series2 from the signals with the Z values listed in Series1 from the signal series. The result is a signal series.

SpaceCurve[[ScalarValue]]

Takes the Y value with the X value specified in ScalarValue from the space curve. The result is a scalar value.

SpaceCurve[[from, to]]

Takes the points lying in the X range from, to from the space curve. The result is a space curve.

SpaceCurve[[Series]]

Takes the points with the X values specified in Series from the space curve. The result is a space curve.

Available in

FlexPro View, Standard, Professional, Developer Suite

Examples

Signal[[1.5 s, 3.7]]

Extracts the segment from x = 1.5 s to x = 3.7 s from a signal.

Signal[[1.5, Empty]]

Extracts the segment from x = 1.5 to the end from a signal.

Signal[[Empty, 3.7]]

Extracts the segment from the beginning to x = 3.7 from a signal.

Signal Series[[1.5, 3.7]]

Extracts the signals from z = 1.5 to z = 3.7 from a signal series.

Signal Series[[1.5 kHz, 3,700 Hz]]

Extracts the signals from z = 1.5 kHz to z = 3.7 kHz from a signal series.

Signal Series[[ ]][[1.5, 3.7]]

Takes the segment of x = 1.5 ms to x = 3.7 ms from all signals in a signal series, assuming that the X component of the signal series has the unit ms.

 

See Also

Index Operator

Indexed Assignment

SearchValue Function

Partager l’article ou envoyer par mail :

Vous serez probablement intéressé par les articles suivants :