{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "NX9jAdiRtl1T"
},
"source": [
"# Biologically Informed Climate Insights Through Animal-Borne Sensors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For an interactive version of this page please visit the Google Colab at the link: \n",
"[ Open in Google Colab ](https://colab.research.google.com/drive/1sDthND2y5Kcw8aqYvsQQLBDd_4EgjBFJ)
\n",
"(To open link in new tab press Ctrl + click)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As climate change reshapes ecosystems, more precise and ecologically relevant measurements are needed. Traditional climate data are often limited by static, coarse, and sparse sampling, with indirect links to ecological impacts.\n",
"The MEOP consortium (MEOP stands for \"Marine Mammals Exploring the Oceans Pole to Pole\") brings together several national programmes to produce a comprehensive quality-controlled database of oceanographic data obtained in Polar Regions from instrumented marine mammals. Animal-borne sensors offer fine-scale, biologically tuned measurements of climatic conditions, enhancing ecological and climate forecasting. Millions of meteorological observations from over a thousand species have already been collected using these sensors.\n",
"This notebok explores how this growing dataset can bridge gaps in biodiversity and climate science, particularly in terrestrial environments, positioning tagged animals as key environmental sentinels and data providers for understanding changing ecosystems."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "d_TZpFDhcv_e"
},
"source": [
"The tool uses the following product:\n",
"\n",
"- OCEAN:ICE's ERDDAP's dataset (https://er1.s4oceanice.eu/erddap/tabledap/MEOP_Animal-borne_profiles.html)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"cellView": "form",
"id": "AJd4f6j15tLu",
"tags": [
"remove-cell"
]
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: cartopy in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (0.23.0)\n",
"Requirement already satisfied: numpy>=1.21 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from cartopy) (1.26.3)\n",
"Requirement already satisfied: matplotlib>=3.5 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from cartopy) (3.8.2)\n",
"Requirement already satisfied: shapely>=1.7 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from cartopy) (2.0.6)\n",
"Requirement already satisfied: packaging>=20 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from cartopy) (24.1)\n",
"Requirement already satisfied: pyshp>=2.3 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from cartopy) (2.3.1)\n",
"Requirement already satisfied: pyproj>=3.3.1 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from cartopy) (3.6.1)\n",
"Requirement already satisfied: contourpy>=1.0.1 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (1.2.1)\n",
"Requirement already satisfied: cycler>=0.10 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (0.12.1)\n",
"Requirement already satisfied: fonttools>=4.22.0 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (4.53.1)\n",
"Requirement already satisfied: kiwisolver>=1.3.1 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (1.4.5)\n",
"Requirement already satisfied: pillow>=8 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (10.4.0)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (3.1.4)\n",
"Requirement already satisfied: python-dateutil>=2.7 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (2.9.0.post0)\n",
"Requirement already satisfied: importlib-resources>=3.2.0 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from matplotlib>=3.5->cartopy) (6.4.4)\n",
"Requirement already satisfied: certifi in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from pyproj>=3.3.1->cartopy) (2024.7.4)\n",
"Requirement already satisfied: zipp>=3.1.0 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from importlib-resources>=3.2.0->matplotlib>=3.5->cartopy) (3.20.1)\n",
"Requirement already satisfied: six>=1.5 in c:\\users\\pietro.viglino\\desktop\\progetti\\literacy.s4oceanice\\.venv\\lib\\site-packages (from python-dateutil>=2.7->matplotlib>=3.5->cartopy) (1.16.0)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\n",
"[notice] A new release of pip is available: 24.2 -> 25.0.1\n",
"[notice] To update, run: python.exe -m pip install --upgrade pip\n"
]
}
],
"source": [
"# @title\n",
"%%capture\n",
"!pip install cartopy\n",
"\n",
"from ipywidgets import Dropdown, Text, Output, Layout, interactive\n",
"from IPython.display import HTML, clear_output\n",
"from matplotlib.animation import FuncAnimation\n",
"from matplotlib import colors as mcolors\n",
"from matplotlib.cm import ScalarMappable\n",
"from io import BytesIO\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeature\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib.collections as mcoll\n",
"import numpy as np\n",
"import pandas as pd\n",
"import requests\n",
"import datetime\n",
"import warnings\n",
"import time\n",
"\n",
"warnings.filterwarnings('ignore')\n",
"\n",
"start_date = '2019-12-01'\n",
"end_date = '2020-03-10'"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 81,
"referenced_widgets": [
"4616d5e1926448118f5922e2b033099e",
"3ec70f2699d44ef19d7ac598c949e3a2",
"802261ac79e347bc9293b18a5c29ca6a",
"9e4fcfab0d844c7d963dafc4cec6d88f",
"4488d779061648b4af89cbee3915442c",
"5bc2e13bc5384c89956034cd302ce98d",
"9da6af65105c49c78391164fba9c2b96",
"3408160c6ade449b8ae3db9af5238190",
"034bba4ac4864fac9ce2ef96593981cf",
"a1f2b1f1dafc4837b97915ef8c096489"
]
},
"id": "pG0-cFae7tfi",
"outputId": "c3db0b0d-772d-47aa-f24e-f847431df530",
"tags": [
"hide-input",
"remove-cell"
]
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4616d5e1926448118f5922e2b033099e",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"interactive(children=(Text(value='2020-01-01', description='Start Date:', placeholder='2020-01-01'), Text(valu…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# # @title\n",
"# start_date = datetime.datetime.strptime('2020-01-01', \"%Y-%m-%d\").strftime(\"%Y-%m-%dT00:00:00Z\")\n",
"# end_date = datetime.datetime.strptime('2020-02-05', \"%Y-%m-%d\").strftime(\"%Y-%m-%dT00:00:00Z\")\n",
"\n",
"# start_date_input = Text(\n",
"# value='2020-01-01',\n",
"# placeholder='2020-01-01',\n",
"# description='Start Date:',\n",
"# disabled=False\n",
"# )\n",
"\n",
"# end_date_input = Text(\n",
"# value='2020-02-05',\n",
"# placeholder='2020-02-05',\n",
"# description='End Date:',\n",
"# disabled=False\n",
"# )\n",
"\n",
"# def display_date_range(start, end):\n",
"# global start_date\n",
"# global end_date\n",
"# try:\n",
"# start_date = datetime.datetime.strptime(start, \"%Y-%m-%d\")\n",
"# end_date = datetime.datetime.strptime(end, \"%Y-%m-%d\")\n",
"# if start_date <= end_date:\n",
"# start_date = start_date.strftime(\"%Y-%m-%dT00:00:00Z\")\n",
"# end_date = end_date.strftime(\"%Y-%m-%dT00:00:00Z\")\n",
"# except ValueError:\n",
"# pass\n",
"\n",
"# interactive_widget = interactive(display_date_range, start=start_date_input, end=end_date_input)\n",
"\n",
"# display(interactive_widget)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Data gathering"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SG4AUt1bic2F"
},
"source": [
"The following code cell will download a list of platforms with data satisfying the time range chosen for this example (2019-12-01 to 2020-03-10) and with latitude less or equal than -55. This list of platforms is then displayed below."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 424
},
"id": "O4rgCk8i9xzC",
"outputId": "d4b3e79f-145d-4453-9154-e9d41dfcad57",
"tags": [
"hide-input"
]
},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | platform_code | \n", "
---|---|
1 | \n", "85830 | \n", "
2 | \n", "85848 | \n", "
3 | \n", "86562 | \n", "
4 | \n", "86580 | \n", "
5 | \n", "87888 | \n", "
... | \n", "... | \n", "
64 | \n", "wd13-420BAT-16 | \n", "
65 | \n", "wd13-765-18 | \n", "
66 | \n", "wd13-880-18 | \n", "
67 | \n", "wd13-910-18 | \n", "
68 | \n", "wd13-911-18 | \n", "
68 rows × 1 columns
\n", "\n", " | platform_code | \n", "time | \n", "TEMP | \n", "PSAL | \n", "latitude | \n", "longitude | \n", "
---|---|---|---|---|---|---|
0 | \n", "85830 | \n", "2019-12-01 | \n", "-0.857891 | \n", "33.091719 | \n", "-65.466025 | \n", "76.928825 | \n", "
1 | \n", "85830 | \n", "2019-12-02 | \n", "-0.784172 | \n", "33.065922 | \n", "-65.422475 | \n", "76.962325 | \n", "
2 | \n", "85830 | \n", "2019-12-03 | \n", "-0.716719 | \n", "33.082547 | \n", "-65.440250 | \n", "76.880975 | \n", "
3 | \n", "85830 | \n", "2019-12-04 | \n", "-0.632563 | \n", "33.083969 | \n", "-65.400100 | \n", "76.777950 | \n", "
4 | \n", "85830 | \n", "2019-12-05 | \n", "-0.654484 | \n", "33.084797 | \n", "-65.413850 | \n", "76.693075 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
2239 | \n", "wd13-911-18 | \n", "2019-12-28 | \n", "-1.673009 | \n", "34.289086 | \n", "-66.050900 | \n", "142.225500 | \n", "
2240 | \n", "wd13-911-18 | \n", "2019-12-29 | \n", "-1.590236 | \n", "34.284033 | \n", "-66.001992 | \n", "142.056821 | \n", "
2241 | \n", "wd13-911-18 | \n", "2019-12-30 | \n", "-1.599414 | \n", "34.272934 | \n", "-66.004350 | \n", "141.929450 | \n", "
2242 | \n", "wd13-911-18 | \n", "2019-12-31 | \n", "-1.720421 | \n", "34.239960 | \n", "-65.997523 | \n", "141.830023 | \n", "
2243 | \n", "wd13-911-18 | \n", "2020-01-01 | \n", "-1.722475 | \n", "34.183049 | \n", "-66.084431 | \n", "142.192408 | \n", "
2244 rows × 6 columns
\n", "\n", " | PSAL | \n", "PRES | \n", "TEMP | \n", "latitude | \n", "longitude | \n", "time | \n", "platform_code | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "34.184635 | \n", "1.0 | \n", "1.857105 | \n", "-54.721316 | \n", "91.0963 | \n", "2019-12-01 04:33:57 | \n", "85848 | \n", "
1 | \n", "34.184635 | \n", "2.0 | \n", "1.857105 | \n", "-54.721316 | \n", "91.0963 | \n", "2019-12-01 04:33:57 | \n", "85848 | \n", "
2 | \n", "34.184635 | \n", "3.0 | \n", "1.857105 | \n", "-54.721316 | \n", "91.0963 | \n", "2019-12-01 04:33:57 | \n", "85848 | \n", "
3 | \n", "34.181420 | \n", "4.0 | \n", "1.846964 | \n", "-54.721316 | \n", "91.0963 | \n", "2019-12-01 04:33:57 | \n", "85848 | \n", "
4 | \n", "34.175495 | \n", "5.0 | \n", "1.828237 | \n", "-54.721316 | \n", "91.0963 | \n", "2019-12-01 04:33:57 | \n", "85848 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
735599 | \n", "34.493000 | \n", "126.0 | \n", "-1.781000 | \n", "-66.026900 | \n", "142.2741 | \n", "2020-01-01 22:10:00 | \n", "wd13-911-18 | \n", "
735600 | \n", "34.503000 | \n", "150.0 | \n", "-1.731000 | \n", "-66.026900 | \n", "142.2741 | \n", "2020-01-01 22:10:00 | \n", "wd13-911-18 | \n", "
735601 | \n", "34.520000 | \n", "170.0 | \n", "-1.840000 | \n", "-66.026900 | \n", "142.2741 | \n", "2020-01-01 22:10:00 | \n", "wd13-911-18 | \n", "
735602 | \n", "34.528000 | \n", "200.0 | \n", "-1.829000 | \n", "-66.026900 | \n", "142.2741 | \n", "2020-01-01 22:10:00 | \n", "wd13-911-18 | \n", "
735603 | \n", "34.530000 | \n", "210.0 | \n", "-1.828000 | \n", "-66.026900 | \n", "142.2741 | \n", "2020-01-01 22:10:00 | \n", "wd13-911-18 | \n", "
735604 rows × 7 columns
\n", "