StreamData¶
Play back a data set in real time or at a desired rate.
This node requires as input a packet that holds the entire recording to play back, for example the output of one of the data import nodes. A common setup is an import node followed by a Stream Data node, followed by some processing, visualization, or network streaming. You can play back either based on wall-clock time, optionally modified by a speedup factor, or you can use an abstract clock that advances by a deterministic amount from one tick to the next. The latter is more useful when you are debugging your code, e.g., when you need to be able to exactly recreate a situation in which an error occurred previously. This node is also able to simulate a variety of issues that occur in real-world data sources, such as jitter in the emitted chunk sizes and empty packets -- these special features are mainly useful for testing and debugging your own nodes. Version 1.3.0
Ports/Properties¶
data¶
Data to stream.
- verbose name: Data
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: INOUT
data_range_to_stream¶
How the range of data to be streamed, based on the first and last timestamps, is determined in cases where the packet contains multiple streams. Since the first and last timestamps in all streams many not be exactly the same, one must decide which stream's timestamps to choose as the start and end times between which data from all streams will be streamed. This choice depends on your data and desired streamed output (including downstream processing). Options:
- all-signal-data: the first and last timestamps of all signal streams (i.e., not any event streams) will be used; all data in all signal streams will be streamed, but some streams may have no data at the beginning or end; marker events outside those timestamps will not be streamed.
- signal-data-and-markers: the first and last timestamps across all streams, including event streams, will be used; choose this option if you want to ensure that event markers at or very near the beginning and end of the data are streamed, or if you used the TrimMarkerSegment node before this one to trim the data between two markers and want to ensure those same bookending markers get streamed.
- overlapping-signal-data-only: choose the first and last timestamps that are common to all signal data streams; this ensures that all streams have data right from the start, though some streams may be trimmed depending on whether they all started and ended at the same time; the very first and last event markers might not be streamed depending on how they are aligned with the first and last timestamps of the signal streams.
- legacy-warn: same as overlapping-signal-data-only, but a warning is emitted to explicitly select one of the other options as this legacy option will be removed in a future release.
- verbose name: Data Range To Stream
- default value: legacy-warn
- port type: EnumPort
- value type: str (can be None)
timing¶
Timing mode. The wallclock mode means that playback is based on actual elapsed time (i.e., this means playback speed is real time), and the deterministic mode means that an abstract clock is used that advances by a mathematically determined amount on each tick (this would generally not be real time). The first mode is what is used to simulate a live device, and the second mode can be used for debugging your code (because on each run, exactly the same sequence of data is emitted by the node, which allows you to replicate a problem exactly and drill into it), and/or to build pipelines that process data in a streaming fashion, but do so at faster-than-real-time rates.
- verbose name: Timing Mode
- default value: wallclock
- port type: EnumPort
- value type: str (can be None)
looping¶
Looping playback. Whether to stream the data in a loop.
- verbose name: Looping
- default value: True
- port type: BoolPort
- value type: bool (can be None)
speedup¶
Speedup factor for wallclock mode. This is the speedup, relative to the actually elapsed time, at which the data is played back (e.g., 2 means that the data is played back at 2x real time). This setting is ignored in deterministic mode.
- verbose name: Speedup Factor (Wallclock Mode)
- default value: 1.0
- port type: FloatPort
- value type: float (can be None)
update_interval¶
Average chunk length per tick for deterministic mode, in seconds. The length of each individual chunk is drawn from a Gaussian distribution with this value as the mean and a standard deviation based on the jitter percentage. This setting is ignored in wallclock mode.
- verbose name: Chunk Length Mean (Deterministic Mode)
- default value: 0.04
- port type: FloatPort
- value type: float (can be None)
jitter_percent¶
Pseudo-random jitter applied to the chunk length in deterministic mode, in percent. On each tick a chunk is emitted whose length is drawn pseudo-randomly from a Gaussian distribution with a mean value and a standard deviation that is a percentage of that mean. For instance, if the mean chunk length is set to 0.15 (seconds), and this value is set to 20 (percent), then the chunks are 0.15 +/- 0.03 seconds long. The purpose of this is to simulate natural variation that could occur in a real-world data source to reveal potential issues in downstream nodes.
- verbose name: Chunk Length Std (Deterministic Mode)
- default value: 5
- port type: FloatPort
- value type: float (can be None)
randseed¶
Random seed for deterministic mode. This value allows to change the series of chunk lengths that is generated by the random number generator.
- verbose name: Random Seed
- default value: 34535
- port type: IntPort
- value type: int (can be None)
hitch_probability¶
Probability of simulated hitches, in Percent. The node generates an empty packet with this probability. This can be used to test whether subsequent nodes are robust to empty packets.
- verbose name: Hitch Probability
- default value: 0.0
- port type: FloatPort
- value type: float (can be None)
timestamp_jitter¶
Pseudo-random jitter applied to the time stamps. This is the standard deviation of a normal distribution, in seconds.
- verbose name: Timestamp Jitter
- default value: 0.0
- port type: FloatPort
- value type: float (can be None)
start_pos¶
Starting position for playback. This is the time offset, in seconds from the beginning of the data, where playback should start.
- verbose name: Start Pos
- default value: 0.0
- port type: FloatPort
- value type: float (can be None)
log_progress¶
Log the progress in percent.
- verbose name: Log Progress
- default value: False
- port type: BoolPort
- value type: bool (can be None)
data_dtype¶
Optionally force override the output data type.
- verbose name: Data Dtype
- default value: float64
- port type: EnumPort
- value type: str (can be None)
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)