{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Quick introduction\n", "\n", "## Reading and plotting" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-02-27T15:11:52.889322Z", "iopub.status.busy": "2024-02-27T15:11:52.888912Z", "iopub.status.idle": "2024-02-27T15:11:53.421020Z", "shell.execute_reply": "2024-02-27T15:11:53.420029Z" }, "scrolled": false }, "outputs": [], "source": [ "import io\n", "import requests\n", "from pathlib import Path\n", "\n", "\n", "def download_demo_file(url):\n", " if not Path(\"CTD-spiked-unfiltered.cnv.bz2\").exists():\n", " response = requests.get(url, allow_redirects=True)\n", " try:\n", " response.raise_for_status()\n", " except requests.exceptions.HTTPError as err:\n", " raise requests.exceptions.HTTPError(f\"{response.content.decode()}\") from err\n", " data = io.BytesIO(response.content)\n", " data.seek(0)\n", " Path(\"CTD-spiked-unfiltered.cnv.bz2\").write_bytes(data.read())\n", "\n", "\n", "url = \"https://github.com/pyoceans/python-ctd/raw/main/tests/data/CTD-spiked-unfiltered.cnv.bz2\"\n", "download_demo_file(url)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-02-27T15:11:53.423678Z", "iopub.status.busy": "2024-02-27T15:11:53.423225Z", "iopub.status.idle": "2024-02-27T15:12:04.765097Z", "shell.execute_reply": "2024-02-27T15:12:04.764555Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | scan | \n", "timeS | \n", "t090C | \n", "t190C | \n", "c0S/m | \n", "c1S/m | \n", "sbeox0V | \n", "par | \n", "spar | \n", "ph | \n", "... | \n", "longitude | \n", "pumps | \n", "pla | \n", "sbeox0PS | \n", "sbeox0Mm/Kg | \n", "dz/dtM | \n", "accM | \n", "flSP | \n", "xmiss | \n", "flag | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Pressure [dbar] | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
6.433 | \n", "1.0 | \n", "0.000 | \n", "26.9647 | \n", "26.9314 | \n", "5.821803 | \n", "5.800920 | \n", "2.1099 | \n", "1.000000e-12 | \n", "0.0000 | \n", "8.575 | \n", "... | \n", "-37.22588 | \n", "False | \n", "26.970 | \n", "69.61016 | \n", "137.397 | \n", "0.000 | \n", "0.00 | \n", "0.16484 | \n", "99.2996 | \n", "False | \n", "
6.448 | \n", "2.0 | \n", "0.042 | \n", "26.9644 | \n", "26.9307 | \n", "5.821615 | \n", "5.800819 | \n", "2.1148 | \n", "1.000000e-12 | \n", "1.9601 | \n", "8.580 | \n", "... | \n", "-37.22588 | \n", "False | \n", "26.969 | \n", "69.82216 | \n", "137.817 | \n", "0.351 | \n", "8.43 | \n", "0.16484 | \n", "99.3260 | \n", "False | \n", "
6.433 | \n", "3.0 | \n", "0.083 | \n", "26.9642 | \n", "26.9301 | \n", "5.821421 | \n", "5.800727 | \n", "2.1209 | \n", "1.000000e-12 | \n", "0.0000 | \n", "8.575 | \n", "... | \n", "-37.22588 | \n", "False | \n", "26.969 | \n", "70.08688 | \n", "138.341 | \n", "-0.351 | \n", "-16.87 | \n", "0.16606 | \n", "99.3260 | \n", "False | \n", "
6.448 | \n", "4.0 | \n", "0.125 | \n", "26.9639 | \n", "26.9296 | \n", "5.821264 | \n", "5.800727 | \n", "2.1270 | \n", "1.000000e-12 | \n", "0.0000 | \n", "8.575 | \n", "... | \n", "-37.22588 | \n", "False | \n", "26.969 | \n", "70.35184 | \n", "138.865 | \n", "0.351 | \n", "16.86 | \n", "0.16606 | \n", "99.3260 | \n", "False | \n", "
6.433 | \n", "5.0 | \n", "0.167 | \n", "26.9640 | \n", "26.9291 | \n", "5.821219 | \n", "5.800634 | \n", "2.1331 | \n", "1.000000e-12 | \n", "0.0000 | \n", "8.575 | \n", "... | \n", "-37.22588 | \n", "False | \n", "26.969 | \n", "70.61657 | \n", "139.388 | \n", "-0.351 | \n", "-16.86 | \n", "0.16606 | \n", "99.3525 | \n", "False | \n", "
5 rows × 30 columns
\n", "\n", " | t090C | \n", "c0S/m | \n", "
---|---|---|
8.0 | \n", "26.975256 | \n", "5.845194 | \n", "
9.0 | \n", "26.975653 | \n", "5.845291 | \n", "
10.0 | \n", "26.976037 | \n", "5.845386 | \n", "
11.0 | \n", "26.976401 | \n", "5.845478 | \n", "
12.0 | \n", "26.976740 | \n", "5.845565 | \n", "