diff --git a/PyMEOS_Examples/AIS.ipynb b/PyMEOS_Examples/AIS.ipynb index 619bdbd..536d76d 100644 --- a/PyMEOS_Examples/AIS.ipynb +++ b/PyMEOS_Examples/AIS.ipynb @@ -3,7 +3,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "source": [ "# AIS Example\n", @@ -26,23 +29,33 @@ "\n", "Note that due to its size, the data file used is not provided. It can be downloaded using the following URL:\n", "\n", - "[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." + "\n", + "http://aisdata.ais.dk/?prefix=2023/\n", + "\n", + "On that page, download the file aisdk-2023-08.zip \n", + "After extracting it, use the file aisdk-2023-08-01.csv for your analysis.\n", + "\n", + "Store the file in the [data](./data) directory. " ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2024-02-03T18:53:15.803897500Z", "start_time": "2024-02-03T18:53:14.766157300Z" }, - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "outputs": [], "source": [ + "\n", + "\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "from pymeos import *\n", @@ -57,7 +70,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "source": [ "## Reading from File ([MEOS Example](https://libmeos.org/tutorialprograms/meos_read_ais/))\n", @@ -68,7 +84,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": 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." @@ -76,21 +95,24 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2024-02-03T18:53:35.800662100Z", "start_time": "2024-02-03T18:53:17.511652900Z" }, - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 27.5 s, sys: 954 ms, total: 28.5 s\n", - "Wall time: 28.5 s\n" + "CPU times: user 14 s, sys: 2.28 s, total: 16.2 s\n", + "Wall time: 16.6 s\n" ] }, { @@ -175,7 +197,7 @@ "5 2023-08-01 219014072 54.918928 9.597852 0.0" ] }, - "execution_count": 2, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -183,7 +205,7 @@ "source": [ "%%time\n", "ais = pd.read_csv(\n", - " \"./data/aisdk-2023-08-01.zip\",\n", + " \"./data/aisdk-2023-08-01.csv\",\n", " usecols=[\"# Timestamp\", \"MMSI\", \"Latitude\", \"Longitude\", \"SOG\"],\n", ")\n", "ais.columns = [\"t\", \"mmsi\", \"lat\", \"lon\", \"sog\"]\n", @@ -201,7 +223,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "source": [ "Now, we will create the PyMEOS object representing the position and the SOG." @@ -209,33 +234,22 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "ExecuteTime": { "end_time": "2024-02-03T18:59:47.396491100Z", "start_time": "2024-02-03T18:53:35.791660600Z" }, - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "b8ed58922fd5463d943d43d2112bfa8f", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - " 0%| | 0/11046773 [00:00