Created
March 4, 2020 20:17
-
-
Save randyzwitch/db0b7b6cb6dd7b4afa2358f19e18686a to your computer and use it in GitHub Desktop.
Get Telemetry Data query example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_telemetry_data(sessionuid, lapstarttime, lapendtime, playercarindex, metric): | |
conn = pymapd.connect(host = host, user = user, password = password, dbname = dbname, port = port) | |
## get telemetry data | |
## by specifying the timestamps and sessionuid, it implies a single track | |
tele = f"""select | |
packettime, | |
max({metric}) as {metric} | |
from gtc_cartelemetry_v2 | |
where sessionuid = '{sessionuid}' and | |
packettime between '{lapstarttime}' and '{lapendtime}' and | |
playercarindex = {playercarindex} | |
group by 1 | |
order by 1 | |
""" | |
telemetry_ref = pd.read_sql(tele, conn) | |
return telemetry_ref |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment