<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://docs.optrix.com.au/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>ARDI Documentation - samplestream</title>
        <description></description>
        <link>https://docs.optrix.com.au/</link>
        <lastBuildDate>Wed, 27 May 2026 01:25:52 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://docs.optrix.com.au/_media/wiki:dokuwiki.svg</url>
            <title>ARDI Documentation</title>
            <link>https://docs.optrix.com.au/</link>
        </image>
        <item>
            <title>Adaptable Example</title>
            <link>https://docs.optrix.com.au/samplestream:adaptable_example</link>
            <description>Adaptable Example

In the previous example, we hard-coded the distance between each of our assets when requesting a lag-corrected query.

This would mean the code wouldn&#039;t be able to adapt to changes, move between various different lines, or deal with flexible systems that adjust for specific products.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>ai_array()</title>
            <link>https://docs.optrix.com.au/samplestream:ai_array</link>
            <description>ai_array()

This is a function of the sample class.

Parameters

None

Description

Returns the content of the data-frame as an array.

Returns

The returned array will be either a flat array (when you have only a single channel of data), or an array in time/column order.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>ai_conv()</title>
            <link>https://docs.optrix.com.au/samplestream:ai_conv</link>
            <description>ai_conv()

This is a function of the sample class.

Parameters

None

Description

Returns the content of the data-frame as a multi-dimensional array.

Returns

When working with single-channel data, the array returned by ai_array doesn&#039;t have the right structure to be used in convolutional or RNN networks.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Looking Backwards</title>
            <link>https://docs.optrix.com.au/samplestream:building_backwards</link>
            <description>Looking Backwards

One key thing to keep in mind is that the lag correction classes only work backwards.

This is because you can easily reach &#039;now&#039; when scanning forwards, meaning you need data from the future in order to synchronise your data.

To prevent this, you should always work in reverse - starting from the</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>LagCorrectedQuery Class</title>
            <link>https://docs.optrix.com.au/samplestream:class_lagcorrectedquery</link>
            <description>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.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>LagCorrection Class</title>
            <link>https://docs.optrix.com.au/samplestream:class_lagcorrection</link>
            <description>LagCorrection Class

The LagCorrection class uses a samplestream to search backwards in a query, looking for a certain amount of a given value to have passed.

The class has the following functions...

Amount 

Rate</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Sample Class</title>
            <link>https://docs.optrix.com.au/samplestream:class_sample</link>
            <description>Sample Class

The sample class is returned when you call NextSample from the samplestream object.

It contains the following members...

time

A datetime (in UTC) for the sample.

data

A Pandas DataFrame containing the values of the sample. This dataframe has an index of</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>SampleStream Class</title>
            <link>https://docs.optrix.com.au/samplestream:class_samplestream</link>
            <description>SampleStream Class

The samplestream class used to iterate over an AQL query at high resolution, using a sliding window of evenly-spaced points.

It&#039;s the main class you&#039;ll be using when using SampleStream.

Functions

The class contains the following functions</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Data-Driven Lag</title>
            <link>https://docs.optrix.com.au/samplestream:data-driven_lag</link>
            <description>Data-Driven Lag

What Is Lag?

Lag between various sensors and pieces of equipment is common.

There are a number of reasons why lag exists, but they are usually caused by needing to overcome either distance or inertia, such as...

	*  A machine taking a while to reach top speed,</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Distance</title>
            <link>https://docs.optrix.com.au/samplestream:distance</link>
            <description>Distance

The documentation will sometimes refer to distance when it comes to correcting lag. 

Although distance-between-sensors is one of the most common causes of lag, please note that you don&#039;t have to be dealing with actual length measurements when we refer to distance.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>End Asset</title>
            <link>https://docs.optrix.com.au/samplestream:end_asset</link>
            <description>End Asset

The end asset is the last asset in any set of assets you&#039;re using in your queries.

For example, in the image below...



The Inspection Station is the last place your cupcakes reach, so it is the End Asset.

When entering in the Lag values into functions like</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Example SampleStream Timings</title>
            <link>https://docs.optrix.com.au/samplestream:example_timings</link>
            <description>Example SampleStream Timings

The parameters you use when creating your samplestream depend on your application and what you&#039;re hunting for.

High-Resolution Scans

Are you looking for events that only show up at 20-millisecond resolution? You can scan long time frames at high resolution using settings like these</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Cupcake Example</title>
            <link>https://docs.optrix.com.au/samplestream:example</link>
            <description>Cupcake Example



In this case, we&#039;re going to ask for both the oven temperature and final colour on a cupcake-making machine. These two pieces of equipment are 50m apart from one-another. 

Example Chart

This is what a chart of our temperature and colour values looks like at the moment. Thanks to the distance between the two components, there&#039;s a significant amount of lag between the readings from the</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Start</title>
            <link>https://docs.optrix.com.au/samplestream:fn_start</link>
            <description>Start

This is a function of the samplestream class.

Description

This initialises the SampleStream object and makes the first AQL query, loading data into the buffer to be browsed with NextSample.

This is automatically called the first time you call NextSample.

Parameters</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>GatherSamples</title>
            <link>https://docs.optrix.com.au/samplestream:gathersamples</link>
            <description>GatherSamples

This is a function of the samplestream class.

Description

This function retrieves samples for specific times.

The most common use for this function is to request training data for training or testing AI - in particular those AIs that are used for event detection or categorisation, which will often want individual &#039;snapshots&#039; of particular moments.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Amount</title>
            <link>https://docs.optrix.com.au/samplestream:lc_amount</link>
            <description>Amount

This is a function of the LagCorrection class.

Description

This function is used to calculate a data-driven lag time based on a counter. 

Use this if the source of your lag is being counted or totalised instead of being measured as a rate. Note that in many industrial applications, field-based counters or totalisers are more accurate than performing calculations on rates.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Rate</title>
            <link>https://docs.optrix.com.au/samplestream:lc_rate</link>
            <description>Rate

This is a function of the LagCorrection class.

Description

This function is used to calculate a lagged time based on a rate. 

Use this if the source of your lag is counting the speed or rate that your target is moving, instead of being measured with a counter. Note that in many industrial applications, field-based counters or totalisers are more accurate that performing calculations than rates are.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>AddQuery</title>
            <link>https://docs.optrix.com.au/samplestream:lcq_addquery</link>
            <description>AddQuery

This is a function of the LagCorrectedQuery class.

Description

This adds an AQL query that should be run when you Execute the finished request.

Parameters
ParameterTypeMeaningquerystringThe AQL query to runlagfloatThe amount of lag to apply to this query
Returns</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>AmountLagQuery</title>
            <link>https://docs.optrix.com.au/samplestream:lcq_amountlagquery</link>
            <description>AmountLagQuery

This is a function of the LagCorrectedQuery class.

Description

This sets up the source of lag for the query. In this case, the query will usually return a single point, which is usually some form of counter or totaliser.

Parameters
ParameterTypeMeaning</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>LagCorrectedQuery Constructor</title>
            <link>https://docs.optrix.com.au/samplestream:lcq_constructor</link>
            <description>LagCorrectedQuery Constructor

This is a function of the LagCorrectedQuery class.

Description

This sets up an empty LagCorrectedQuery

Parameters
ParameterTypeMeaningserverardiapi.ServerA Server object from the ardiapi library for the server to query
Returns

An instance of the class</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Execute</title>
            <link>https://docs.optrix.com.au/samplestream:lcq_execute</link>
            <description>Execute

This is a function of the LagCorrectedQuery class.

Description

This function returns the complete, lag-corrected data query.

Parameters
ParameterTypeMeaningstartdatetimeThe starting time for the queryendstringThe end time for the querysamplesintThe number of samples for the query</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>AmountLagQuery</title>
            <link>https://docs.optrix.com.au/samplestream:lcq_ratelagquery</link>
            <description>AmountLagQuery

This is a function of the LagCorrectedQuery class.

Description

This sets up the source of lag for the query. In this case, the query will usually return a single point, which is usually some form of rate meter.

Parameters
ParameterTypeMeaningnamestring</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>NextSample</title>
            <link>https://docs.optrix.com.au/samplestream:nextsample</link>
            <description>NextSample

This is a function of the samplestream class.

Description

This gets the next sample from the SampleStream.

This includes both a time for the sample, and a Pandas Dataframe that includes each of the query points placed into evenly-spaced time buckets.

Parameters</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Number of Samples</title>
            <link>https://docs.optrix.com.au/samplestream:number_of_samples</link>
            <description>Number of Samples

The Number of Samples of a SampleStream controls the resolution of the data in each window.

This is usually determined by the speed of the data inside the events you&#039;re looking for. Take a look at some example timings for inspiration.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Override</title>
            <link>https://docs.optrix.com.au/samplestream:override</link>
            <description>Override

This is a function of the samplestream class.

Description

This function overrides the default metadata sent from the ARDI server about the query points.

The most common use for this function is to override the min and max values for analogue channels to fit the real working range rather than the display range.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>SampleStream Constructor</title>
            <link>https://docs.optrix.com.au/samplestream:samplestream_construct</link>
            <description>SampleStream Constructor

This is a function of the samplestream class.

Description

This sets up the basic parameters of a SampleStream object.

Parameters
ParameterTypeMeaningserverardiapi.ServerA Server object from the ardiapi library for the server to query</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>SampleStream Example</title>
            <link>https://docs.optrix.com.au/samplestream:see_an_example</link>
            <description>SampleStream Example

In this case, we&#039;re going to perform a search for the last time Turbine #1 from the Optrix Wind Farm Demo was offline for more than a second.

First, we import the libraries we need...


import ardiapi
import samplestream


Then we connect to our ARDI server</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Simple Lag</title>
            <link>https://docs.optrix.com.au/samplestream:simple_lag</link>
            <description>Simple Lag

The lag compensating classes (such as LagCorrectedQuery) are only designed to operate on simple forms of data-driven lag.

By &#039;simple&#039;, we mean that...

All Assets Share The Same Source of Lag

All of the assets in your query need to share the same source of lag. For example, conveyor systems will often have</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Lag Source</title>
            <link>https://docs.optrix.com.au/samplestream:source</link>
            <description>Lag Source

All lag happens for a reason. For data-driven lag, you compensate for lag using a data point. This data point is called the Source of Lag, since it measures the reason the lag exists (ie. the distance between sensors).

This data point will almost always be either a</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Span</title>
            <link>https://docs.optrix.com.au/samplestream:span</link>
            <description>Span

This is a function of the samplestream class.

Description

This function sets the minimum and maximum span of the search. The first time you call NextSample, your data will either begin at the minimum and move forwards, or begin at the maximum and move backwards, depending on your</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Introducing SampleStream</title>
            <link>https://docs.optrix.com.au/samplestream:ssintro</link>
            <description>Introducing SampleStream

How It Works

SampleStream lets you iterate over a query.

SampleStream takes an AQL request, a window size, a number of samples and a step size.

Every time you ask SampleStream for the next sample of data, it returns the data for window size seconds of data, broken into</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>SampleStream</title>
            <link>https://docs.optrix.com.au/samplestream:start</link>
            <description>SampleStream

SampleStream is a small Python library used to extract data from ARDI for time-series analysis. It&#039;s particularly useful for...

*  AI applications where you need to work on time-series data, 

*  Applications where you need to search for events across time-windows,</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Step Size</title>
            <link>https://docs.optrix.com.au/samplestream:step_size</link>
            <description>Step Size

A SampleStream iterates through your query time.

Every time you call NextSample, your stream moves a certain number of seconds forwards (with a positive step size) or backwards (with a negative step size) in time.

A positive step size results in a sample stream that begins at the start time and continues until you hit the end time, or stop calling</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Stream Span</title>
            <link>https://docs.optrix.com.au/samplestream:stream_span</link>
            <description>Stream Span

Even if you&#039;re using your SampleStream to search a period of time, you need to set limits.

The span of your SampleStream is the minimum and maximum time you&#039;d like to search. 

When you&#039;re looking for the signature of a fault in high-resolution data, your time span is often quite small and fixed - such as scanning only the last hour.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Class Documentation</title>
            <link>https://docs.optrix.com.au/samplestream:view_the_documentation</link>
            <description>Class Documentation

sample 

samplestream 


LagCorrection 

LagCorrectedQuery</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
        <item>
            <title>Window Size</title>
            <link>https://docs.optrix.com.au/samplestream:window_size</link>
            <description>Window Size

The Window Size of a SampleStream is the amount of time each returned sample should cover.

This is usually determined by the speed of the event you&#039;re looking for. Take a look at some example timings for inspiration.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Thu, 18 Dec 2025 22:50:17 +0000</pubDate>
        </item>
    </channel>
</rss>
