Skip to content

Commit

Permalink
Fix different repos for Ahmet and Rob
Browse files Browse the repository at this point in the history
  • Loading branch information
RobRomijnders committed Mar 26, 2017
1 parent 4fd3061 commit 4707f11
Show file tree
Hide file tree
Showing 11 changed files with 103,309 additions and 52 deletions.
112 changes: 60 additions & 52 deletions notebooks/load_gps_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"We will be using the following packages for this notebook. \n",
"You can install them with 'conda install <package>' or 'pip install <package>'"
]
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 1,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand All @@ -32,7 +37,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Depending on the device, GPS trajectories can also contain measurements of velocity and acceleration. This dataset does not contain such information, but it can be calculated from XY-coordinates and timestamps of two points. \n",
"\n",
Expand All @@ -54,9 +62,11 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 2,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -91,9 +101,11 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 3,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -150,73 +162,55 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"MAIN_FOLDER = '../../GPSML/Data/'\n",
"if not os.path.exists(MAIN_FOLDER):\n",
" MAIN_FOLDER = '../GPSML/Data/'\n",
" assert os.path.exists(MAIN_FOLDER), 'Expected GPSML data in %s'%(MAIN_FOLDER)\n",
" \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"000 171\n",
"001 71\n",
"002 175\n",
"003 322\n",
"004 395\n",
"005 86\n",
"006 28\n",
"007 54\n",
"008 34\n",
"009 49\n",
"010 161\n",
"011 201\n",
"012 77\n",
"013 144\n",
"014 279\n",
"015 67\n",
"016 51\n",
"017 391\n",
"018 50\n",
"019 84\n",
"020 151\n",
"021 8\n",
"022 146\n",
"023 34\n",
"024 101\n",
"025 757\n",
"026 43\n",
"027 5\n",
"028 64\n",
"029 45\n",
"030 296\n",
"031 6\n",
"032 16\n",
"033 13\n",
"034 198\n",
"035 74\n",
"036 72\n",
"037 148\n",
"038 110\n"
"Subfolder|num trajectories|progress\n",
" 049 | 1 |(progress 0 of 182)\n",
" 046 | 31 |(progress 1 of 182)\n"
]
}
],
"source": [
"labels_file = 'labels.txt'\n",
"MAIN_FOLDER = '../../GPSML/Data/'\n",
"TRAJ_FOLDER = 'Trajectory/'\n",
"directories = os.listdir(MAIN_FOLDER)\n",
"OUTPUT_FOLDER = '../processed_data/'\n",
"\n",
"if not os.path.exists(OUTPUT_FOLDER):\n",
" os.makedirs(OUTPUT_FOLDER)\n",
"\n",
"for subfolder in directories:\n",
"num_direc = len(directories)\n",
"print('Subfolder|num trajectories|progress')\n",
"for num,subfolder in enumerate(directories):\n",
" list_df_traj = []\n",
" subfolder_ = MAIN_FOLDER + subfolder + '/'\n",
" traj_folder = MAIN_FOLDER + subfolder + '/' + TRAJ_FOLDER\n",
" traj_files = os.listdir(traj_folder)\n",
" print(subfolder, len(traj_files))\n",
" print('%5s |%5s |(progress %3i of %3i)'%(subfolder, len(traj_files), num, num_direc))\n",
" for traj_file in traj_files:\n",
" trajectory_id = traj_file.split('.')[0]\n",
" filename = traj_folder + traj_file\n",
Expand Down Expand Up @@ -247,7 +241,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
Expand All @@ -259,6 +255,18 @@
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 4707f11

Please sign in to comment.