Skip to content

Commit

Permalink
prep for presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MedadRufus committed Jun 25, 2021
1 parent 25a270b commit bc63266
Showing 1 changed file with 62 additions and 18 deletions.
80 changes: 62 additions & 18 deletions Bike_logger/Data_analysis/analyse_ebike_blackbox_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@
" y=df['Latitude (°)'],\n",
" z=df['Barometric Altitude Filtered (m)'],\n",
" marker=dict(\n",
" size=4,\n",
" size=2,\n",
" color=df['Power (mW)'],\n",
" colorscale='Viridis',\n",
" showscale=True,\n",
Expand All @@ -839,7 +839,7 @@
" \n",
"\n",
" fig.update_layout(\n",
" width=800,\n",
" #width=800,\n",
" #height=700,\n",
" #autosize=False,\n",
" scene=dict(\n",
Expand Down Expand Up @@ -1317,21 +1317,56 @@
" \"\"\"\n",
" \n",
" df_gps = df_gps.sort_values(by='Datetime (UTC)')\n",
" # Display GPS positions\n",
" fig = px.line_mapbox(df_gps,\n",
" lat=df_gps[lat_feature],\n",
" lon=df_gps[long_feature],\n",
" #color='Test Number',#'Test-Train',#\"GPS Horizontal Speed (km/h)\",#\"trip\",#\"slope\",#\"LOCATION Altitude ( m)\",,#\"Speed(km/h)\", # \"abs_acceleration\" or \"gps_acceleration\" or \"power\"\n",
" zoom=14,\n",
" hover_data=[#'Datetime (UTC)',\n",
" 'GPS altitude (m)',\n",
" #\"sats\",\n",
" 'heading (radians)'\n",
"# # Display GPS positions\n",
"# fig = px.scatter_mapbox(df_gps,\n",
"# lat=df_gps[lat_feature],\n",
"# lon=df_gps[long_feature],\n",
"# color='Power (mW)',#'Test Number',#'Test-Train',#\"GPS Horizontal Speed (km/h)\",#\"trip\",#\"slope\",#\"LOCATION Altitude ( m)\",,#\"Speed(km/h)\", # \"abs_acceleration\" or \"gps_acceleration\" or \"power\"\n",
"# zoom=14,\n",
"# hover_data=[#'Datetime (UTC)',\n",
"# 'GPS altitude (m)',\n",
"# #\"sats\",\n",
"# 'heading (radians)'\n",
" \n",
" ],\n",
" title=\"Training and Testing Routes in dataset\",\n",
" #size=\"LOCATION Accuracy ( m)\"\n",
" )\n",
"# ],\n",
"# #title=\"Training and Testing Routes in dataset\",\n",
"# #size=\"size\"\n",
" \n",
" \n",
"# #mode='markers',\n",
"# marker=dict(\n",
"# colorscale=\"Viridis\",\n",
"# size=12,\n",
"# color='Power (mW)',\n",
"# #symbol='marker' # Does not seem compatible with color\n",
"# ),\n",
"# )\n",
" \n",
" \n",
" # Create figure\n",
" fig = go.Figure()\n",
"\n",
" ## Add trace \n",
"\n",
"\n",
" fig.add_trace(\n",
" go.Scattermapbox(\n",
" lat=df_gps[lat_feature],\n",
" lon=df_gps[long_feature],\n",
" mode='markers',\n",
"\n",
" marker=dict(\n",
" colorscale=\"Viridis\",\n",
" size=3,\n",
" color=df_gps['Power (mW)'],\n",
" #symbol='marker' # Does not seem compatible with color\n",
" ),\n",
" )\n",
" )\n",
"\n",
" ## General layout\n",
"\n",
"\n",
"\n",
"\n",
"\n",
Expand Down Expand Up @@ -1383,8 +1418,17 @@
"metadata": {},
"outputs": [],
"source": [
"display_gps_positions(raw_dfs[1]) # df_gps is index 1 TODO: don't use indexes. use labels for readiblity\n",
"# display_gps_positions(df_ml.sample(100000)) # df_gps is index 1 TODO: don't use indexes. use labels for readiblity"
"#display_gps_positions(raw_dfs[1]) # df_gps is index 1 TODO: don't use indexes. use labels for readiblity\n",
"display_gps_positions(df_ml.sample(n=100000)) # df_gps is index 1 TODO: don't use indexes. use labels for readiblity"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"df_ml.loc[:,'size']=0.0005"
]
},
{
Expand Down

0 comments on commit bc63266

Please sign in to comment.