Differences

This shows you the differences between two versions of the page.

Link to this comparison view

samplestream:gathersamples [2024/04/18 01:35] – created optrixsamplestream:gathersamples [2025/12/18 22:50] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====GatherSamples====
  
 +This is a function of the [[class_samplestream|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 'snapshots' of particular moments.
 +
 +===Parameters===
 +
 +^Parameter^Type^Meaning^
 +|times|list of datetimes|The UTC dates and times for each sample|
 +
 +===Returns===
 +
 +A list of samples - one for each requested time-frame.
 +
 +===Example===
 +
 +<code python>
 +    srv = ardiapi.Server("demo.optrix.com.au/s/ex")
 +    smp = samplestream.samplestream(srv,"'Wind Turbine #1' ASSET 'Power' PROPERTY",30,30,15)
 +   
 +    datesneeded = [ datetime.datetime.now() - datetime.timedelta(seconds=200) ]
 +    samples = smp.GatherSamples(datesneeded)
 + </code>