diff --git a/Bike_logger/Data_analysis/analyse_ebike_blackbox_data.ipynb b/Bike_logger/Data_analysis/analyse_ebike_blackbox_data.ipynb index 3327719..8a5c552 100644 --- a/Bike_logger/Data_analysis/analyse_ebike_blackbox_data.ipynb +++ b/Bike_logger/Data_analysis/analyse_ebike_blackbox_data.ipynb @@ -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", @@ -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", @@ -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", @@ -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" ] }, {