Reduces the number of values in a data set using block operations or splits it into a list of segments.
Syntax
BlockCompress(DataSet, XInterval, [ Output = BC_OUTPUT_MEAN ] [ , Options = BC_OPTION_RESIDUAL ])
The syntax of the BlockCompress function consists of the following parts:
Part |
Description |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DataSet |
The data set to be compressed. Permitted data structures are Signal. All numeric data types are permitted. For the X component additional restrictions do apply.The values must be monotonously increasing. For complex data types the absolute value is formed. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||||||
XInterval |
Specifies the block size as an X interval in the unit of the X component of DataSet. Permitted data structures are Scalar value. All real data types are permitted. The value must be greater than 0. Void values are not permitted in this argument. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||||||
Output |
Specifies which results are to be output. If you select several results, the output will be a list. The argument Output can have the following values:
If this argument is omitted, it will be set to the default value BC_OUTPUT_MEAN . |
||||||||||||||||||||||
Options |
Selects options for the algorithm. The argument Options can have the following values:
If this argument is omitted, it will be set to the default value BC_OPTION_RESIDUAL . |
Remarks
Block compression reduces the data of a data set by creating one result value per block. Only data points in DataSet whose Y and X components are valid are processed. The block size is specified as an X interval in a unit compatible with the unit of the X component of DataSet compatible unit. An X value that lies exactly on a block boundary is assigned to the next block. The values in DataSet do not have to be equidistantly sampled. If a block does not contain any values, the value of the previous block is output again. The result is a signal with one value per block. The first X value in the block is transferred to the X component of the result.
Available in
FlexPro Basic, Professional, Developer Suite
Examples
BlockCompress(DataSet, 5 min) |
Returns the 5-minute average values from DataSet. |
BlockCompress(DataSet, 5 min, BC_OUTPUT_FIRSTVAL) |
Reduces the data from DataSet to one value per 5 minutes. |
Signal(ListToSeries(Quantile(BlockCompress(DataSet, 5 min, BC_OUTPUT_LIST), 0.5)), BlockCompress(DataSet, 5, BC_OUTPUT_FIRSTVAL).X) |
Reduces the data from DataSet to a median value per 5 minutes. ListToSeries(Quantile(BlockCompress(DataSet, 5 min, BC_OUTPUT_LIST), 0.5)) splits the data into a list of sections, calculates the median for each section and converts the list of individual values into a data series. BlockCompress(DataSet, 5, BC_OUTPUT_FIRSTVAL).X returns the first X values of the sections as a data series. The function Signal function is used to combine the Y and X data series into a signal. |