From e6857fe6230f561c6310a3b52a71c96d8f6d4aa1 Mon Sep 17 00:00:00 2001 From: "J. Ritchie Carroll" Date: Tue, 30 Jul 2024 20:13:16 -0500 Subject: [PATCH] Updated GroupedDataSubscriber comments --- examples/groupeddatasubscribe/main.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/groupeddatasubscribe/main.py b/examples/groupeddatasubscribe/main.py index 46cd0f4..94e413c 100644 --- a/examples/groupeddatasubscribe/main.py +++ b/examples/groupeddatasubscribe/main.py @@ -53,11 +53,11 @@ class GroupedDataSubscriber(Subscriber): If incoming frame rate is higher than the samples per second, or timestamp alignment does not accurately coinside with the subsecond distribution, some data will be downsampled. Downsampled data count is tracked and reported to through the - downsampledcount property. + `downsampledcount` property. Only a single one-second data buffer will be published at a time. If data cannot be processed within the one-second - window, a warning message will be displayed and the data will be skipped. The number of skipped data sets is tracked - and reported through the processmissedcount property. + window, a warning message will be displayed and any new data will be skipped. The number of skipped data sets is tracked + and reported through the `processmissedcount` property. This example depends on a semi-accurate system clock to group data by timestamp. If the system clock is not accurate, data may not be grouped as expected. @@ -346,7 +346,7 @@ def process_data(subscriber: GroupedDataSubscriber, timestamp: np.uint64, databu The function will only be called once per second with a buffer of grouped data for the second. If the function processing time exceeds the one second window, a warning message will be displayed and new data will be skipped. The number of skipped data sets is tracked and reported through the - processmissed count property. + `processmissedcount` property. Parameters: timestamp: The timestamp, at top of second, for the grouped data @@ -373,13 +373,15 @@ def process_data(subscriber: GroupedDataSubscriber, timestamp: np.uint64, databu # 2024-07-30 17:55:29.366 # At this point, all measurements are aligned to the same subsecond timestamp + + # If you know which measurement you are looking for, you can use the following loopup: + # measurement = measurements.get(my_signalid) + + # Loop through each measurement in the subsecond time-aligned group for measurement in measurements.values(): # To use UUID values, you can use the following loop instead: # for signalid, measurement in measurements.items(): - # If you know which measurement you are looking for, you can use the following loopup: - # measurement = measurements.get(my_signalid) - # Note: # measurement.value is a numpy float64 # measurement.timestamp is a numpy uint64 (in ticks, i.e., 100-nanosecond intervals)