From eca86b22a2dca160df28dbb4a605da7ab8377799 Mon Sep 17 00:00:00 2001 From: tomsail Date: Fri, 19 Jul 2024 10:51:09 +0200 Subject: [PATCH] add IOC STOFS2D notebook --- Observations_IOC_STOFS.html | 9544 ++++++++++++++++++++++++++++++++++ Observations_IOC_STOFS.ipynb | 1841 +++++++ index.html | 1 + 3 files changed, 11386 insertions(+) create mode 100644 Observations_IOC_STOFS.html create mode 100644 Observations_IOC_STOFS.ipynb diff --git a/Observations_IOC_STOFS.html b/Observations_IOC_STOFS.html new file mode 100644 index 0000000..7d256dc --- /dev/null +++ b/Observations_IOC_STOFS.html @@ -0,0 +1,9544 @@ + + + + + +Observations_IOC_STOFS + + + + + + + + + + + + +
+
+ + diff --git a/Observations_IOC_STOFS.ipynb b/Observations_IOC_STOFS.ipynb new file mode 100644 index 0000000..74a80dc --- /dev/null +++ b/Observations_IOC_STOFS.ipynb @@ -0,0 +1,1841 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "application/javascript": "(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n var py_version = '3.4.1'.replace('rc', '-rc.').replace('.dev', '-dev.');\n var reloading = false;\n var Bokeh = root.Bokeh;\n\n if (typeof (root._bokeh_timeout) === \"undefined\" || force) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks;\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, js_modules, js_exports, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n if (js_exports == null) js_exports = {};\n\n root._bokeh_onload_callbacks.push(callback);\n\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls.length === 0 && js_modules.length === 0 && Object.keys(js_exports).length === 0) {\n run_callbacks();\n return null;\n }\n if (!reloading) {\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n }\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n window._bokeh_on_load = on_load\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n var skip = [];\n if (window.requirejs) {\n window.requirejs.config({'packages': {}, 'paths': {}, 'shim': {}});\n root._bokeh_is_loading = css_urls.length + 0;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length + Object.keys(js_exports).length;\n }\n\n var existing_stylesheets = []\n var links = document.getElementsByTagName('link')\n for (var i = 0; i < links.length; i++) {\n var link = links[i]\n if (link.href != null) {\n\texisting_stylesheets.push(link.href)\n }\n }\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n if (existing_stylesheets.indexOf(url) !== -1) {\n\ton_load()\n\tcontinue;\n }\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n } var existing_scripts = []\n var scripts = document.getElementsByTagName('script')\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i]\n if (script.src != null) {\n\texisting_scripts.push(script.src)\n }\n }\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (var i = 0; i < js_modules.length; i++) {\n var url = js_modules[i];\n if (skip.indexOf(url) !== -1 || existing_scripts.indexOf(url) !== -1) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (const name in js_exports) {\n var url = js_exports[name];\n if (skip.indexOf(url) >= 0 || root[name] != null) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onerror = on_error;\n element.async = false;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n element.textContent = `\n import ${name} from \"${url}\"\n window.${name} = ${name}\n window._bokeh_on_load()\n `\n document.head.appendChild(element);\n }\n if (!js_urls.length && !js_modules.length) {\n on_load()\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-3.4.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-3.4.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-3.4.1.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-3.4.1.min.js\", \"https://cdn.holoviz.org/panel/1.4.2/dist/panel.min.js\"];\n var js_modules = [];\n var js_exports = {};\n var css_urls = [];\n var inline_js = [ function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n\ttry {\n inline_js[i].call(root, root.Bokeh);\n\t} catch(e) {\n\t if (!reloading) {\n\t throw e;\n\t }\n\t}\n }\n // Cache old bokeh versions\n if (Bokeh != undefined && !reloading) {\n\tvar NewBokeh = root.Bokeh;\n\tif (Bokeh.versions === undefined) {\n\t Bokeh.versions = new Map();\n\t}\n\tif (NewBokeh.version !== Bokeh.version) {\n\t Bokeh.versions.set(NewBokeh.version, NewBokeh)\n\t}\n\troot.Bokeh = Bokeh;\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n }\n root._bokeh_is_initializing = false\n }\n\n function load_or_wait() {\n // Implement a backoff loop that tries to ensure we do not load multiple\n // versions of Bokeh and its dependencies at the same time.\n // In recent versions we use the root._bokeh_is_initializing flag\n // to determine whether there is an ongoing attempt to initialize\n // bokeh, however for backward compatibility we also try to ensure\n // that we do not start loading a newer (Panel>=1.0 and Bokeh>3) version\n // before older versions are fully initialized.\n if (root._bokeh_is_initializing && Date.now() > root._bokeh_timeout) {\n root._bokeh_is_initializing = false;\n root._bokeh_onload_callbacks = undefined;\n console.log(\"Bokeh: BokehJS was loaded multiple times but one version failed to initialize.\");\n load_or_wait();\n } else if (root._bokeh_is_initializing || (typeof root._bokeh_is_initializing === \"undefined\" && root._bokeh_onload_callbacks !== undefined)) {\n setTimeout(load_or_wait, 100);\n } else {\n root._bokeh_is_initializing = true\n root._bokeh_onload_callbacks = []\n var bokeh_loaded = Bokeh != null && (Bokeh.version === py_version || (Bokeh.versions !== undefined && Bokeh.versions.has(py_version)));\n if (!reloading && !bokeh_loaded) {\n\troot.Bokeh = undefined;\n }\n load_libs(css_urls, js_urls, js_modules, js_exports, function() {\n\tconsole.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n\trun_inline_js();\n });\n }\n }\n // Give older versions of the autoload script a head-start to ensure\n // they initialize before we start loading newer version.\n setTimeout(load_or_wait, 100)\n}(window));", + "application/vnd.holoviews_load.v0+json": "" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/javascript": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n function JupyterCommManager() {\n }\n\n JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n comm_manager.register_target(comm_id, function(comm) {\n comm.on_msg(msg_handler);\n });\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n comm.onMsg = msg_handler;\n });\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n console.log(message)\n var content = {data: message.data, comm_id};\n var buffers = []\n for (var buffer of message.buffers || []) {\n buffers.push(new DataView(buffer))\n }\n var metadata = message.metadata || {};\n var msg = {content, buffers, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n })\n }\n }\n\n JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n if (comm_id in window.PyViz.comms) {\n return window.PyViz.comms[comm_id];\n } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n if (msg_handler) {\n comm.on_msg(msg_handler);\n }\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n comm.open();\n if (msg_handler) {\n comm.onMsg = msg_handler;\n }\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n var comm_promise = google.colab.kernel.comms.open(comm_id)\n comm_promise.then((comm) => {\n window.PyViz.comms[comm_id] = comm;\n if (msg_handler) {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n var content = {data: message.data};\n var metadata = message.metadata || {comm_id};\n var msg = {content, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n }\n }) \n var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n return comm_promise.then((comm) => {\n comm.send(data, metadata, buffers, disposeOnDone);\n });\n };\n var comm = {\n send: sendClosure\n };\n }\n window.PyViz.comms[comm_id] = comm;\n return comm;\n }\n window.PyViz.comm_manager = new JupyterCommManager();\n \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n return\n }\n var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n if (id !== undefined) {\n var nchildren = toinsert.length;\n var html_node = toinsert[nchildren-1].children[0];\n html_node.innerHTML = output.data[HTML_MIME_TYPE];\n var scripts = [];\n var nodelist = html_node.querySelectorAll(\"script\");\n for (var i in nodelist) {\n if (nodelist.hasOwnProperty(i)) {\n scripts.push(nodelist[i])\n }\n }\n\n scripts.forEach( function (oldScript) {\n var newScript = document.createElement(\"script\");\n var attrs = [];\n var nodemap = oldScript.attributes;\n for (var j in nodemap) {\n if (nodemap.hasOwnProperty(j)) {\n attrs.push(nodemap[j])\n }\n }\n attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n oldScript.parentNode.replaceChild(newScript, oldScript);\n });\n if (JS_MIME_TYPE in output.data) {\n toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n }\n output_area._hv_plot_id = id;\n if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n window.PyViz.plot_index[id] = Bokeh.index[id];\n } else {\n window.PyViz.plot_index[id] = null;\n }\n } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n var id = handle.cell.output_area._hv_plot_id;\n var server_id = handle.cell.output_area._bokeh_server_id;\n if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n if (server_id !== null) {\n comm.send({event_type: 'server_delete', 'id': server_id});\n return;\n } else if (comm !== null) {\n comm.send({event_type: 'delete', 'id': id});\n }\n delete PyViz.plot_index[id];\n if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n var doc = window.Bokeh.index[id].model.document\n doc.clear();\n const i = window.Bokeh.documents.indexOf(doc);\n if (i > -1) {\n window.Bokeh.documents.splice(i, 1);\n }\n }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n delete PyViz.comms[\"hv-extension-comm\"];\n window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n handle_clear_output(event, {cell: {output_area: handle.output_area}})\n handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[0]);\n element.append(toinsert);\n return toinsert\n }\n\n events.on('output_added.OutputArea', handle_add_output);\n events.on('output_updated.OutputArea', handle_update_output);\n events.on('clear_output.CodeCell', handle_clear_output);\n events.on('delete.Cell', handle_clear_output);\n events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n safe: true,\n index: 0\n });\n}\n\nif (window.Jupyter !== undefined) {\n try {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n } catch(err) {\n }\n}\n", + "application/vnd.holoviews_load.v0+json": "" + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.holoviews_exec.v0+json": "", + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ] + }, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p1002" + } + }, + "output_type": "display_data" + } + ], + "source": [ + "import geopandas as gp\n", + "import pandas as pd\n", + "import searvey\n", + "import hvplot.pandas" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ioc_codegloss_idcountrylocationconnectiondcp_idlast_observation_levellast_observation_timedelayinterval...observations_expected_per_monthobservations_ratio_per_monthobservations_ratio_per_daysample_intervalaverage_delay_per_daytransmit_intervallonlatis_iocis_satellite
0abas327JapanAbashiriSWJP40ABASHIRI2.1408:0916'10'...43200.01001001'8'10'144.29000044.020000TrueFalse
1abed<NA>UKAberdeenftpNaN2.1507:4540'15'...2880.010010015'28'15'-2.08000057.140000TrueFalse
2abur82JapanAburatsuSWJP40ABURATSU2.8908:0916'10'...43200.01001001'8'10'131.41000031.580000TrueFalse
3acaj182El SalvadorAcajutla SVSZXX013004340640088102.242024-07-17 16:542d5'...43200.09201'NaN5'-89.83812813.573792TrueFalse
4acap267MexicoAcapulco MXSEPA403540E15A8.26-down-2569d5'...NaN001'NaN5'-99.91660016.833300TrueFalse
..................................................................
1629zkth<NA>GreeceZakynthos, Ionian IslandsbganGR-ZKTH-000.0108:1312'1'...43200.0751001'4'1'20.90520037.781420TrueFalse
1630zldw<NA>BelgiumZeebrugge Leopold II damwebNaN2.2108:1510'5'...8640.0981005'9'5'3.20027851.346389TrueFalse
1631zwdw<NA>BelgiumZeebrugge WielingendokwebNaN2.2408:1510'5'...8640.0531005'8'5'3.17805651.355278TrueFalse
1632zygi<NA>CyprusZygiftpNaN1.91-down-3318d1'...NaN000.5'NaN1'33.33837534.727083TrueFalse
1633zygi1<NA>CyprusZygibganZYGI1NaN2022-03-18 00:47854d1'...NaN001'NaN1'33.34022834.726315TrueFalse
\n", + "

1634 rows × 26 columns

\n", + "
" + ], + "text/plain": [ + " ioc_code gloss_id country location connection \\\n", + "0 abas 327 Japan Abashiri SWJP40 \n", + "1 abed UK Aberdeen ftp \n", + "2 abur 82 Japan Aburatsu SWJP40 \n", + "3 acaj 182 El Salvador Acajutla SV SZXX01 \n", + "4 acap 267 Mexico Acapulco MX SEPA40 \n", + "... ... ... ... ... ... \n", + "1629 zkth Greece Zakynthos, Ionian Islands bgan \n", + "1630 zldw Belgium Zeebrugge Leopold II dam web \n", + "1631 zwdw Belgium Zeebrugge Wielingendok web \n", + "1632 zygi Cyprus Zygi ftp \n", + "1633 zygi1 Cyprus Zygi bgan \n", + "\n", + " dcp_id last_observation_level last_observation_time delay \\\n", + "0 ABASHIRI 2.14 08:09 16' \n", + "1 NaN 2.15 07:45 40' \n", + "2 ABURATSU 2.89 08:09 16' \n", + "3 300434064008810 2.24 2024-07-17 16:54 2d \n", + "4 3540E15A 8.26 -down- 2569d \n", + "... ... ... ... ... \n", + "1629 GR-ZKTH-00 0.01 08:13 12' \n", + "1630 NaN 2.21 08:15 10' \n", + "1631 NaN 2.24 08:15 10' \n", + "1632 NaN 1.91 -down- 3318d \n", + "1633 ZYGI1 NaN 2022-03-18 00:47 854d \n", + "\n", + " interval ... observations_expected_per_month \\\n", + "0 10' ... 43200.0 \n", + "1 15' ... 2880.0 \n", + "2 10' ... 43200.0 \n", + "3 5' ... 43200.0 \n", + "4 5' ... NaN \n", + "... ... ... ... \n", + "1629 1' ... 43200.0 \n", + "1630 5' ... 8640.0 \n", + "1631 5' ... 8640.0 \n", + "1632 1' ... NaN \n", + "1633 1' ... NaN \n", + "\n", + " observations_ratio_per_month observations_ratio_per_day sample_interval \\\n", + "0 100 100 1' \n", + "1 100 100 15' \n", + "2 100 100 1' \n", + "3 92 0 1' \n", + "4 0 0 1' \n", + "... ... ... ... \n", + "1629 75 100 1' \n", + "1630 98 100 5' \n", + "1631 53 100 5' \n", + "1632 0 0 0.5' \n", + "1633 0 0 1' \n", + "\n", + " average_delay_per_day transmit_interval lon lat is_ioc \\\n", + "0 8' 10' 144.290000 44.020000 True \n", + "1 28' 15' -2.080000 57.140000 True \n", + "2 8' 10' 131.410000 31.580000 True \n", + "3 NaN 5' -89.838128 13.573792 True \n", + "4 NaN 5' -99.916600 16.833300 True \n", + "... ... ... ... ... ... \n", + "1629 4' 1' 20.905200 37.781420 True \n", + "1630 9' 5' 3.200278 51.346389 True \n", + "1631 8' 5' 3.178056 51.355278 True \n", + "1632 NaN 1' 33.338375 34.727083 True \n", + "1633 NaN 1' 33.340228 34.726315 True \n", + "\n", + " is_satellite \n", + "0 False \n", + "1 False \n", + "2 False \n", + "3 False \n", + "4 False \n", + "... ... \n", + "1629 False \n", + "1630 False \n", + "1631 False \n", + "1632 False \n", + "1633 False \n", + "\n", + "[1634 rows x 26 columns]" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "def get_meta() -> gp.GeoDataFrame:\n", + " meta_web = searvey.get_ioc_stations().drop(columns=[\"lon\", \"lat\"])\n", + " meta_api = (\n", + " pd.read_json(\n", + " \"http://www.ioc-sealevelmonitoring.org/service.php?query=stationlist&showall=all\"\n", + " )\n", + " .drop_duplicates()\n", + " .drop(columns=[\"lon\", \"lat\"])\n", + " .rename(columns={\"Code\": \"ioc_code\", \"Lon\": \"lon\", \"Lat\": \"lat\"})\n", + " )\n", + " merged = pd.merge(\n", + " meta_web,\n", + " meta_api[[\"ioc_code\", \"lon\", \"lat\"]].drop_duplicates(),\n", + " on=[\"ioc_code\"],\n", + " )\n", + " return merged.drop(columns=[\"geometry\"])\n", + "\n", + "ioc_ = get_meta()\n", + "ioc_[\"is_ioc\"] = True\n", + "ioc_['is_satellite'] = False\n", + "ioc_" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_25766/2272989170.py:2: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.\n", + " stof2d = pd.read_csv(\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
lonlatInfoIDis_satelliteis_ioc
0-66.98100344.903000ME EastportPSBM1 SOUS41 8410140FalseFalse
1-67.20400244.654499ME Cutler Farris WharfCFWM1 SOUS41 8411060FalseFalse
2-68.20349944.394001ME Bar HarborATGM1 SOUS41 8413320FalseFalse
3-70.24600243.656101ME PortlandCASM1 SOUS41 8418150FalseFalse
4-70.56330143.320000ME WellsWELM1 SOUS41 8419317FalseFalse
.....................
1683-178.58000058.960000UJ850 SOUS00 SA850TrueFalse
1684-144.57000058.960000UJ851 SOUS00 SA851TrueFalse
1685-68.02000058.960000UJ852 SOUS00 SA852TrueFalse
1686-51.01000058.960000UJ853 SOUS00 SA853TrueFalse
1687-25.50000058.960000UJ854 SOUS00 SA854TrueFalse
\n", + "

1688 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " lon lat Info ID \\\n", + "0 -66.981003 44.903000 ME Eastport PSBM1 SOUS41 8410140 \n", + "1 -67.204002 44.654499 ME Cutler Farris Wharf CFWM1 SOUS41 8411060 \n", + "2 -68.203499 44.394001 ME Bar Harbor ATGM1 SOUS41 8413320 \n", + "3 -70.246002 43.656101 ME Portland CASM1 SOUS41 8418150 \n", + "4 -70.563301 43.320000 ME Wells WELM1 SOUS41 8419317 \n", + "... ... ... ... ... \n", + "1683 -178.580000 58.960000 UJ850 SOUS00 SA850 \n", + "1684 -144.570000 58.960000 UJ851 SOUS00 SA851 \n", + "1685 -68.020000 58.960000 UJ852 SOUS00 SA852 \n", + "1686 -51.010000 58.960000 UJ853 SOUS00 SA853 \n", + "1687 -25.500000 58.960000 UJ854 SOUS00 SA854 \n", + "\n", + " is_satellite is_ioc \n", + "0 False False \n", + "1 False False \n", + "2 False False \n", + "3 False False \n", + "4 False False \n", + "... ... ... \n", + "1683 True False \n", + "1684 True False \n", + "1685 True False \n", + "1686 True False \n", + "1687 True False \n", + "\n", + "[1688 rows x 6 columns]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mycols = [str(i) for i in range(6)] # we expect 17 cols max in that file\n", + "stof2d = pd.read_csv(\n", + " \"https://polar.ncep.noaa.gov/stofs/data/stofs_2d_glo_elev_stat_v2_1_0\",\n", + " names=mycols, \n", + " sep=\"\\t+|!\", \n", + " header=None, \n", + " skiprows=1\n", + ")\n", + "stof2d['Info'] = stof2d.apply(lambda row: ' '.join(filter(None, row[2:])), axis=1)\n", + "stof2d['ID'] = stof2d['Info'].apply(lambda x: ' '.join(x.split()[:3]))\n", + "stof2d['Info'] = stof2d.apply(lambda row: row['Info'].replace(row['ID'], '').strip(), axis=1)\n", + "stof2d = stof2d.drop(columns=[\"2\", \"3\", \"4\", \"5\"])\n", + "stof2d.rename(columns={\"0\": 'lon', \"1\": 'lat'}, inplace=True)\n", + "stof2d['is_satellite'] = stof2d.apply(lambda row: \"SA\" in row[\"ID\"], axis=1)\n", + "stof2d['is_ioc'] = False\n", + "stof2d" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
lonlatInfoIDis_satellite_xis_ioc_xioc_codegloss_idcountrylocation...observations_ratio_per_weekobservations_arrived_per_monthobservations_expected_per_monthobservations_ratio_per_monthobservations_ratio_per_daysample_intervalaverage_delay_per_daytransmit_intervalis_ioc_yis_satellite_y
0-179.7978-38.2001NaNNaNNaNNaNdnzc<NA>New ZealandDART New Zealand E Coast...99.027762880.096.0100.015'30'6hTrueFalse
1-179.7978-38.2001NaNNaNNaNNaNdnzc2<NA>New ZealandDART New Zealand E Coast...96.027522880.096.0100.015'210'6hTrueFalse
2-178.5800-51.4200UJ040 SOUS00 SA040TrueFalseNaN<NA>NaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3-178.5800-29.7200UJ211 SOUS00 SA211TrueFalseNaN<NA>NaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4-178.5800-1.9800UJ466 SOUS00 SA466TrueFalseNaN<NA>NaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
..................................................................
3312178.6037-36.0999NaNNaNNaNNaNdnzd2<NA>New ZealandDART New Zealand...100.028802880.0100.0100.015'180'6hTrueFalse
3313179.0962-40.5992NaNNaNNaNNaNdnzb<NA>New ZealandDART New Zealand E Coast...100.028762880.0100.0100.015'30'6hTrueFalse
3314179.0962-40.5992NaNNaNNaNNaNdnzb2<NA>New ZealandDART New Zealand E Coast...0.0NaNNaN0.00.015'NaN6hTrueFalse
3315179.1949-8.5033NaNNaNNaNNaNfong121Tuvalu IslandsFongafale TV...100.04285843200.099.0100.01'2'3'TrueFalse
3316179.1950-8.5250Funafuti TuvaluUH025 SOUS00 GL121FalseFalseNaN<NA>NaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", + "

3317 rows × 30 columns

\n", + "
" + ], + "text/plain": [ + " lon lat Info ID \\\n", + "0 -179.7978 -38.2001 NaN NaN \n", + "1 -179.7978 -38.2001 NaN NaN \n", + "2 -178.5800 -51.4200 UJ040 SOUS00 SA040 \n", + "3 -178.5800 -29.7200 UJ211 SOUS00 SA211 \n", + "4 -178.5800 -1.9800 UJ466 SOUS00 SA466 \n", + "... ... ... ... ... \n", + "3312 178.6037 -36.0999 NaN NaN \n", + "3313 179.0962 -40.5992 NaN NaN \n", + "3314 179.0962 -40.5992 NaN NaN \n", + "3315 179.1949 -8.5033 NaN NaN \n", + "3316 179.1950 -8.5250 Funafuti Tuvalu UH025 SOUS00 GL121 \n", + "\n", + " is_satellite_x is_ioc_x ioc_code gloss_id country \\\n", + "0 NaN NaN dnzc New Zealand \n", + "1 NaN NaN dnzc2 New Zealand \n", + "2 True False NaN NaN \n", + "3 True False NaN NaN \n", + "4 True False NaN NaN \n", + "... ... ... ... ... ... \n", + "3312 NaN NaN dnzd2 New Zealand \n", + "3313 NaN NaN dnzb New Zealand \n", + "3314 NaN NaN dnzb2 New Zealand \n", + "3315 NaN NaN fong 121 Tuvalu Islands \n", + "3316 False False NaN NaN \n", + "\n", + " location ... observations_ratio_per_week \\\n", + "0 DART New Zealand E Coast ... 99.0 \n", + "1 DART New Zealand E Coast ... 96.0 \n", + "2 NaN ... NaN \n", + "3 NaN ... NaN \n", + "4 NaN ... NaN \n", + "... ... ... ... \n", + "3312 DART New Zealand ... 100.0 \n", + "3313 DART New Zealand E Coast ... 100.0 \n", + "3314 DART New Zealand E Coast ... 0.0 \n", + "3315 Fongafale TV ... 100.0 \n", + "3316 NaN ... NaN \n", + "\n", + " observations_arrived_per_month observations_expected_per_month \\\n", + "0 2776 2880.0 \n", + "1 2752 2880.0 \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "4 NaN NaN \n", + "... ... ... \n", + "3312 2880 2880.0 \n", + "3313 2876 2880.0 \n", + "3314 NaN NaN \n", + "3315 42858 43200.0 \n", + "3316 NaN NaN \n", + "\n", + " observations_ratio_per_month observations_ratio_per_day sample_interval \\\n", + "0 96.0 100.0 15' \n", + "1 96.0 100.0 15' \n", + "2 NaN NaN NaN \n", + "3 NaN NaN NaN \n", + "4 NaN NaN NaN \n", + "... ... ... ... \n", + "3312 100.0 100.0 15' \n", + "3313 100.0 100.0 15' \n", + "3314 0.0 0.0 15' \n", + "3315 99.0 100.0 1' \n", + "3316 NaN NaN NaN \n", + "\n", + " average_delay_per_day transmit_interval is_ioc_y is_satellite_y \n", + "0 30' 6h True False \n", + "1 210' 6h True False \n", + "2 NaN NaN NaN NaN \n", + "3 NaN NaN NaN NaN \n", + "4 NaN NaN NaN NaN \n", + "... ... ... ... ... \n", + "3312 180' 6h True False \n", + "3313 30' 6h True False \n", + "3314 NaN 6h True False \n", + "3315 2' 3' True False \n", + "3316 NaN NaN NaN NaN \n", + "\n", + "[3317 rows x 30 columns]" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m = pd.merge(stof2d, ioc_,on=['lon', 'lat'], how='outer')\n", + "m" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_25766/483800126.py:1: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`\n", + " m['is_ioc'] = m['is_ioc_x'].fillna(m['is_ioc_y'])\n", + "/tmp/ipykernel_25766/483800126.py:2: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`\n", + " m['is_satellite'] = m['is_satellite_x'].fillna(m['is_satellite_y'])\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
lonlatInfoIDioc_codegloss_idcountrylocationconnectiondcp_id...observations_ratio_per_weekobservations_arrived_per_monthobservations_expected_per_monthobservations_ratio_per_monthobservations_ratio_per_daysample_intervalaverage_delay_per_daytransmit_intervalis_iocis_satellite
0-179.7978-38.2001NaNNaNdnzc<NA>New ZealandDART New Zealand E CoastwebNaN...99.027762880.096.0100.015'30'6hTrueFalse
1-179.7978-38.2001NaNNaNdnzc2<NA>New ZealandDART New Zealand E CoastSZNZ435401000...96.027522880.096.0100.015'210'6hTrueFalse
2-178.5800-51.4200UJ040 SOUS00 SA040NaN<NA>NaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNFalseTrue
3-178.5800-29.7200UJ211 SOUS00 SA211NaN<NA>NaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNFalseTrue
4-178.5800-1.9800UJ466 SOUS00 SA466NaN<NA>NaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNFalseTrue
..................................................................
3312178.6037-36.0999NaNNaNdnzd2<NA>New ZealandDART New ZealandSZNZ445501004...100.028802880.0100.0100.015'180'6hTrueFalse
3313179.0962-40.5992NaNNaNdnzb<NA>New ZealandDART New Zealand E CoastwebNaN...100.028762880.0100.0100.015'30'6hTrueFalse
3314179.0962-40.5992NaNNaNdnzb2<NA>New ZealandDART New Zealand E CoastSZNZ425501003...0.0NaNNaN0.00.015'NaN6hTrueFalse
3315179.1949-8.5033NaNNaNfong121Tuvalu IslandsFongafale TVSZPS0167440...100.04285843200.099.0100.01'2'3'TrueFalse
3316179.1950-8.5250Funafuti TuvaluUH025 SOUS00 GL121NaN<NA>NaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNFalseFalse
\n", + "

3317 rows × 28 columns

\n", + "
" + ], + "text/plain": [ + " lon lat Info ID ioc_code \\\n", + "0 -179.7978 -38.2001 NaN NaN dnzc \n", + "1 -179.7978 -38.2001 NaN NaN dnzc2 \n", + "2 -178.5800 -51.4200 UJ040 SOUS00 SA040 NaN \n", + "3 -178.5800 -29.7200 UJ211 SOUS00 SA211 NaN \n", + "4 -178.5800 -1.9800 UJ466 SOUS00 SA466 NaN \n", + "... ... ... ... ... ... \n", + "3312 178.6037 -36.0999 NaN NaN dnzd2 \n", + "3313 179.0962 -40.5992 NaN NaN dnzb \n", + "3314 179.0962 -40.5992 NaN NaN dnzb2 \n", + "3315 179.1949 -8.5033 NaN NaN fong \n", + "3316 179.1950 -8.5250 Funafuti Tuvalu UH025 SOUS00 GL121 NaN \n", + "\n", + " gloss_id country location connection dcp_id \\\n", + "0 New Zealand DART New Zealand E Coast web NaN \n", + "1 New Zealand DART New Zealand E Coast SZNZ43 5401000 \n", + "2 NaN NaN NaN NaN \n", + "3 NaN NaN NaN NaN \n", + "4 NaN NaN NaN NaN \n", + "... ... ... ... ... ... \n", + "3312 New Zealand DART New Zealand SZNZ44 5501004 \n", + "3313 New Zealand DART New Zealand E Coast web NaN \n", + "3314 New Zealand DART New Zealand E Coast SZNZ42 5501003 \n", + "3315 121 Tuvalu Islands Fongafale TV SZPS01 67440 \n", + "3316 NaN NaN NaN NaN \n", + "\n", + " ... observations_ratio_per_week observations_arrived_per_month \\\n", + "0 ... 99.0 2776 \n", + "1 ... 96.0 2752 \n", + "2 ... NaN NaN \n", + "3 ... NaN NaN \n", + "4 ... NaN NaN \n", + "... ... ... ... \n", + "3312 ... 100.0 2880 \n", + "3313 ... 100.0 2876 \n", + "3314 ... 0.0 NaN \n", + "3315 ... 100.0 42858 \n", + "3316 ... NaN NaN \n", + "\n", + " observations_expected_per_month observations_ratio_per_month \\\n", + "0 2880.0 96.0 \n", + "1 2880.0 96.0 \n", + "2 NaN NaN \n", + "3 NaN NaN \n", + "4 NaN NaN \n", + "... ... ... \n", + "3312 2880.0 100.0 \n", + "3313 2880.0 100.0 \n", + "3314 NaN 0.0 \n", + "3315 43200.0 99.0 \n", + "3316 NaN NaN \n", + "\n", + " observations_ratio_per_day sample_interval average_delay_per_day \\\n", + "0 100.0 15' 30' \n", + "1 100.0 15' 210' \n", + "2 NaN NaN NaN \n", + "3 NaN NaN NaN \n", + "4 NaN NaN NaN \n", + "... ... ... ... \n", + "3312 100.0 15' 180' \n", + "3313 100.0 15' 30' \n", + "3314 0.0 15' NaN \n", + "3315 100.0 1' 2' \n", + "3316 NaN NaN NaN \n", + "\n", + " transmit_interval is_ioc is_satellite \n", + "0 6h True False \n", + "1 6h True False \n", + "2 NaN False True \n", + "3 NaN False True \n", + "4 NaN False True \n", + "... ... ... ... \n", + "3312 6h True False \n", + "3313 6h True False \n", + "3314 6h True False \n", + "3315 3' True False \n", + "3316 NaN False False \n", + "\n", + "[3317 rows x 28 columns]" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m['is_ioc'] = m['is_ioc_x'].fillna(m['is_ioc_y'])\n", + "m['is_satellite'] = m['is_satellite_x'].fillna(m['is_satellite_y'])\n", + "m = m.drop(columns=['is_ioc_x', 'is_ioc_y', 'is_satellite_x', 'is_satellite_y'])\n", + "m" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": {}, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.holoviews_exec.v0+json": "", + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ], + "text/plain": [ + ":Overlay\n", + " .WMTS.I :WMTS [Longitude,Latitude]\n", + " .Points.I :Points [lon,lat] (is_ioc,ID,ioc_code)" + ] + }, + "execution_count": 40, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p2230" + } + }, + "output_type": "execute_result" + } + ], + "source": [ + "m.hvplot.points(\n", + " x='lon', y='lat', \n", + " c='is_ioc', \n", + " geo=True, \n", + " tiles = True, \n", + " cmap = \"coolwarm\", \n", + " hover_cols=[\"ID\", \"ioc_code\"], \n", + ").opts(\n", + " width = 1800, \n", + " height=1000,\n", + " title=\"False = STOFS list, True = IOC database\", \n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": {}, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.holoviews_exec.v0+json": "", + "text/html": [ + "
\n", + "
\n", + "
\n", + "" + ], + "text/plain": [ + ":Overlay\n", + " .WMTS.I :WMTS [Longitude,Latitude]\n", + " .Points.I :Points [lon,lat] (is_satellite,ID,ioc_code)" + ] + }, + "execution_count": 42, + "metadata": { + "application/vnd.holoviews_exec.v0+json": { + "id": "p2426" + } + }, + "output_type": "execute_result" + } + ], + "source": [ + "m.hvplot.points(\n", + " x='lon', y='lat', \n", + " c='is_satellite', \n", + " geo=True, \n", + " tiles = True, \n", + " cmap = \"coolwarm\", \n", + " hover_cols=[\"ID\", \"ioc_code\"], \n", + ").opts(\n", + " width = 1800, \n", + " height=1000,\n", + " title=\"Does the Point corresponds to setellite location? False / True\", \n", + ")" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "pos_test", + "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.11.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/index.html b/index.html index 2af5fc6..a9404ac 100644 --- a/index.html +++ b/index.html @@ -45,6 +45,7 @@