{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_kg_hide-output":true,"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"This notebook implements corrections for the change in location of the base stations due to tectonic movement.","metadata":{}},{"cell_type":"markdown","source":"\n\nSLAC for Bay Area trips.\n\n|         Antenna Reference Point(ARP): SLAC_BARD_CN2002 CORS ARP             |\n|         -------------------------------------------------------             |\n|                             PID = DN7479               \n| ITRF2014 VELOCITY                                                           |\n| Computed in Jun 2019 using data through gpswk 1933.                         |\n|     VX =  -0.0241 m/yr      northward =   0.0164 m/yr                       |\n|     VY =   0.0261 m/yr      eastward  =  -0.0343 m/yr                       |\n|     VZ =   0.0136 m/yr      upward    =   0.0009 m/yr                       |\n\n\n","metadata":{}},{"cell_type":"markdown","source":"VDCY for Los Angeles trips.\n\n|         Antenna Reference Point(ARP): VDCY_SCGN_CS2000 CORS ARP             |\n|         -------------------------------------------------------             |\n|                             PID = DJ7932                                    |\n| ITRF2014 VELOCITY                                                           |\n| Computed in Jun 2019 using data through gpswk 1933.                         |\n|     VX =  -0.0298 m/yr      northward =   0.0131 m/yr                       |\n|     VY =   0.0235 m/yr      eastward  =  -0.0374 m/yr                       |\n|     VZ =   0.0114 m/yr      upward    =   0.0009 m/yr                       |\n","metadata":{}},{"cell_type":"markdown","source":"The RTKLIB calculations underlying my submission used a single set of base station positions computed to be correct midway through the time period over which the data were being collected, VDCY being selected for Los Angeles trips and SLAC for Bay Area trips. The distance through which I need to shift the prediction is proportional to the (signed) number of days before or after the reference date that the run takes place (N), with the annual position shift being multiplied by (N/365.25) and assigned the appropriate sign depending on the direction of the time shift.","metadata":{}},{"cell_type":"code","source":"sub = pd.read_csv('../input/decimeter-challenge-2-submissions/2508_v3_submission.csv')\nsub = sub.sort_values(['tripId','UnixTimeMillis'])\nsub1 = pd.read_csv('../input/decimeter-challenge-2-submissions/2682_tectonic.csv')\nsub1 = sub1.sort_values(['tripId','UnixTimeMillis'])","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"C = 1.00","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub['LatitudeDegrees'] = sub['LatitudeDegrees'] + C*sub1['lat_cor']\nsub['LongitudeDegrees'] = sub['LongitudeDegrees'] + C*sub1['lng_cor']","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"sub.to_csv('submission.csv', index=False)\nsub.head(10)","metadata":{},"execution_count":null,"outputs":[]}]}