Differences
This shows you the differences between two versions of the page.
| samplestream:gathersamples [2024/04/18 01:35] – created optrix | samplestream: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, | ||
| + | |||
| + | ===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(" | ||
| + | smp = samplestream.samplestream(srv,"' | ||
| + | |||
| + | datesneeded = [ datetime.datetime.now() - datetime.timedelta(seconds=200) ] | ||
| + | samples = smp.GatherSamples(datesneeded) | ||
| + | </ | ||