diff --git a/examples/1_creating_an_OSNAP_section.ipynb b/examples/1_creating_an_OSNAP_section.ipynb index 9d5d8bc..ddb508e 100644 --- a/examples/1_creating_an_OSNAP_section.ipynb +++ b/examples/1_creating_an_OSNAP_section.ipynb @@ -1,25 +1,33 @@ { "cells": [ { - "cell_type": "code", - "execution_count": 1, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Computing velocity-grid following sections with `sectionate`\n", + "\n", + "In this example, we use the `sectionate.grid_section` function to find the indices for the series of grid cell faces (corresponding to velocity points on an Arakawa \"C-grid\" model such as MOM6) that best approximate a hydrographic section input by the user. In this case, we consider both the West and East sections of the *Overturning of the Subpolar North Atlantic (OSNAP)* observational program.\n", + "\n", + "We consider both cases of MOM6's horizontal grid configurations: non-symmetric (excluding the cell faces at the western and southern edges of the domain; also used in MOM5 and the MITgcm C-grids) and symmetric (including all tracer cell faces)." + ] + }, + { + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "%load_ext autoreload\n", - "%autoreload 2" + "## Import packages" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Sectionate version: 0.5.0\n" + "Sectionate version: 0.3.3\n" ] } ], @@ -33,17 +41,6 @@ "print(f\"Sectionate version: {sectionate.__version__}\")" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Computing velocity-grid following sections with `sectionate`\n", - "\n", - "In this example, we use the `sectionate.grid_section` function to find the indices for the series of grid cell faces (corresponding to velocity points on an Arakawa \"C-grid\" model such as MOM6) that best approximate a hydrographic section input by the user. In this case, we consider both the West and East sections of the *Overturning of the Subpolar North Atlantic (OSNAP)* observational program.\n", - "\n", - "We consider both cases of MOM6's horizontal grid configurations: non-symmetric (excluding the cell faces at the western and southern edges of the domain; also used in MOM5 and the MITgcm C-grids) and symmetric (including all tracer cell faces)." - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -67,7 +64,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -108,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -126,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -140,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -184,7 +181,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -206,7 +203,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -245,7 +242,7 @@ "tags": [] }, "source": [ - "### 2. Symmetric grid example (MOM6)" + "### B) Symmetric grid example (MOM6)" ] }, { @@ -257,7 +254,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -277,7 +274,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -297,7 +294,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -311,7 +308,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -347,7 +344,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -360,7 +357,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -369,7 +366,7 @@ "(np.float64(-50.0), np.float64(0.0), np.float64(51.0), np.float64(67.0))" ] }, - "execution_count": 14, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" }, @@ -429,7 +426,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -486,7 +483,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -512,7 +509,7 @@ " 'Western Europe']" ] }, - "execution_count": 16, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -530,7 +527,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -581,7 +578,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -617,7 +614,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -631,7 +628,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -676,7 +673,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -697,7 +694,7 @@ " - Section(OSNAP East, [(-44.0, 64.0), (-42.0, 60.5), (-31.0, 59.0), (-28.0, 58.25), (-15.0, 58.0), (-12.5, 57.5), (-9.5, 57.25), (-5.0, 56.75)])" ] }, - "execution_count": 21, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -719,7 +716,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -739,7 +736,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 22, "metadata": {}, "outputs": [ { diff --git a/examples/2_OSNAP_transports_CM4p25.ipynb b/examples/2_OSNAP_transports_CM4p25.ipynb index 1fe7687..8d81c42 100644 --- a/examples/2_OSNAP_transports_CM4p25.ipynb +++ b/examples/2_OSNAP_transports_CM4p25.ipynb @@ -1,25 +1,31 @@ { "cells": [ { - "cell_type": "code", - "execution_count": 1, + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "# Conservatively diagnosing model transports across arbitrary sections with `sectionate`" + ] + }, + { + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "%load_ext autoreload\n", - "%autoreload 2" + "## Import packages" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Sectionate version: 0.5.0\n" + "Sectionate version: 0.3.3\n" ] } ], @@ -33,15 +39,6 @@ "print(f\"Sectionate version: {sectionate.__version__}\")" ] }, - { - "cell_type": "markdown", - "metadata": { - "tags": [] - }, - "source": [ - "# Conservatively diagnosing model transports across arbitrary sections with `sectionate`" - ] - }, { "cell_type": "markdown", "metadata": { @@ -53,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -71,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -94,7 +91,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -108,7 +105,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": { "tags": [] }, @@ -153,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -171,7 +168,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -199,7 +196,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -252,7 +249,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [], "source": [ @@ -268,7 +265,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -282,7 +279,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -325,7 +322,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -343,7 +340,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -371,7 +368,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -431,7 +428,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -445,7 +442,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -463,7 +460,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -516,7 +513,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -537,7 +534,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "metadata": {}, "outputs": [ { diff --git a/examples/3_Labrador_convergence_CM4p25.ipynb b/examples/3_Labrador_convergence_CM4p25.ipynb index 716cf86..d0ae29f 100644 --- a/examples/3_Labrador_convergence_CM4p25.ipynb +++ b/examples/3_Labrador_convergence_CM4p25.ipynb @@ -1,13 +1,19 @@ { "cells": [ { - "cell_type": "code", - "execution_count": 9, + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "# Conservatively diagnosing model transports into an arbitrary closed region with `sectionate`" + ] + }, + { + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "%load_ext autoreload\n", - "%autoreload 2" + "## Import packages" ] }, { @@ -19,7 +25,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Sectionate version: 0.5.0\n" + "Sectionate version: 0.3.3\n" ] } ], @@ -33,15 +39,6 @@ "print(f\"Sectionate version: {sectionate.__version__}\")" ] }, - { - "cell_type": "markdown", - "metadata": { - "tags": [] - }, - "source": [ - "# Conservatively diagnosing model transports into an arbitrary closed region with `sectionate`" - ] - }, { "cell_type": "markdown", "metadata": { diff --git a/examples/4_sections_on_global_tripolar_grid.ipynb b/examples/4_sections_on_global_tripolar_grid.ipynb index a358c29..37941fb 100644 --- a/examples/4_sections_on_global_tripolar_grid.ipynb +++ b/examples/4_sections_on_global_tripolar_grid.ipynb @@ -1,13 +1,21 @@ { "cells": [ { - "cell_type": "code", - "execution_count": 18, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Testing the limits of `sectionate` with various edge cases\n", + "\n", + "Can `sectionate` handle the curvilinear geometry and complicated topology of the tripolar configuration of MOM? ***Yes.***\n", + "\n", + "This notebook demonstrates its correct behavior in a number of non-trivial edge cases in which sections cross grid boundaries." + ] + }, + { + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "%load_ext autoreload\n", - "%autoreload 2" + "## Import packages" ] }, { @@ -19,7 +27,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Sectionate version: 0.5.0\n" + "Sectionate version: 0.3.3\n" ] } ], @@ -39,6 +47,13 @@ "print(f\"Sectionate version: {sectionate.__version__}\")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Define plotting functions" + ] + }, { "cell_type": "code", "execution_count": 2, @@ -106,18 +121,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Testing the limits of `sectionate` with various edge cases\n", - "\n", - "Can `sectionate` handle the curvilinear geometry and complicated topology of the tripolar configuration of MOM? ***Yes.***\n", - "\n", - "This notebook demonstrates its correct behavior in a number of non-trivial edge cases in which sections cross grid boundaries." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 0. Load the model grid" + "## Load the model grid" ] }, { @@ -232,7 +236,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### Sectionate requires intermediate points to disambiguate zonal sections longer than 180º" + "**Note:** Sectionate requires intermediate points to disambiguate zonal sections longer than 180º." ] }, { @@ -255,7 +259,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Incorrect use: no intermediate points $\\rightarrow$ no section required to connect consecutive points" + "### Incorrect use: no intermediate points $\\rightarrow$ no section required to connect consecutive points" ] }, { @@ -291,7 +295,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Incorrect use: intermediate points more than 180º apart $\\rightarrow$ shortest subsections do not cirumnavigate (and just go out and back)" + "### Incorrect use: intermediate points more than 180º apart $\\rightarrow$ shortest subsections do not cirumnavigate (and just go out and back)" ] }, { @@ -327,7 +331,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Correct use: series of intermediate points less than 180º apart " + "### Correct use: series of intermediate points less than 180º apart " ] }, { @@ -536,7 +540,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "##### Caution: sectionate has some difficulty when dealing with paths that traverse through the tripolar seams, apparently because it has to temporarily move backwards (go farther away from the target point) in order to make forward progress." + "**Caution:** sectionate has some difficulty when dealing with paths that traverse through the tripolar seams, apparently because it has to temporarily move backwards (go farther away from the target point) in order to make forward progress." ] }, { diff --git a/examples/5_MOC_transports_CM4p25.ipynb b/examples/5_MOC_transports_CM4p25.ipynb index e30d681..0d5d099 100644 --- a/examples/5_MOC_transports_CM4p25.ipynb +++ b/examples/5_MOC_transports_CM4p25.ipynb @@ -1,13 +1,19 @@ { "cells": [ { - "cell_type": "code", - "execution_count": 8, + "cell_type": "markdown", + "metadata": { + "tags": [] + }, + "source": [ + "# Diagnosing the Meridional Overturning Circulation on a tripolar grid with `sectionate`" + ] + }, + { + "cell_type": "markdown", "metadata": {}, - "outputs": [], "source": [ - "%load_ext autoreload\n", - "%autoreload 2" + "## Import packages" ] }, { @@ -19,7 +25,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Sectionate version: 0.5.0\n" + "Sectionate version: 0.3.3\n" ] } ], @@ -34,15 +40,6 @@ "print(f\"Sectionate version: {sectionate.__version__}\")" ] }, - { - "cell_type": "markdown", - "metadata": { - "tags": [] - }, - "source": [ - "# Conservatively diagnosing model transports across arbitrary sections with `sectionate`" - ] - }, { "cell_type": "markdown", "metadata": { @@ -88,8 +85,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 21.4 ms, sys: 19.8 ms, total: 41.2 ms\n", - "Wall time: 44 ms\n" + "CPU times: user 22.3 ms, sys: 21.7 ms, total: 44 ms\n", + "Wall time: 49.2 ms\n" ] } ], @@ -186,8 +183,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "CPU times: user 35.1 s, sys: 1.55 s, total: 36.6 s\n", - "Wall time: 37.5 s\n" + "CPU times: user 34.8 s, sys: 1.65 s, total: 36.5 s\n", + "Wall time: 37.2 s\n" ] } ],