Self-contained example code and data to simulate a live feed of heart rate data being entered.
csv
- the data used to run this examplerunTickingHeartRateReplay.py
- python script to demonstrate fit data inside deephaven*.png
- images used in this help
-
Copy the
csv
directory into the data folder underneath your Docker starting location. See our Quick start for detailed instructions. -
Run the
runTickingHeartRateReplay.py
file in a Deephaven console. -
The table
heartRateData
should appear. See: Note regarding ticking.
The table should continue to tick new rows as each .csv
file is processed.
-
Click the Table Options menu in the
heartRateData
tab. -
Select Chart Builder.
-
Select defaults:
Line
,X-Axis=Timestamp
,Series=Heart Rate
-
Select Create. (You may need to scroll to see the button.)
-
A chart should appear:
The chart should also continue to tick, adding more data points to the graph over time and dynamically resizing.
The chart will stop ticking when either no more data is added, or the script exit criteria is reached.
The ticking functionality requires threading to be in place as implemented in the code example.
Without threading, ticking will not happen, and the entire table will be processed in a single batch at the end.
More background detail is supplied here in our guide, Write data to a real-time table
Provided there is a way to stream .csv
files into the Docker container from the original source, it is possible to watch heart rate monitor data in real-time (however, there may be delays depending on the speed of data transfer protocols).
Since there is a diverse array of devices and communication strategies between those devices, we do not recommended a specific setup here on how to achieve this goal.
For this exercise, the following were used:
- a Scosche Rhythm24 heart rate monitor.
- an Android phone with USB tethering for file sharing (alternatively, syncing software could be used).
- the Strava android app for a clear screen reading of approximately once per-second heart rate readouts.
- the Tasker android app to screen scrape the screen and write a new
.csv
file approximately once per second.
This data was contributed to the public domain by the author. It is provided here for demonstrative purposes without any warranty for fitness of purpose or usability.