diff --git a/pymeos_examples/PyMEOS_Examples/AIS.ipynb b/pymeos_examples/PyMEOS_Examples/AIS.ipynb
index 8ba1b89b..619bdbd8 100644
--- a/pymeos_examples/PyMEOS_Examples/AIS.ipynb
+++ b/pymeos_examples/PyMEOS_Examples/AIS.ipynb
@@ -2,6 +2,9 @@
"cells": [
{
"cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
"source": [
"# AIS Example\n",
"\n",
@@ -26,14 +29,18 @@
"[https://web.ais.dk/aisdata/aisdk-2023-08-01.zip](https://web.ais.dk/aisdata/aisdk-2023-08-01.zip)\n",
"\n",
"Store the file in the [data](./data) directory. There is no need to decompress it, since we will use `pandas` to read the file and it supports reading compressed files."
- ],
- "metadata": {
- "collapsed": false
- }
+ ]
},
{
"cell_type": "code",
"execution_count": 1,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T18:53:15.803897500Z",
+ "start_time": "2024-02-03T18:53:14.766157300Z"
+ },
+ "collapsed": false
+ },
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
@@ -45,51 +52,128 @@
"tqdm.pandas()\n",
"\n",
"pymeos_initialize()"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-02-03T18:53:15.803897500Z",
- "start_time": "2024-02-03T18:53:14.766157300Z"
- }
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
"source": [
"## Reading from File ([MEOS Example](https://libmeos.org/tutorialprograms/meos_read_ais/))\n",
"In this section, AIS data is read from a CSV file. We then use the read information to recreate the trajectories of the ships.\n",
"\n"
- ],
- "metadata": {
- "collapsed": false
- }
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "First, let's read the CSV file using pandas. We will read only the columns we're interested in, and remove the observations that are either erroneous or not in Denmark."
- ],
"metadata": {
"collapsed": false
- }
+ },
+ "source": [
+ "First, let's read the CSV file using pandas. We will read only the columns we're interested in, and remove the observations that are either erroneous or not in Denmark."
+ ]
},
{
"cell_type": "code",
"execution_count": 2,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T18:53:35.800662100Z",
+ "start_time": "2024-02-03T18:53:17.511652900Z"
+ },
+ "collapsed": false
+ },
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "CPU times: user 17.3 s, sys: 861 ms, total: 18.2 s\n",
- "Wall time: 18.3 s\n"
+ "CPU times: user 27.5 s, sys: 954 ms, total: 28.5 s\n",
+ "Wall time: 28.5 s\n"
]
},
{
"data": {
- "text/plain": " t mmsi lat lon sog\n0 2023-10-19 219029699 57.137907 9.127860 0.0\n1 2023-10-19 219005827 56.803713 9.020183 0.0\n2 2023-10-19 219006283 56.764315 8.863167 0.0\n3 2023-10-19 220466000 56.970548 9.257460 0.1\n4 2023-10-19 210731000 54.220680 11.386588 7.5",
- "text/html": "
\n\n
\n \n \n | \n t | \n mmsi | \n lat | \n lon | \n sog | \n
\n \n \n \n 0 | \n 2023-10-19 | \n 219029699 | \n 57.137907 | \n 9.127860 | \n 0.0 | \n
\n \n 1 | \n 2023-10-19 | \n 219005827 | \n 56.803713 | \n 9.020183 | \n 0.0 | \n
\n \n 2 | \n 2023-10-19 | \n 219006283 | \n 56.764315 | \n 8.863167 | \n 0.0 | \n
\n \n 3 | \n 2023-10-19 | \n 220466000 | \n 56.970548 | \n 9.257460 | \n 0.1 | \n
\n \n 4 | \n 2023-10-19 | \n 210731000 | \n 54.220680 | \n 11.386588 | \n 7.5 | \n
\n \n
\n
"
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " t | \n",
+ " mmsi | \n",
+ " lat | \n",
+ " lon | \n",
+ " sog | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 2023-08-01 | \n",
+ " 219020187 | \n",
+ " 56.795448 | \n",
+ " 8.864770 | \n",
+ " 0.0 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 2023-08-01 | \n",
+ " 219000873 | \n",
+ " 56.990862 | \n",
+ " 10.304587 | \n",
+ " 0.0 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2023-08-01 | \n",
+ " 219008746 | \n",
+ " 56.609180 | \n",
+ " 10.300487 | \n",
+ " 0.0 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 2023-08-01 | \n",
+ " 219005496 | \n",
+ " 57.754300 | \n",
+ " 10.151212 | \n",
+ " 0.2 | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " 2023-08-01 | \n",
+ " 219014072 | \n",
+ " 54.918928 | \n",
+ " 9.597852 | \n",
+ " 0.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " t mmsi lat lon sog\n",
+ "0 2023-08-01 219020187 56.795448 8.864770 0.0\n",
+ "1 2023-08-01 219000873 56.990862 10.304587 0.0\n",
+ "2 2023-08-01 219008746 56.609180 10.300487 0.0\n",
+ "4 2023-08-01 219005496 57.754300 10.151212 0.2\n",
+ "5 2023-08-01 219014072 54.918928 9.597852 0.0"
+ ]
},
"execution_count": 2,
"metadata": {},
@@ -99,7 +183,7 @@
"source": [
"%%time\n",
"ais = pd.read_csv(\n",
- " \"./data/aisdk-2023-10-19.zip\",\n",
+ " \"./data/aisdk-2023-08-01.zip\",\n",
" usecols=[\"# Timestamp\", \"MMSI\", \"Latitude\", \"Longitude\", \"SOG\"],\n",
")\n",
"ais.columns = [\"t\", \"mmsi\", \"lat\", \"lon\", \"sog\"]\n",
@@ -112,48 +196,52 @@
"ais = ais[(ais[\"sog\"] >= 0) & (ais[\"sog\"] <= 1022)]\n",
"ais.dropna()\n",
"ais.head()"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-02-03T18:53:35.800662100Z",
- "start_time": "2024-02-03T18:53:17.511652900Z"
- }
- }
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "Now, we will create the PyMEOS object representing the position and the SOG."
- ],
"metadata": {
"collapsed": false
- }
+ },
+ "source": [
+ "Now, we will create the PyMEOS object representing the position and the SOG."
+ ]
},
{
"cell_type": "code",
"execution_count": 3,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T18:59:47.396491100Z",
+ "start_time": "2024-02-03T18:53:35.791660600Z"
+ },
+ "collapsed": false
+ },
"outputs": [
{
"data": {
- "text/plain": " 0%| | 0/8933109 [00:00, ?it/s]",
"application/vnd.jupyter.widget-view+json": {
+ "model_id": "b8ed58922fd5463d943d43d2112bfa8f",
"version_major": 2,
- "version_minor": 0,
- "model_id": "663c5d7a4d3947dea8f37761252906b5"
- }
+ "version_minor": 0
+ },
+ "text/plain": [
+ " 0%| | 0/11046773 [00:00, ?it/s]"
+ ]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
- "text/plain": " 0%| | 0/8933109 [00:00, ?it/s]",
"application/vnd.jupyter.widget-view+json": {
+ "model_id": "59bcccc8c6a04b2ba1327c41851c17ca",
"version_major": 2,
- "version_minor": 0,
- "model_id": "4e595601ce0d48eeb2c3adcd81e1556f"
- }
+ "version_minor": 0
+ },
+ "text/plain": [
+ " 0%| | 0/11046773 [00:00, ?it/s]"
+ ]
},
"metadata": {},
"output_type": "display_data"
@@ -167,23 +255,101 @@
"ais[\"sog\"] = ais.progress_apply(\n",
" lambda row: TFloatInst(value=row[\"sog\"], timestamp=row[\"t\"]), axis=1\n",
")"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-02-03T18:59:47.396491100Z",
- "start_time": "2024-02-03T18:53:35.791660600Z"
- }
- }
+ ]
},
{
"cell_type": "code",
"execution_count": 4,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T18:59:47.787830600Z",
+ "start_time": "2024-02-03T18:59:47.395489200Z"
+ },
+ "collapsed": false
+ },
"outputs": [
{
"data": {
- "text/plain": " t mmsi sog \\\n0 2023-10-19 219029699 0@2023-10-19 00:00:00+02 \n1 2023-10-19 219005827 0@2023-10-19 00:00:00+02 \n2 2023-10-19 219006283 0@2023-10-19 00:00:00+02 \n3 2023-10-19 220466000 0.1@2023-10-19 00:00:00+02 \n4 2023-10-19 210731000 7.5@2023-10-19 00:00:00+02 \n\n instant \n0 POINT(9.12786 57.137907)@2023-10-19 00:00:00+02 \n1 POINT(9.020183 56.803713)@2023-10-19 00:00:00+02 \n2 POINT(8.863167 56.764315)@2023-10-19 00:00:00+02 \n3 POINT(9.25746 56.970548)@2023-10-19 00:00:00+02 \n4 POINT(11.386588 54.22068)@2023-10-19 00:00:00+02 ",
- "text/html": "\n\n
\n \n \n | \n t | \n mmsi | \n sog | \n instant | \n
\n \n \n \n 0 | \n 2023-10-19 | \n 219029699 | \n 0@2023-10-19 00:00:00+02 | \n POINT(9.12786 57.137907)@2023-10-19 00:00:00+02 | \n
\n \n 1 | \n 2023-10-19 | \n 219005827 | \n 0@2023-10-19 00:00:00+02 | \n POINT(9.020183 56.803713)@2023-10-19 00:00:00+02 | \n
\n \n 2 | \n 2023-10-19 | \n 219006283 | \n 0@2023-10-19 00:00:00+02 | \n POINT(8.863167 56.764315)@2023-10-19 00:00:00+02 | \n
\n \n 3 | \n 2023-10-19 | \n 220466000 | \n 0.1@2023-10-19 00:00:00+02 | \n POINT(9.25746 56.970548)@2023-10-19 00:00:00+02 | \n
\n \n 4 | \n 2023-10-19 | \n 210731000 | \n 7.5@2023-10-19 00:00:00+02 | \n POINT(11.386588 54.22068)@2023-10-19 00:00:00+02 | \n
\n \n
\n
"
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " t | \n",
+ " mmsi | \n",
+ " sog | \n",
+ " instant | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 2023-08-01 | \n",
+ " 219020187 | \n",
+ " 0@2023-08-01 00:00:00+05 | \n",
+ " POINT(8.86477 56.795448)@2023-08-01 00:00:00+05 | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 2023-08-01 | \n",
+ " 219000873 | \n",
+ " 0@2023-08-01 00:00:00+05 | \n",
+ " POINT(10.304587 56.990862)@2023-08-01 00:00:00+05 | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 2023-08-01 | \n",
+ " 219008746 | \n",
+ " 0@2023-08-01 00:00:00+05 | \n",
+ " POINT(10.300487 56.60918)@2023-08-01 00:00:00+05 | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 2023-08-01 | \n",
+ " 219005496 | \n",
+ " 0.2@2023-08-01 00:00:00+05 | \n",
+ " POINT(10.151212 57.7543)@2023-08-01 00:00:00+05 | \n",
+ "
\n",
+ " \n",
+ " 5 | \n",
+ " 2023-08-01 | \n",
+ " 219014072 | \n",
+ " 0@2023-08-01 00:00:00+05 | \n",
+ " POINT(9.597852 54.918928)@2023-08-01 00:00:00+05 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " t mmsi sog \\\n",
+ "0 2023-08-01 219020187 0@2023-08-01 00:00:00+05 \n",
+ "1 2023-08-01 219000873 0@2023-08-01 00:00:00+05 \n",
+ "2 2023-08-01 219008746 0@2023-08-01 00:00:00+05 \n",
+ "4 2023-08-01 219005496 0.2@2023-08-01 00:00:00+05 \n",
+ "5 2023-08-01 219014072 0@2023-08-01 00:00:00+05 \n",
+ "\n",
+ " instant \n",
+ "0 POINT(8.86477 56.795448)@2023-08-01 00:00:00+05 \n",
+ "1 POINT(10.304587 56.990862)@2023-08-01 00:00:00+05 \n",
+ "2 POINT(10.300487 56.60918)@2023-08-01 00:00:00+05 \n",
+ "4 POINT(10.151212 57.7543)@2023-08-01 00:00:00+05 \n",
+ "5 POINT(9.597852 54.918928)@2023-08-01 00:00:00+05 "
+ ]
},
"execution_count": 4,
"metadata": {},
@@ -193,42 +359,122 @@
"source": [
"ais.drop([\"lat\", \"lon\"], axis=1, inplace=True)\n",
"ais.head()"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-02-03T18:59:47.787830600Z",
- "start_time": "2024-02-03T18:59:47.395489200Z"
- }
- }
+ ]
},
{
"cell_type": "markdown",
+ "metadata": {
+ "collapsed": false
+ },
"source": [
"## Assembling Trips ([MEOS Example](https://libmeos.org/tutorialprograms/meos_assemble_ais/))\n",
"\n",
"Now, we will create the trajectory (TGeogPointSeq) and the SOG evolution (TFloatSeq) for every ship (identified by the mmsi) using the instants we have created."
- ],
- "metadata": {
- "collapsed": false
- }
+ ]
},
{
"cell_type": "code",
"execution_count": 5,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T19:00:18.427946600Z",
+ "start_time": "2024-02-03T18:59:47.786832800Z"
+ },
+ "collapsed": false
+ },
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "CPU times: user 30.2 s, sys: 333 ms, total: 30.6 s\n",
- "Wall time: 30.6 s\n"
+ "CPU times: user 34.7 s, sys: 444 ms, total: 35.1 s\n",
+ "Wall time: 35.2 s\n"
]
},
{
"data": {
- "text/plain": " trajectory \\\nmmsi \n2190045 [POINT(8.44805 55.464272)@2023-10-19 00:00:10+... \n9109416 [POINT(9.785182 54.909655)@2023-10-19 05:21:13... \n111219504 [POINT(9.838743 57.103408)@2023-10-19 07:32:04... \n111219508 [POINT(12.121327 55.591252)@2023-10-19 11:52:4... \n111219512 [POINT(9.286713 55.220503)@2023-10-19 09:44:07... \n\n sog distance \nmmsi \n2190045 [0@2023-10-19 00:00:10+02, 0.1@2023-10-19 00:0... 4196.237335 \n9109416 [1.4@2023-10-19 05:21:13+02, 0.2@2023-10-19 05... 48.376014 \n111219504 [0@2023-10-19 07:32:04+02, 0@2023-10-19 07:34:... 249300.505518 \n111219508 [1.7@2023-10-19 11:52:43+02, 7.5@2023-10-19 11... 463414.183253 \n111219512 [16.9@2023-10-19 09:44:07+02, 54.2@2023-10-19 ... 122854.298352 ",
- "text/html": "\n\n
\n \n \n | \n trajectory | \n sog | \n distance | \n
\n \n mmsi | \n | \n | \n | \n
\n \n \n \n 2190045 | \n [POINT(8.44805 55.464272)@2023-10-19 00:00:10+... | \n [0@2023-10-19 00:00:10+02, 0.1@2023-10-19 00:0... | \n 4196.237335 | \n
\n \n 9109416 | \n [POINT(9.785182 54.909655)@2023-10-19 05:21:13... | \n [1.4@2023-10-19 05:21:13+02, 0.2@2023-10-19 05... | \n 48.376014 | \n
\n \n 111219504 | \n [POINT(9.838743 57.103408)@2023-10-19 07:32:04... | \n [0@2023-10-19 07:32:04+02, 0@2023-10-19 07:34:... | \n 249300.505518 | \n
\n \n 111219508 | \n [POINT(12.121327 55.591252)@2023-10-19 11:52:4... | \n [1.7@2023-10-19 11:52:43+02, 7.5@2023-10-19 11... | \n 463414.183253 | \n
\n \n 111219512 | \n [POINT(9.286713 55.220503)@2023-10-19 09:44:07... | \n [16.9@2023-10-19 09:44:07+02, 54.2@2023-10-19 ... | \n 122854.298352 | \n
\n \n
\n
"
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " trajectory | \n",
+ " sog | \n",
+ " distance | \n",
+ "
\n",
+ " \n",
+ " mmsi | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 148 | \n",
+ " [POINT(12.606613 55.684455)@2023-08-01 00:01:3... | \n",
+ " [0.8@2023-08-01 00:01:34+05, 0@2023-08-01 00:0... | \n",
+ " 31191.067480 | \n",
+ "
\n",
+ " \n",
+ " 5322 | \n",
+ " [POINT(12.606042 55.684293)@2023-08-01 00:00:0... | \n",
+ " [0.1@2023-08-01 00:00:00+05, 0.2@2023-08-01 00... | \n",
+ " 39797.594133 | \n",
+ "
\n",
+ " \n",
+ " 100046 | \n",
+ " [POINT(4.164757 58.76664)@2023-08-01 19:20:52+... | \n",
+ " [148@2023-08-01 19:20:52+05, 148@2023-08-01 19... | \n",
+ " 46476.358036 | \n",
+ "
\n",
+ " \n",
+ " 2190045 | \n",
+ " [POINT(8.423332 55.47179)@2023-08-01 00:00:07+... | \n",
+ " [0@2023-08-01 00:00:07+05, 0@2023-08-01 02:51:... | \n",
+ " 2436.943448 | \n",
+ "
\n",
+ " \n",
+ " 9132759 | \n",
+ " [POINT(8.310862 56.552482)@2023-08-01 17:32:00... | \n",
+ " [0@2023-08-01 17:32:00+05, 0@2023-08-01 17:44:... | \n",
+ " 368.171260 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " trajectory \\\n",
+ "mmsi \n",
+ "148 [POINT(12.606613 55.684455)@2023-08-01 00:01:3... \n",
+ "5322 [POINT(12.606042 55.684293)@2023-08-01 00:00:0... \n",
+ "100046 [POINT(4.164757 58.76664)@2023-08-01 19:20:52+... \n",
+ "2190045 [POINT(8.423332 55.47179)@2023-08-01 00:00:07+... \n",
+ "9132759 [POINT(8.310862 56.552482)@2023-08-01 17:32:00... \n",
+ "\n",
+ " sog distance \n",
+ "mmsi \n",
+ "148 [0.8@2023-08-01 00:01:34+05, 0@2023-08-01 00:0... 31191.067480 \n",
+ "5322 [0.1@2023-08-01 00:00:00+05, 0.2@2023-08-01 00... 39797.594133 \n",
+ "100046 [148@2023-08-01 19:20:52+05, 148@2023-08-01 19... 46476.358036 \n",
+ "2190045 [0@2023-08-01 00:00:07+05, 0@2023-08-01 02:51:... 2436.943448 \n",
+ "9132759 [0@2023-08-01 17:32:00+05, 0@2023-08-01 17:44:... 368.171260 "
+ ]
},
"execution_count": 5,
"metadata": {},
@@ -249,32 +495,149 @@
")\n",
"trajectories[\"distance\"] = trajectories[\"trajectory\"].apply(lambda t: t.length())\n",
"trajectories.head()"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-02-03T19:00:18.427946600Z",
- "start_time": "2024-02-03T18:59:47.786832800Z"
- }
- }
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "Here we can see that PyMEOS has been able to reduce the number of points stored (and thus memory used) without losing any information."
- ],
"metadata": {
"collapsed": false
- }
+ },
+ "source": [
+ "Here we can see that PyMEOS has been able to reduce the number of points stored (and thus memory used) without losing any information."
+ ]
},
{
"cell_type": "code",
"execution_count": 6,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T19:01:16.569003700Z",
+ "start_time": "2024-02-03T19:01:16.409027Z"
+ },
+ "collapsed": false
+ },
"outputs": [
{
"data": {
- "text/plain": " original #points PyMEOS #points Points kept (%)\nmmsi \n2190045 8849 7180 81.139112\n9109416 63 58 92.063492\n111219504 3162 3058 96.710942\n111219508 5830 5760 98.799314\n111219512 799 773 96.745932\n... ... ... ...\n677064088 696 636 91.379310\n826500702 370 286 77.297297\n887222300 867 548 63.206459\n912190064 85 83 97.647059\n912191373 750 2 0.266667\n\n[2884 rows x 3 columns]",
- "text/html": "\n\n
\n \n \n | \n original #points | \n PyMEOS #points | \n Points kept (%) | \n
\n \n mmsi | \n | \n | \n | \n
\n \n \n \n 2190045 | \n 8849 | \n 7180 | \n 81.139112 | \n
\n \n 9109416 | \n 63 | \n 58 | \n 92.063492 | \n
\n \n 111219504 | \n 3162 | \n 3058 | \n 96.710942 | \n
\n \n 111219508 | \n 5830 | \n 5760 | \n 98.799314 | \n
\n \n 111219512 | \n 799 | \n 773 | \n 96.745932 | \n
\n \n ... | \n ... | \n ... | \n ... | \n
\n \n 677064088 | \n 696 | \n 636 | \n 91.379310 | \n
\n \n 826500702 | \n 370 | \n 286 | \n 77.297297 | \n
\n \n 887222300 | \n 867 | \n 548 | \n 63.206459 | \n
\n \n 912190064 | \n 85 | \n 83 | \n 97.647059 | \n
\n \n 912191373 | \n 750 | \n 2 | \n 0.266667 | \n
\n \n
\n
2884 rows × 3 columns
\n
"
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " original #points | \n",
+ " PyMEOS #points | \n",
+ " Points kept (%) | \n",
+ "
\n",
+ " \n",
+ " mmsi | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 148 | \n",
+ " 3882 | \n",
+ " 3625 | \n",
+ " 93.379701 | \n",
+ "
\n",
+ " \n",
+ " 5322 | \n",
+ " 8224 | \n",
+ " 8008 | \n",
+ " 97.373541 | \n",
+ "
\n",
+ " \n",
+ " 100046 | \n",
+ " 3 | \n",
+ " 3 | \n",
+ " 100.000000 | \n",
+ "
\n",
+ " \n",
+ " 2190045 | \n",
+ " 8824 | \n",
+ " 4732 | \n",
+ " 53.626473 | \n",
+ "
\n",
+ " \n",
+ " 9132759 | \n",
+ " 159 | \n",
+ " 103 | \n",
+ " 64.779874 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 970010921 | \n",
+ " 638 | \n",
+ " 378 | \n",
+ " 59.247649 | \n",
+ "
\n",
+ " \n",
+ " 970021666 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 100.000000 | \n",
+ "
\n",
+ " \n",
+ " 970021790 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 66.666667 | \n",
+ "
\n",
+ " \n",
+ " 970100094 | \n",
+ " 8 | \n",
+ " 3 | \n",
+ " 37.500000 | \n",
+ "
\n",
+ " \n",
+ " 972609012 | \n",
+ " 6 | \n",
+ " 3 | \n",
+ " 50.000000 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
6064 rows × 3 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " original #points PyMEOS #points Points kept (%)\n",
+ "mmsi \n",
+ "148 3882 3625 93.379701\n",
+ "5322 8224 8008 97.373541\n",
+ "100046 3 3 100.000000\n",
+ "2190045 8824 4732 53.626473\n",
+ "9132759 159 103 64.779874\n",
+ "... ... ... ...\n",
+ "970010921 638 378 59.247649\n",
+ "970021666 2 2 100.000000\n",
+ "970021790 3 2 66.666667\n",
+ "970100094 8 3 37.500000\n",
+ "972609012 6 3 50.000000\n",
+ "\n",
+ "[6064 rows x 3 columns]"
+ ]
},
"execution_count": 6,
"metadata": {},
@@ -295,32 +658,34 @@
" comparison[\"PyMEOS #points\"] / comparison[\"original #points\"] * 100\n",
")\n",
"comparison"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-02-03T19:01:16.569003700Z",
- "start_time": "2024-02-03T19:01:16.409027Z"
- }
- }
+ ]
},
{
"cell_type": "markdown",
- "source": [
- "We can visualize the trajectories and the SOG evolutions by plotting them. We will plot only 100 of the trajectories."
- ],
"metadata": {
"collapsed": false
- }
+ },
+ "source": [
+ "We can visualize the trajectories and the SOG evolutions by plotting them. We will plot only 100 of the trajectories."
+ ]
},
{
"cell_type": "code",
"execution_count": 7,
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-02-03T19:01:27.858702300Z",
+ "start_time": "2024-02-03T19:01:17.861083800Z"
+ },
+ "collapsed": false
+ },
"outputs": [
{
"data": {
- "text/plain": "