Honey | Function reference
Operator index
Operator | Definition |
---|---|
@data |
Define the input and output file(s) and/or director(y/ies) on which to apply the program. This command can
be used as a replacement of the --input command line option. If several @data statement are given, they will be treated one after another independently. If several input files are given for a same @data statement (separated by ;) the input datasets will be merged and processed together. If several input directory are given for a same @data statement (separated by ;), the files in each direcotry will be grouped by file name (without the extension). Each group of file will be processed independently. The files inside of a group will be merged together. |
@mode | Define the execution mode (Default:static). Available modes are "online", "static" and "streaming". This parameter can also be overide by the --mode command call option. Static mode loads the entire dataset in memory and process it. Static mode does not support recursive variables. Streaming load and process a dataset records by records. Streaming mode only support sorted .evt or .csv files. Online mode runs in real time on records received by online operators (e.g. tcpconnectino, calendar, tick). |
@verbose | This parameter defines how much information about the script execution is displayed on the console. Can be one of the follow: NONE, SMALL, NORMAL, FULL, TRACE. The default value is NORMAL. The NONE value ensures that nothing is printing on the console (standart output) except for the command "cout" that outputs signal on the console. This option is similar to the command call option --verbose. |
active | Compute the presence or the absence of records in the tailing moving window. If a signal is present, the operator returns 1, otherwise the operator returns 0. |
beep | Emit a beep (computer noise) every time an event is received. |
calendar | Interpret the numerical time representation to be Unix time (i.e. number of second since the 1 Jan. 1970), and generate specific records at changes of hour/day/month.This function also generates states functions about hour/day/month. |
call | Call a user defined operator/function. |
corr | Compute the value and the time shirt that would maximise the correlation between two channels. |
count | Count the number of records in a moving window. |
cusum | Computes the moving CuSum (Cumulative Sum). |
delay | Repeat a record after a certain amount of time i.e. create an artificial lag. This operator can be seen as the opposite of the "echoPast" operator. |
derivative | Estimate the signal time derivative by computing the difference between the last two values normalized by their time interval. If the signal is nosy, it is recommanded to apply a "tma" (triangular mobing average) before this operator. |
div | Divide the value of a channel by the value of another channel. The pair of channels to divide is defined by a double regular expression matching. THis operator is moslty useful when the pairs of channels are non trivial. In many cases, it is recommanded to use the "eq" operator instead. |
echo |
Repeat the input signals. In most cases, "echo" can be removed and replace by += or =. To avoid unwanted
signal duplication, it is recommended to use echo at the begening of the proram to capture all the signals
into a variable, and then to use this variable for processing: $all = echo #.* Echo is also required to send records to recursive signal variables. |
echoPast | Repet input records with a shift of time in the past (i.e. by decreasing the numerical timestamp value).echoPast is only available in static execution mode. |
ema | Compute a tailing exponential moving average with a fixed window length. |
endfunction | End of a used defined operator definition. |
endgroup | Close of group. See operation "beginGroup" for more details. |
endif | See documentation of "if" |
eq |
Create a signal such that its value is defined by a used defined equation written Polish Notation. The
equation can involve several input channels. Predefined variables are: "time" : Numerical timestamp value of the "symbol" record. "value" : Value of the "symbol" recor. "arg1" ... "arg4" : Last received values one the "arg" input signal argument. |
ewma | Compute an exponential weighted moving average control chart. |
fft | Compute the moving FFT (Fast Fourier Transform) of the input record values. The resulting spectum is grouped into bins. The projection in each bin is emited in a separate output channel. |
filter | Filter channels according to a regular expression test on their name. |
finish | Generates a record with symbol "finish" at the end of the program execution. |
function | Begin of a used defined operator definition. |
global | Specify for a variable to be "global". Global variables have a full scope over the entire program. |
global_normalize | Normalize a channel record's value by the mean and standart deviation estimated on all records (past and future) of this channel. This operation is only available in static execution mode. For normalization in streaming or online modes, use the operators "normalize" or "normalizeFixedTime". |
group | Begin a group of operations. Grouping operation does not impact processing. Grouping operation defines cluster of operations that will be grouped together for the graphical representation. The group should be closed with the "endGroup" operator. |
if | Specify that the following operators (until the matching "endIf") should only be compiled if the provided non-signal value is bellow 0.5. |
include | Specify an Honey source to include in the current source. |
keyboard |
Wait for the user to enter a word on the keyboard and generate a record in the channel "key_"+ |
layer |
Apply a set of thresholds on the record's values of a channel. The operator generates a records when the values cross-up or cross-down any of the threshold. The name of the generated record is automatically generated to indicate which threshold has been crossed. The operator also generates boolean channels to indicate between each threshold the current value of the channel is. Thresholds van be defined by a min,max,step or by a coma separated list of threshold values. |
max | Compute the maximum over a tailling window. |
min | Compute the minimum over a tailling window. |
movingFeatures | Compute several common tailling moving statistics. Computed statistics are: mean (equivalent to SMA [simple moving average]), min, max, median, standart deviation, range, and 5%-95% range. |
multiTests | Combine the p-value of several statistical tests. The record values should be -log p-values. |
normalize | Normalize a channel record's value by the mean and standart deviation estimated on a tailing moving window. |
normalizeFixedTime | Normalize the record values by a mean and mean+variance according to a reference time window specified by begin and end. Note that begin and end are absolute times. The reference mean and variance are updated every time a records is received in the reference window. If you want a moving reference window, you can use the "normalize" function. A signal is generated when at least 5 points are met. |
passIf | Repeat all the inputs records if the result of the equation applied on thie record is greater or equal to 0.5. Look at the "eq" operator for more details about the equation syntax. |
passIfFast | Repeat all the input records if all the constraints on this record are satisfied. This function is faster but less expressive than the "passIf" operator. |
passIfState | Repeat a record if and only if the last value of "gate" is >= 0.5 (or <=0.5, if reverse:true). "passIfState" is less expressive but faster than "passIf" |
pca | Learn a PCA (Principal component analysis) model, and project the record values on this model. The PCA model can be continuously re-trained using all past records when receiving a record on the "update" signal parameter, or it can be computed used all the records (past and future) if globalModel:true. globalModel:true is only available in static mode. This function return the projection, the instantanious reconstuction error and (in the case of global model), the global reconstruction error of the PCA projection. |
peak | Detect "peaks" (i.e. hills and valleys) of the value of a channel. A peak occurs when the first order derivative of the signal (after applying a tma smoothing) crosses up or crosses down the value 0. When a peak is detected, the function return the value of the second order derivative. To control the amound of detected peaks, the signal (and the first order derivative) are smoothed with a triangular moving average. The results of the peak are designed to be easily feed into the pattern or zigzag functions. |
plot | Create a plot of the records, and save it into an external file. The plotting is either done once at the end of the program execution, or when a trigger event is received. |
predict | Compute the continuous prediction (forecasting or past-casting) of a CTCG model. The model is reseted everytime a signal is send to the "reset" input. |
In streaming and online mode, print a line in the console every time a record with a new channel name is received. If every:true, a line is printed in the console at every new record. In static mode, print statistics about each input channels at the end of the program execution. | |
range | Compute the moving range (i.e. substraction betwen the maximum value and the mininum value). |
recursive | Specify for a signal variable to be recursive, i.e. to allow recursion in the signal. All operations will receive all the signal directed into a recursive variable independently of their order of definition in the source code. Recursive variables only support the += operator (i.e. does not support the = operator). |
rename | Change the name of records. By default, if records from different channels are provided, the function raise an error. If keepAll:true and if records from different channels are provided, all the recoards are merged into a single channel. If keepOnlyFirst:true and if records from different channels are provided, only the first meet channel is renamed and the others are ignored. |
renameRegexp | Change the name of records using a regular expression replacement. |
report_amoc | Evaluate various forecasting and detecing metrics of a set of predictor/trigger channels to the task of forecasting records of a set of target channels. Among other metrics, this function computes and plots the AMOC (Activity Monitor Operator Characteristic) and the T-ROC (Temporal ROC) of each predictor signal. This function also compare the AMOC and T-ROC of different predictors. Can optionnal produce various snap-shots centered on the predictors or the targets. The definition of most parameters are similar as the for "report_implication" function. This function can also produce "snapshots" of the various signals around the triggers and/or target records. Several options can allow you to configure the way the AMOC and T-ROCS are plotted. |
report_histIntersectEventScalar | Count the number of records for each "event" channels according to the value of a "scalar" channels. This function can for example be used to estimate the distribution of record of a particular channel according by the hour of the day (if the later is represented in a channel as a numerical value -- the calendar function returns such scalar channel). The results are saved as a text file. |
report_histIntersectEventState | Count the number of records for each "event" channels according to the value of a "state" channels. State channels only contains records with values 0 an 1. A value of 1 defines the "enabeling" a of state while the value 0 define the "disabeling" of a state. This function can for example be used to estimate the distribution of record of a particular channel according by the hour of the day (if the later is represented as a set of state channels -- the calendar function returns such state channel). The results are saved as a text file. |
report_implication | Compute various forecasting metrics (e.g. confidence, support, average prediction horizon) between a set of trigger channels (i.e. predictors) and a set of target channels.A trigger record at time t is generating a prediction of a target record between time t+forecast_horizon and time t+forecast_length.The results are exported as a flat csv file. |
report_predictorSelection | Select the optimal set of trigger channels in order to forecast the records of the target channel.The definition of most parameters are similar as the for "report_implication" function.The results are saved in a text file.The records of selected channels are also returned.Such records can be next evaluate using the "report_amoc" function with the parameter separatePredictionByValue:true. |
rest | Repeat a record if its value is greater than any of the previous values in a moving tailling window. |
return | Return a signal from a user defined function or from an Honey API program call. If used inside of a user definied function definition, "return" defines the signal to return by the function. If used outside of a user definied function, "return" defines the signal to return by the API call (when used in Honey API). In case of a function definition, "endfunction" should still be used to define the end of the function. If several returns are met in a function, their content will be agregated before beeing returned. |
sample | Sample a channel according to a trigger signal. If no record of the sampling channel is available at the trigger time, the last value of the sampled channel is returned instead. |
save | Save the signal to .evt file. Each received signal is immedialy saved and released from memory. |
saveBufferedBin | Export the input channels to a .bin file. All the events are stored in a buffer until the end of the script execution. |
saveBufferedCsv |
Export the content of a set of channels to a .csv file or a set of .csv files. Unlike the saveCsv file, the
saveBufferedCsv function stored the records until the end of the program execution. If the dataset is too
largue to fit in memory, it is recommanded to use the "savecsv" or "save" operators instead. Csv files
suppose for all channles to be synchronized. Therefore is the input channels are not synchronised, the
exported csv file will be filled with NA values. If the parameter reuseLastValue is set to true, the NA
values will be replaced with the last observed values (if any). If trigger is defined, a new .csv file will
be generated for each input record on the trigger channel. The string chain |
saveCsv | Export the symbol records to a csv file. Unlike the saveBufferedCsv function, the saveCsv function write records in the csv file as they come and release them from memory. Because of that, the saveCsv needs to know from the begening the name of the channels that will be exported. The column names can be specified with the "colNames" parameter. If the column names are not specified, they will be infered when writting the first line of the file. In this case, all signals should be available when writing the first line. The function will raise an error if a record with a new and unexpected channel name is received. |
sd | Compute a tailing standard deviation with a fixed window length on the records values. |
segment | Detect the presence of user defined patterns in the signal. A pattern is a comma separated sequence of 'U' (for up) and 'D' (for down) or 'U:[name]' and 'D:[name]' terms. This function extends the function zigzag. However, unlike the zigzag function, you do not need to provide the up/down records. Instead the function will automatically compute them with the peak function while optimizing the window parameter of the peak function. |
set | Assign a value to a variable. |
shewhart_univ | Compute a Shewhart individuals control chart. |
sinceLast | Emit a record with a value equal the time difference between the current and the last record. If the distance if greater than "maxValue" of if there is not anterior records, the function emits a record with the value "maxValue". |
skip | Repeat a record if there were are records from the same channel in a tailing moving window. |
sma | Compute a tailing simple moving average with a fixed window length. |
stop | Stop the parsing of the script. All the instructions bellow will be ignored. |
sub | Substract the value of a channel by the value of another channel. The pair of channels to substract is defined by a double regular expression matching. THis operator is moslty useful when the pairs of channels are non trivial. In many cases, it is recommanded to use the "eq" operator instead. |
sum | Compute a tailing sum with a fixed window length. |
tcpclient | Create a telnet like tcp client. The operator returns the value send by the server. The communication is done with the .evt format. Event Viewer can be used to connect to this tcp connection. |
tcpserver | Create a telnet like tcp server. The operator returns the values sent by the client. The communication is done with the .evt format. |
test | Run a statistical test between current record value of a given channel, and past values of the same channel with the same time distance to the specified landmark channel. For example, if we consider the landmark "monday" (a record is emited every monday at 00:00 -- this can be generated by the "calendar" function), a value sampled at 8:35am on tuesday will be compared to the values on all previous tuesdays at 8:35am. In the same example, if we consider the landmark "day" (a record is emited every day at 00:00 -- this can be generated by the "calendar" function), a value sampled at 8:35am on tuesday will be compared to the values on all previous days at 8:35am. A independent test is condicted for each pair of input and landmark channels. Test can then be aggregated using the "multiTests" function. |
tick | Generate a record at regular interval. |
tma | Compute a tailing triangular moving average (tma) with a fixed window length. |
zigzag | Detect the application of a "zigzag" pattern.A zigzag pattern is defined as a sequance of characters 'U' and 'D'. 'U' means 'up' and 'D' means 'down'.When a record is received on the trigger parameter, the zigzag applyed.If the pattern is matched, this function emits the time (and value, if the value parameter is specified) of each records used to match the pattern.The zigzag function has been designed so that the up and down input signals are the output of the "peak" function.However, zigzag can be use with any other signals. |
Operator reference
Assign or add the content of a variable to another one.
Anonymous options
source | Source variable. |
Example
$A = $B
$A += $B
$A += $B
@data
Define the input and output file(s) and/or director(y/ies) on which to apply the program. This command can be
used as a replacement of the --input command line option.
If several @data statement are given, they will be treated one after another independently. If several input files are given for a same @data statement (separated by ;) the input datasets will be merged and processed together. If several input directory are given for a same @data statement (separated by ;), the files in each direcotry will be grouped by file name (without the extension). Each group of file will be processed independently. The files inside of a group will be merged together.
If several @data statement are given, they will be treated one after another independently. If several input files are given for a same @data statement (separated by ;) the input datasets will be merged and processed together. If several input directory are given for a same @data statement (separated by ;), the files in each direcotry will be grouped by file name (without the extension). Each group of file will be processed independently. The files inside of a group will be merged together.
Named options
extension [optionnal] | Output extension in the case the output argument is a directory. Default value: "bin". |
input | Input file(s) or input directory(ies) separated by ";". Supported formats are .evt, .csv, .bin and .sevt. |
output [optionnal] | Output file/directory. |
Example
@data input:"input.evt" output:"output.csv"
@data input:"input1.evt;input2.evt" output:"output.csv"
@data input:"input_directory" output:"output_directory" extension:bin
@data input:"input_directory1;input_directory2" output:"output_directory" extension:bin
@data input:"input1.evt;input2.evt" output:"output.csv"
@data input:"input_directory" output:"output_directory" extension:bin
@data input:"input_directory1;input_directory2" output:"output_directory" extension:bin
@mode
Define the execution mode (Default:static). Available modes are "online", "static" and "streaming". This
parameter can also be overide by the --mode command call option. Static mode loads the entire dataset in memory
and process it. Static mode does not support recursive variables. Streaming load and process a dataset records
by records. Streaming mode only support sorted .evt or .csv files. Online mode runs in real time on records
received by online operators (e.g. tcpconnectino, calendar, tick).
Anonymous options
level | Mode. |
Named options
overwriteTime [optionnal] | Should the timestamps be overwritten by the receiving time. Is only used for online mode. |
Example
@mode static
@verbose
This parameter defines how much information about the script execution is displayed on the console. Can be one
of the follow: NONE, SMALL, NORMAL, FULL, TRACE. The default value is NORMAL. The NONE value ensures that
nothing is printing on the console (standart output) except for the command "cout" that outputs signal on the
console. This option is similar to the command call option --verbose.
Anonymous options
level | Verbose level. |
Example
@verbose small
active
Compute the presence or the absence of records in the tailing moving window. If a signal is present, the
operator returns 1, otherwise the operator returns 0.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
margin [optionnal] | Delay when switching from 0 to 1. Default:0=no delay. |
notUnique [optionnal] | If "true" successive updates need to have different values to be considered. Default: false. |
beep
Emit a beep (computer noise) every time an event is received.
Anonymous options
trigger | Trigger of the beep |
Named options
pitch [optionnal] | Pich of the beep. Default:750 |
calendar
Interpret the numerical time representation to be Unix time (i.e. number of second since the 1 Jan. 1970), and
generate specific records at changes of hour/day/month.This function also generates states functions about
hour/day/month.
Named options
local [optionnal] | Use local time or GMT time. Default:true=local. |
produce | List of calendar period change point to generate. This argument is a comma separated list of element among: "days", "hours", "months" and "year". Example: "produce:hours,days,months". |
call
Call a user defined operator/function.
Anonymous options
function | Function name |
Example
call f
call g $A $B param1:$C
call g $A $B param1:$C
corr
Compute the value and the time shirt that would maximise the correlation between two channels.
Anonymous options
symbol 1 | First symbol. |
symbol 2 | Second symbol. |
Named options
distance [optionnal] | Type of correlation measure to apply. Can be CORRELATION or MEAN_SQUARE. Default:CORRELATION. |
max | Maximum evaluated shift |
min | Minimum evaluated shift |
n [optionnal] | Number of tried shift values. Default:100. |
trigger | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
window | Time window length to compute the correlation. |
count
Count the number of records in a moving window.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
cusum
Computes the moving CuSum (Cumulative Sum).
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
k [optionnal] | k parameter of the cusum. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
th [optionnal] | threshold parameter of the cusum. |
delay
Repeat a record after a certain amount of time i.e. create an artificial lag. This operator can be seen as the
opposite of the "echoPast" operator.
Anonymous options
symbol | Channels on which to apply the operation. |
delay | Time delay. |
derivative
Estimate the signal time derivative by computing the difference between the last two values normalized by their
time interval. If the signal is nosy, it is recommanded to apply a "tma" (triangular mobing average) before this
operator.
Anonymous options
symbol | Channels on which to apply the operation. |
div
Divide the value of a channel by the value of another channel. The pair of channels to divide is defined by a
double regular expression matching. THis operator is moslty useful when the pairs of channels are non trivial.
In many cases, it is recommanded to use the "eq" operator instead.
Anonymous options
symbol 1 | First symbols of the pairs. |
symbol 2 | Second symbols of the pairs. |
Named options
match1 [optionnal] | Replacement for the search1 regular expression. A pair of symbol is considered when match1 and match2 are equal. |
match2 [optionnal] | Replacement for the search2 regular expression. |
nanValue [optionnal] | Value to return in case of NaN. By default, NaN values are removed. |
search1 [optionnal] | Searching regular expression to apply on "symbol 1". |
search2 [optionnal] | Searching regular expression to apply on "symbol 2". |
echo
Repeat the input signals. In most cases, "echo" can be removed and replace by += or =. To avoid unwanted signal
duplication, it is recommended to use echo at the begening of the proram to capture all the signals into a
variable, and then to use this variable for processing: $all = echo #.*
Echo is also required to send records to recursive signal variables.
Echo is also required to send records to recursive signal variables.
Anonymous options
symbol | Symbols to repeat. As any signal argument, the input can be a variable (e.g. $A), a symbol (e.g. toto), or a regular expression to catch several symbols (e.g. #(blue|red)_cat) |
echoPast
Repet input records with a shift of time in the past (i.e. by decreasing the numerical timestamp value).echoPast
is only available in static execution mode.
Anonymous options
symbol | Channels on which to apply the operation. |
time travel | How far the signal is sent in the past. |
ema
Compute a tailing exponential moving average with a fixed window length.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Window length for the averaging expressed in number of events. Warning: EMA window is different from SMA or TMA windows. |
endfunction
End of a used defined operator definition.
Example
endfunction
endgroup
Close of group. See operation "beginGroup" for more details.
Anonymous options
name | Name of the group to stop. |
Example
endgroup processing1
endif
See documentation of "if"
eq
Create a signal such that its value is defined by a used defined equation written Polish Notation. The equation
can involve several input channels. Predefined variables are:
"time" : Numerical timestamp value of the "symbol" record.
"value" : Value of the "symbol" recor.
"arg1" ... "arg4" : Last received values one the "arg" input signal argument.
"time" : Numerical timestamp value of the "symbol" record.
"value" : Value of the "symbol" recor.
"arg1" ... "arg4" : Last received values one the "arg" input signal argument.
Anonymous options
symbol | Input channels. |
equation | Equation in Polish notation. The equation is evaluated everytime a signal is updated. |
Named options
arg1 [optionnal] | "arg1" in the equation |
arg2 [optionnal] | "arg2" in the equation |
arg3 [optionnal] | "arg3" in the equation |
arg4 [optionnal] | "arg4" in the equation |
arg5 [optionnal] | "arg5" in the equation |
arg6 [optionnal] | "arg6" in the equation |
arg7 [optionnal] | "arg7" in the equation |
arg8 [optionnal] | "arg8" in the equation |
arg9 [optionnal] | "arg9" in the equation |
removeduplicate [optionnal] | Should consecutive duplicated values be removed. Default:false. |
Example
$a = eq $b value,2,*
$a = eq $b arg1:$c value,arg1,+
$a = eq $b arg1:$c value,arg1,+
ewma
Compute an exponential weighted moving average control chart.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
minNumObs [optionnal] | Minimum number of observations. Default:6 |
th [optionnal] | threshold parameter. |
fft
Compute the moving FFT (Fast Fourier Transform) of the input record values. The resulting spectum is grouped
into bins. The projection in each bin is emited in a separate output channel.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
maxf | Maximum frequency of keep. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
minf | Minimum frequency of keep. |
num | Number of bins when discretizing the ffp result. |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
filter
Filter channels according to a regular expression test on their name.
Anonymous options
symbol | Channels on which to apply the operation. |
regexp | Regular expression to apply on the syngal names. |
Named options
reverse [optionnal] | Reverse the filtering. Default:false. |
finish
Generates a record with symbol "finish" at the end of the program execution.
function
Begin of a used defined operator definition.
Anonymous options
name | Name of the function. |
Example
function f
$B = tick 10
return $B
endfunction
function f $A $B $C
return $C
endfunction
$B = tick 10
return $B
endfunction
function f $A $B $C
return $C
endfunction
global
Specify for a variable to be "global". Global variables have a full scope over the entire program.
Anonymous options
variable | Variable name |
Example
global $A
global_normalize
Normalize a channel record's value by the mean and standart deviation estimated on all records (past and future)
of this channel. This operation is only available in static execution mode. For normalization in streaming or
online modes, use the operators "normalize" or "normalizeFixedTime".
Anonymous options
symbol | Channels on which to apply the operation. |
Named options
begin [optionnal] | Begening of the time window. Default:Minus infinity.. |
end [optionnal] | End of the time window. Default: Plus infinity. |
group
Begin a group of operations. Grouping operation does not impact processing. Grouping operation defines cluster
of operations that will be grouped together for the graphical representation. The group should be closed with
the "endGroup" operator.
Anonymous options
name | Name of the group to start. |
Example
group processing1
if
Specify that the following operators (until the matching "endIf") should only be compiled if the provided
non-signal value is bellow 0.5.
Anonymous options
condition | non-signal condition |
Example
set %a 5
if %a,2,>
$result += sma $x
endif
if %a,2,>
$result += sma $x
endif
include
Specify an Honey source to include in the current source.
Anonymous options
path | Path to the library relative to the current script. |
Example
include "mylib.hny"
keyboard
Wait for the user to enter a word on the keyboard and generate a record in the channel "key_"+ where
is the word typed on the keyboard. This function is only available in online mode.
layer
Apply a set of thresholds on the record's values of a channel.
The operator generates a records when the values cross-up or cross-down any of the threshold.
The name of the generated record is automatically generated to indicate which threshold has been crossed.
The operator also generates boolean channels to indicate between each threshold the current value of the channel is.
Thresholds van be defined by a min,max,step or by a coma separated list of threshold values.
The operator generates a records when the values cross-up or cross-down any of the threshold.
The name of the generated record is automatically generated to indicate which threshold has been crossed.
The operator also generates boolean channels to indicate between each threshold the current value of the channel is.
Thresholds van be defined by a min,max,step or by a coma separated list of threshold values.
Anonymous options
symbol | Channels on which to apply the operation. |
Named options
max [optionnal] | Maximum threshold value. |
min [optionnal] | Minimum threshold value. |
output [optionnal] | What to produce. Comma separated list of element in: "state", "event", "up", "down" and "enter". "event" is equivalent to "up,down,enter". By default, everything is produced.. |
step [optionnal] | Difference between consecutive thresolds. |
thresholds [optionnal] | Comma separated list of thresholds. |
Example
$b = layer $a min:10 max:40 step:2
$b = layer $a min:10 max:40 step:2 output:event
$b = layer $a thresholds:1,5,9 output:up,down
$b = layer $a min:10 max:40 step:2 output:event
$b = layer $a thresholds:1,5,9 output:up,down
max
Compute the maximum over a tailling window.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:1 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
Example
$b = max $a 10
min
Compute the minimum over a tailling window.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:1 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
movingFeatures
Compute several common tailling moving statistics. Computed statistics are: mean (equivalent to SMA [simple
moving average]), min, max, median, standart deviation, range, and 5%-95% range.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
minNumObs [optionnal] | Minimum number of observations. Default:5 |
output [optionnal] | What feature to compute. If not specified, all features are computed. If specified, "output" should be a comma separated list of elements such as mean,median,sd,range,min,max,range90,count or all e.g. output:mean,sd or output:all. Default:all. |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
Example
$b = movingFeatures $a 100
$b = movingFeatures $a 100 minNumObs:10
$b = movingFeatures $a 100 output:mean,range,sd
$b = movingFeatures $a 100 minNumObs:10 output:mean,range,sd trigger:$c
$b = movingFeatures $a 100 minNumObs:10
$b = movingFeatures $a 100 output:mean,range,sd
$b = movingFeatures $a 100 minNumObs:10 output:mean,range,sd trigger:$c
multiTests
Combine the p-value of several statistical tests. The record values should be -log p-values.
Anonymous options
symbol | Symbols of the tests. |
Named options
alpha | Alpha value for the testing. |
correction [optionnal] | Type of correction. Can be BONFERRONI, SIDAK or HOLM_BONFERRONI (default). |
name [optionnal] | Symbol of the generated signal. |
Example
$b = multiTests $a correction:HOLM_BONFERRONI alpha:0.01
normalize
Normalize a channel record's value by the mean and standart deviation estimated on a tailing moving window.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
minNumObs [optionnal] | Minimum number of observations. Default:6 |
type [optionnal] | Type of normalization. Can be "mean", "meansd" or "both". Default:both. |
normalizeFixedTime
Normalize the record values by a mean and mean+variance according to a reference time window specified by begin
and end. Note that begin and end are absolute times. The reference mean and variance are updated every time a
records is received in the reference window. If you want a moving reference window, you can use the "normalize"
function. A signal is generated when at least 5 points are met.
Anonymous options
symbol | Channels on which to apply the operation. |
Named options
begin | Begening of the time window. |
end | End of the time window. |
passIf
Repeat all the inputs records if the result of the equation applied on thie record is greater or equal to 0.5.
Look at the "eq" operator for more details about the equation syntax.
Anonymous options
symbol | Channels to filter |
equation | Filtering equation. The equation need to be written in Polish notation with "," beeing the separator. Example: "time,1000,>=" remove all signal before time 1000. |
Named options
arg1 [optionnal] | "arg1" in the equation |
arg2 [optionnal] | "arg2" in the equation |
arg3 [optionnal] | "arg3" in the equation |
arg4 [optionnal] | "arg4" in the equation |
Example
$b = passIf $a "value,10,>"
$b = passIf $a "value,arg1,>" arg1:$c
$b = passIf $a "value,arg1,>" arg1:$c
passIfFast
Repeat all the input records if all the constraints on this record are satisfied. This function is faster but
less expressive than the "passIf" operator.
Anonymous options
symbol | Symbol to extract. |
Named options
maxTime [optionnal] | Maximum time. |
maxValue [optionnal] | Maximum value. |
minTime [optionnal] | Minimum time. |
minValue [optionnal] | Minimum value. |
Example
$b = passIfFast $a minValue:10 minTime:20
passIfState
Repeat a record if and only if the last value of "gate" is >= 0.5 (or <=0.5, if reverse:true). "passIfState" is
less expressive but faster than "passIf"
Anonymous options
symbol | Channels to filter |
Named options
gate | Gate argument. |
reverse [optionnal] | Reverse the selection. Default:false. |
Example
$b = passIfState $a gate:$c
pca
Learn a PCA (Principal component analysis) model, and project the record values on this model. The PCA model
can be continuously re-trained using all past records when receiving a record on the "update" signal
parameter, or it can be computed used all the records (past and future) if globalModel:true.
globalModel:true is only available in static mode. This function return the projection, the instantanious
reconstuction error and (in the case of global model), the global reconstruction error of the PCA
projection.
Anonymous options
symbol | Channels on which to apply the operation. |
Named options
globalModel [optionnal] | Should the model be computed from the past data (false) or from all the available data (true) ? The later version only work in static offline model. |
name [optionnal] | Base name for the output signals. |
num | Numbers of dimensions to report. |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
update [optionnal] | When to update the model. If not specified, the model is updated before every output. |
Example
$b = pca $a num:5 globalModel:true trigger:$c name:"all_st"
peak
Detect "peaks" (i.e. hills and valleys) of the value of a channel. A peak occurs when the first order
derivative of the signal (after applying a tma smoothing) crosses up or crosses down the value 0. When a
peak is detected, the function return the value of the second order derivative. To control the amound of
detected peaks, the signal (and the first order derivative) are smoothed with a triangular moving average.
The results of the peak are designed to be easily feed into the pattern or zigzag functions.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window lenght for the smoothing. The larger the window, the "stronger" should be the peaks to be detected. |
Named options
debug [optionnal] | Should the peak functions returns its intermediate results (e.g. derivative signal). Default:false. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
smoothingLevel [optionnal] | Stragery of smoothing. Should be either 0, 1 or 2. The lower the more peaks will be genrated. Default:1. |
Example
$b = peak $a 0.5
plot
Create a plot of the records, and save it into an external file. The plotting is either done once at the end
of the program execution, or when a trigger event is received.
Anonymous options
symbol | Symbol to save. |
Named options
file | path of the file to write. TIME is replaced by the current time. |
offsetTime [optionnal] | Offset the time so the first value is at time 0. Default:true. |
trigger [optionnal] | Trigger of the snapshot. If not specified, snapshot is generated as the end of the execution |
unitHeight [optionnal] | Height for each plot. Default: 100. |
width [optionnal] | Width of the snapshot. Default: 800. |
Example
plot $a trigger:$k file:random_TIME.svg
predict
Compute the continuous prediction (forecasting or past-casting) of a CTCG model. The model is reseted
everytime a signal is send to the "reset" input.
Anonymous options
symbol | Input signals of the model. |
Named options
modelPath | File path of the model. |
modelType | Type of the model (e.g. ml, ctcg, ctcg2, etc.) |
reset [optionnal] | Reset the model internal state as if the new signals were comming for a new dataset. |
Example
$predictions = predict $model_input modelPath:"models/randomforest.ml" modelType:"ml" reset:$reset
print
In streaming and online mode, print a line in the console every time a record with a new channel name is
received. If every:true, a line is printed in the console at every new record. In static mode, print
statistics about each input channels at the end of the program execution.
Anonymous options
symbol | Symbol to print. |
Named options
every [optionnal] | Do we print all the events, or only the first one of each kind? By default "every:false" i.e. only the first of each kind. |
label [optionnal] | Label attached to the print. |
Example
print $a label:"Result of the first part."
range
Compute the moving range (i.e. substraction betwen the maximum value and the mininum value).
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
recursive
Specify for a signal variable to be recursive, i.e. to allow recursion in the signal. All operations will
receive all the signal directed into a recursive variable independently of their order of definition in the
source code. Recursive variables only support the += operator (i.e. does not support the = operator).
Anonymous options
variable | Variable name |
Example
recursive $A
rename
Change the name of records. By default, if records from different channels are provided, the function raise
an error. If keepAll:true and if records from different channels are provided, all the recoards are merged
into a single channel. If keepOnlyFirst:true and if records from different channels are provided, only the
first meet channel is renamed and the others are ignored.
Anonymous options
symbol | Channels on which to apply the operation. |
new name | New symbol. |
Named options
keepAll [optionnal] | If set to true, several different symbol can be renamed. |
keepOnlyFirst [optionnal] | If set to true, only the first met symbol is renamed and transmited. If set to false (default), an error is raised if more than one symbol is met. |
Example
$b = rename $a "new_channel_name"
renameRegexp
Change the name of records using a regular expression replacement.
Anonymous options
symbol | Channels on which to apply the operation. |
regularExpression | A regular expression that match the signal name. If the name of a signal does not match, the name is not changed. |
newName | The new name of the channels. $1, $2, ... $n will be replaces by parts between parenthesis of the pattern. |
Example
$b = renameRegexp $a "(blue|red)_cat" "$1_dog"
report_amoc
Evaluate various forecasting and detecing metrics of a set of predictor/trigger channels to the task of
forecasting records of a set of target channels. Among other metrics, this function computes and plots the
AMOC (Activity Monitor Operator Characteristic) and the T-ROC (Temporal ROC) of each predictor signal. This
function also compare the AMOC and T-ROC of different predictors. Can optionnal produce various snap-shots
centered on the predictors or the targets. The definition of most parameters are similar as the for
"report_implication" function. This function can also produce "snapshots" of the various signals around the
triggers and/or target records. Several options can allow you to configure the way the AMOC and T-ROCS are
plotted.
Named options
base [optionnal] | Signal on which to apply timeout to compute the dataset length. |
compare [optionnal] | Compare different methods. Default:False. |
confBounds [optionnal] | Plot confidence bounds on the plots. Default:true. |
falsePositive [optionnal] | Display format of false positives. Can be COUNT, RATIO_ENTITY or INTERVAL (default). |
file | Basepath of the output files. |
force_horizon [optionnal] | Override the "horizon" parameter. |
force_window [optionnal] | Override the "window" parameter. |
horizon [optionnal] | Time horizon. Requiered for event type. |
horizonFormat [optionnal] | Time format for the horizon. Should be "[label],[factor]" e.g. hours,3600 |
intervalFormat [optionnal] | Time format for the interval. Should be "[label],[factor]" e.g. hours,3600 |
lockout [optionnal] | For how long the predictor is shutdown after a prediction. |
missValue [optionnal] | Value to assign to the prediction horizon for a missed alert e.g. 0. |
reallockout [optionnal] | Do the function use a realistic lock out. Default:true. Note: realistic lockout can produce instable plots if the lockout is large. |
reverseHorizon [optionnal] | Reverse teh horizon. Default:false. |
sensitivities [optionnal] | Maxmimum number of sensitivitie thresholds to evaluate. Default:1000 |
separatePredictionByValue [optionnal] | Should predictor be evaluate individually for each possible prediction value. Default: false. |
separatePredictionByValue_details [optionnal] | Comma separated list of pair [:symbol:]:[true|false] to specificely override the separatePredictionByValue parameter. |
target | Targets channels i.e. the records to forecast. |
targetSnapshot [optionnal] | Should the function compute target snapshots. Default:false. |
targetSnapshot_future [optionnal] | End of the snapshot relative to the target event. |
targetSnapshot_past [optionnal] | Begening of the snapshot relative to the target event. |
targetSnapshot_raw [optionnal] | Additionnal raw data to plot. |
targetSnapshot_resolution [optionnal] | Resolution of the agregation. default:60. |
targetSnapshot_timeFormat [optionnal] | Time format for the interval. Should be "[label],[factor]" |
timeOut [optionnal] | Maximum time between two consecutive events for the dataset to be continuous. |
traceFpi [optionnal] | False positive interval values to use for comparison expressed in the time interval format. If not specified, these value are choosen automatically. |
trigger | Trigger channels i.e. the records that generate predictions. |
triggerSnapshot [optionnal] | Should the function compute trigger snapshots. Default:false. |
triggerSnapshot_export [optionnal] | Signal to export in the snapshots. |
triggerSnapshot_future [optionnal] | End of the snapshot relative to the false prediction. |
triggerSnapshot_gap [optionnal] | Maximum time gap between contiguous signal. Default:None=-1 |
triggerSnapshot_lockout [optionnal] | Replacement of the lockouttime from the amoc. |
triggerSnapshot_past [optionnal] | Begening of the snapshot relative to the false prediction. |
triggerSnapshot_rawEvent [optionnal] | Additionnal raw data to plot. |
triggerSnapshot_rawScalar [optionnal] | Additionnal raw data to plot. |
triggerSnapshot_resolution [optionnal] | Resolution of the agregation. default:60. |
window [optionnal] | Time window. Requiered for event type. |
xmax [optionnal] | xmax of the amoc. |
xmin [optionnal] | xmin of the amoc. |
ylog [optionnal] | ylog of the amoc. |
ymax [optionnal] | ymax of the amoc. |
ymin [optionnal] | ymin of the amoc. |
Example
report_amoc file:"result_" missValue:0 lockout:-1 window:3600 horizon:0 target:$ALERT trigger:$PREDICTOR
timeOut:500 base:$ALL confBounds:false separatePredictionByValue:false horizonFormat:"min,60"
intervalFormat:"hours/patient,3600" ymin:1 ymax:48
report_histIntersectEventScalar
Count the number of records for each "event" channels according to the value of a "scalar" channels. This
function can for example be used to estimate the distribution of record of a particular channel according by
the hour of the day (if the later is represented in a channel as a numerical value -- the calendar function
returns such scalar channel). The results are saved as a text file.
Named options
event | Event to count. |
file | Text file to store the results of the analysis. |
scalar | Scalar to count to compare the event to. |
sortBy [optionnal] | What to sort the results by. Can be "name" or "value". Default:name. |
report_histIntersectEventState
Count the number of records for each "event" channels according to the value of a "state" channels. State
channels only contains records with values 0 an 1. A value of 1 defines the "enabeling" a of state while the
value 0 define the "disabeling" of a state. This function can for example be used to estimate the
distribution of record of a particular channel according by the hour of the day (if the later is represented
as a set of state channels -- the calendar function returns such state channel). The results are saved as a
text file.
Named options
event | Event to count. |
file | Text file to store the results of the analysis. |
sortBy [optionnal] | What to sort the results by. Can be "name" or "value". Default:name. |
state | States to count. |
Example
$cal = calendar produce:days,hours,months
$cal_hour = filter $cal "state.hour_is_.*"
report_histIntersectEventState event:$abnormality_t state:$cal_hour file:"report_hour.txt"
$cal_hour = filter $cal "state.hour_is_.*"
report_histIntersectEventState event:$abnormality_t state:$cal_hour file:"report_hour.txt"
report_implication
Compute various forecasting metrics (e.g. confidence, support, average prediction horizon) between a set of
trigger channels (i.e. predictors) and a set of target channels.A trigger record at time t is generating a
prediction of a target record between time t+forecast_horizon and time t+forecast_length.The results are
exported as a flat csv file.
Named options
base | Signal on which to apply timeout to compute the active dataset length. |
file | Text file to store the results of the analysis. |
horizon | Forecast horizon i.e. minimum time between the prediction record and the targe record. |
length | Forecast window length i.e. lenght of the prediction window. |
lockTime [optionnal] | If the "lockTime" is defined, a given trigger channel does to sleep for "lockTime" time units after a prediction is generated.During this sleeping state, this trigger channel cannot genetate new predictions. |
target | Targets channels i.e. the records to forecast. |
timeout | If the "base" input does not contains any records for more than "timeout" time units, a hole is defined.Hole are used to compute the active duration of the dataset.Several of the computed forecasting metrics depend on this active duration. |
trigger | Trigger channels i.e. the records that generate predictions. |
Example
report_implication file:"implication.csv" target:$ALERT base:$ALL horizon:0 length:3600 timeout:3600
trigger:$TRIGGER
report_predictorSelection
Select the optimal set of trigger channels in order to forecast the records of the target channel.The
definition of most parameters are similar as the for "report_implication" function.The results are saved in
a text file.The records of selected channels are also returned.Such records can be next evaluate using the
"report_amoc" function with the parameter separatePredictionByValue:true.
Named options
algorithm | The algorithm used for the selection. Can be MAXH_LIMITFP_EXACT_GENMAX, MAXH_LIMITFP_EXACT_EXAUSTIVE, MAXH_LIMITFP_GREEDY_MGB, MAXH_LIMITFP_GREEDY_MGB_BEAM, MAXH_LIMITFP_GREEDY_MGB_RATIO, MAXH_LIMITFP_GREEDY_MGB_RATIO_BEAM, MAXH_LIMITFP_EXACT_MAFIA, MAXH_LIMITFP_EXACT_DYNAMIC, MAXH_LIMITFP_GREEDY_MGB_PRESEL, MAXH_LIMITFP_GREEDY_MGB_RATIO_PRESEL. |
base | Signal on which to apply timeout to compute the active dataset length. |
file | Text file to store the results of the analysis. |
horizon | Forecast horizon i.e. minimum time between the prediction record and the targe record. |
length | Forecast window length i.e. lenght of the prediction window. |
lockTime [optionnal] | If the "lockTime" is defined, a given trigger channel does to sleep for "lockTime" time units after a prediction is generated.During this sleeping state, this trigger channel cannot genetate new predictions |
maxBeams [optionnal] | Maximum number of beams in the beam search (default:5). |
maxFP [optionnal] | Maximum number of false positives. Can also be a coma separated list (e.g. 10,20,40) or a range (e.g. 10-100:10) |
maxSelection [optionnal] | Maximum number of selected predictors. Default: No maximum. |
outputSymbol [optionnal] | Name of the output channel. If not provided, the function does not emit any signal. |
target | Targets channels i.e. the records to forecast. |
timeout | If the "base" input does not contains any records for more than "timeout" time units, a hole is defined.Hole are used to compute the active duration of the dataset.Several of the computed forecasting metrics depend on this active duration. |
trigger | Trigger channels i.e. the records that generate predictions. |
verbose [optionnal] | Display the progression of the processing. Default:true. |
Example
$PREDICTOR += report_predictorSelection base:$ALL file:"selection.txt" length:3600 horizon:0
target:$ALERT timeout:500 trigger:$LAYERS_1 algorithm:MAXH_LIMITFP_EXACT_EXAUSTIVE lockTime:-1
maxFP:%FPs outputSymbol:"selection_MAXH_LIMITFP_EXACT_EXAUSTIVE" maxSelection:8
report_amoc file:"amoc_" missValue:0 lockout:-1 window:3600 horizon:0 target:$ALERT trigger:$PREDICTOR timeOut:500 base:$ALL confBounds:false separatePredictionByValue:false horizonFormat:"min,60" intervalFormat:"hours/patient,3600" separatePredictionByValue_details:%byValue ymin:1 ymax:48
report_amoc file:"amoc_" missValue:0 lockout:-1 window:3600 horizon:0 target:$ALERT trigger:$PREDICTOR timeOut:500 base:$ALL confBounds:false separatePredictionByValue:false horizonFormat:"min,60" intervalFormat:"hours/patient,3600" separatePredictionByValue_details:%byValue ymin:1 ymax:48
rest
Repeat a record if its value is greater than any of the previous values in a moving tailling window.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
return
Return a signal from a user defined function or from an Honey API program call. If used inside of a user
definied function definition, "return" defines the signal to return by the function. If used outside of a
user definied function, "return" defines the signal to return by the API call (when used in Honey API). In
case of a function definition, "endfunction" should still be used to define the end of the function. If
several returns are met in a function, their content will be agregated before beeing returned.
Anonymous options
symbol | Symbol to return. |
Named options
name [optionnal] | Name of the return in case of several returns. |
sample
Sample a channel according to a trigger signal. If no record of the sampling channel is available at the
trigger time, the last value of the sampled channel is returned instead.
Anonymous options
symbol | Channels on which to apply the operation. |
Named options
noTail [optionnal] | If set to true, does not add a tail (post-fix) to the signal name. |
trigger | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
save
Save the signal to .evt file. Each received signal is immedialy saved and released from memory.
Anonymous options
symbol | Symbol to save. |
Named options
append [optionnal] | Append (or replace) the content of the file. Default:false. |
createMissingDir [optionnal] | Create missing directories. Default:false. |
file | path of the file to write. |
saveBufferedBin
Export the input channels to a .bin file. All the events are stored in a buffer until the end of the script
execution.
Anonymous options
symbol | Symbol to save. |
Named options
createMissingDir [optionnal] | Create missing directories. Default:false. |
file | path of the file to write. |
Example
saveBufferedBin $O file:output.bin
saveBufferedBin $O file:%output
saveBufferedBin $O file:%output
saveBufferedCsv
Export the content of a set of channels to a .csv file or a set of .csv files. Unlike the saveCsv file, the
saveBufferedCsv function stored the records until the end of the program execution. If the dataset is too
largue to fit in memory, it is recommanded to use the "savecsv" or "save" operators instead. Csv files
suppose for all channles to be synchronized. Therefore is the input channels are not synchronised, the
exported csv file will be filled with NA values. If the parameter reuseLastValue is set to true, the NA
values will be replaced with the last observed values (if any). If trigger is defined, a new .csv file will
be generated for each input record on the trigger channel. The string chain in the file name will be
replaced with an increasing index.
Anonymous options
symbol | Symbol to save. |
Named options
createMissingDir [optionnal] | Create missing directories. Default:false. |
file |
path of the file to write. The substring |
naSymbol [optionnal] | String to write in teh csv file when a value is not available. Default:NA. |
reuseLastValue [optionnal] | Should the value be reused when writting successive rows. Default:false. |
saveTime [optionnal] | Save the time as the first column (default:true). |
trigger [optionnal] | If provided, a new .csv file will be create for each received records on the trigger channel. If not provided, a single .csv file will be created at the end of the program execution. |
Example
saveBufferedCsv $O file:output.csv
saveCsv
Export the symbol records to a csv file. Unlike the saveBufferedCsv function, the saveCsv function write
records in the csv file as they come and release them from memory. Because of that, the saveCsv needs to
know from the begening the name of the channels that will be exported. The column names can be specified
with the "colNames" parameter. If the column names are not specified, they will be infered when writting the
first line of the file. In this case, all signals should be available when writing the first line. The
function will raise an error if a record with a new and unexpected channel name is received.
Anonymous options
symbol | Symbol to save. |
Named options
colNames [optionnal] | Coma separated names of the collumns to write from the "symbol" parameter. If not specified, the column names will be automatically computed. |
createMissingDir [optionnal] | Create missing directories. Default:false. |
file | path of the file to write. |
trigger [optionnal] | Symbol that trigger the writing of a new csv line. If not specified, a line is written for each new data. |
Example
saveCsv $O file:output.csv
sd
Compute a tailing standard deviation with a fixed window length on the records values.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
segment
Detect the presence of user defined patterns in the signal. A pattern is a comma separated sequence of 'U'
(for up) and 'D' (for down) or 'U:[name]' and 'D:[name]' terms. This function extends the function zigzag.
However, unlike the zigzag function, you do not need to provide the up/down records. Instead the function
will automatically compute them with the peak function while optimizing the window parameter of the peak
function.
Anonymous options
symbol | Channels on which to apply the operation. |
Named options
bound | Signal that define bounds i.e. trigger. |
compute [optionnal] | What to compute. Should be a comma sepatated list of elements from "pattern" or "hist" |
debug [optionnal] | Should the debug information (e.g. the polygons) should be returned. Default:false. The debug polygons can be plotting in Event Viewer to show the envelope of the signal. |
pattern | Pattern to detect. |
Example
$b = segment $a bound:$c pattern:"U:X,D:A,U:Y,D:V"
set
Assign a value to a variable.
Anonymous options
variable | Non signal variable name. Remember that non signal variable name start with $. Example: $toto. |
value | The new value to assign. Example: 5. |
Example
set %toto 43
shewhart_univ
Compute a Shewhart individuals control chart.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
k [optionnal] | Number of standard deviations to generate an alert. Default:3 |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
sinceLast
Emit a record with a value equal the time difference between the current and the last record. If the
distance if greater than "maxValue" of if there is not anterior records, the function emits a record with
the value "maxValue".
Anonymous options
symbol | Channels on which to apply the operation. |
maxValue | Maximum returned value. |
Named options
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
skip
Repeat a record if there were are records from the same channel in a tailing moving window.
Anonymous options
symbol | Channels on which to apply the operation. |
minDistance | Minimum time distance to the last record. |
Named options
noTail [optionnal] | If set to true, does not add a tail (post-fix) to the signal name. |
sma
Compute a tailing simple moving average with a fixed window length.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
stop
Stop the parsing of the script. All the instructions bellow will be ignored.
Example
stop
sub
Substract the value of a channel by the value of another channel. The pair of channels to substract is
defined by a double regular expression matching. THis operator is moslty useful when the pairs of channels
are non trivial. In many cases, it is recommanded to use the "eq" operator instead.
Anonymous options
symbol 1 | First symbols of the pairs. |
symbol 2 | Second symbols of the pairs. |
Named options
match1 [optionnal] | Replacement for the search1 regular expression. A pair of symbol is considered when match1 and match2 are equal. |
match2 [optionnal] | Replacement for the search2 regular expression. |
nanValue [optionnal] | Value to return in case of NaN. By default, NaN values are removed. |
search1 [optionnal] | Searching regular expression to apply on "symbol 1". |
search2 [optionnal] | Searching regular expression to apply on "symbol 2". |
sum
Compute a tailing sum with a fixed window length.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
tcpclient
Create a telnet like tcp client. The operator returns the value send by the server. The communication is
done with the .evt format. Event Viewer can be used to connect to this tcp connection.
Anonymous options
symbol | Channel to send to the server. |
Named options
ip | ip of the server. |
port | port of the server. |
tcpserver
Create a telnet like tcp server. The operator returns the values sent by the client. The communication is
done with the .evt format.
Anonymous options
symbol | Symbol on which to send to the client. |
Named options
port | port for the server to listen. |
test
Run a statistical test between current record value of a given channel, and past values of the same channel
with the same time distance to the specified landmark channel. For example, if we consider the landmark
"monday" (a record is emited every monday at 00:00 -- this can be generated by the "calendar" function), a
value sampled at 8:35am on tuesday will be compared to the values on all previous tuesdays at 8:35am. In the
same example, if we consider the landmark "day" (a record is emited every day at 00:00 -- this can be
generated by the "calendar" function), a value sampled at 8:35am on tuesday will be compared to the values
on all previous days at 8:35am. A independent test is condicted for each pair of input and landmark
channels. Test can then be aggregated using the "multiTests" function.
Anonymous options
input | Channels on which to apply the operation. |
Named options
landmark [optionnal] | Landmark to which the test is relative. |
maxDist [optionnal] | Maximum time between the current input and the last landmark for this landmark to be computed. Default:no limit. |
method [optionnal] | Hypothesis for the statistical test. Available options are: NORMAL, POISSON, STUDENT, CUSUM, SHEWHART and BOOTSTRAP. |
minNumObs [optionnal] | Minimum number of observations for the test test to be computed. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
tick
Generate a record at regular interval.
Anonymous options
interval | Time betwen two consecutive ticks. |
Named options
aligned [optionnal] | Should the tick be aligned on the time value i.e. be generated with a time value as multiple of the interval value. Default:true |
tma
Compute a tailing triangular moving average (tma) with a fixed window length.
Anonymous options
symbol | Channels on which to apply the operation. |
window | Moving window length. |
Named options
emptyValue [optionnal] | Value to return if less than minNumObs. If not specified, wont return any value. |
minNumObs [optionnal] | Minimum number of observations. Default:6 |
trigger [optionnal] | Generate an output everytime a trigger event is received. If this argument is not specified, an output is generated at every new input of the symbol argument. |
zigzag
Detect the application of a "zigzag" pattern.A zigzag pattern is defined as a sequance of characters 'U' and
'D'. 'U' means 'up' and 'D' means 'down'.When a record is received on the trigger parameter, the zigzag
applyed.If the pattern is matched, this function emits the time (and value, if the value parameter is
specified) of each records used to match the pattern.The zigzag function has been designed so that the up
and down input signals are the output of the "peak" function.However, zigzag can be use with any other
signals.
Named options
computeRelative [optionnal] | Should the function return the relative values (default:false) |
down | The 'D' records |
pattern | Zigzag pattern to apply. It is a string of "U" (for up) and "D" (for down). For example, pattern:UDUDDU. |
postD [optionnal] | Do we allow downs after the end of the pattern and before the trigger? (default:false) |
postU [optionnal] | Do we allow ups after the pattern and before the trigger? (default:false) |
trigger | When to apply the pattern. |
up | The 'U' records. |
value [optionnal] | If specified, the value of this channel is returned when the pattern is matched. |