This is an old revision of the document!
LagCorrectedQuery Class
The LagCorrectedQuery class uses a samplestream to search backwards in time to produce a single data-frame that includes lag-corrected values.
This allows you to easily create analytics that compare quality or deal with lag caused by the distance between different sensors along a line.
Functions
The class has the following functions…
Setup
Adding Subqueries
Running
Variables
The following member variables are available
Name | Type | Usage |
---|---|---|
expected | int | Normal length of the lag when running (seconds) |
maxtime | int | Maximum length of the search (seconds) |
multiplier | float | Multiplier to be applied to the value in data-frame index |
shavems | bool | When True, times are rounded to the nearest second |
Usage
The multiplier is usually used to convert the time-base of a rate. The class expects your rate to be per second, so if you wanted to use a per minute input time, you can set the multiplier to 0.016666.
The shavems option is useful if you want to simplify the data you're getting by eliminating sub-second results. This will effectively 'round up' your results so you have no more than one point per second.