From a983f17a5cb1a88dd3a105fa9bc0694567bf5703 Mon Sep 17 00:00:00 2001
From: robfatland <rob5@uw.edu>
Date: Wed, 21 Aug 2024 08:58:17 -0700
Subject: [PATCH] ok

---
 book/chapters/data.ipynb         |   4 +-
 book/chapters/oceanscience.ipynb | 167 +++++++++++++++++++++++--------
 2 files changed, 126 insertions(+), 45 deletions(-)

diff --git a/book/chapters/data.ipynb b/book/chapters/data.ipynb
index 1c47c92..0ed6044 100644
--- a/book/chapters/data.ipynb
+++ b/book/chapters/data.ipynb
@@ -4,7 +4,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "[Jupyter Book](https://geo-smart.github.io/oceanography/chapters/data.html) and [GitHub repo](https://github.com/geo-smart/oceanography).\n",
+    "[Jupyter Book](https://geo-smart.github.io/oceanography/chapters/data.html) \n",
+    "<br>\n",
+    "[GitHub repo](https://github.com/geo-smart/oceanography).\n",
     "\n",
     "\n",
     "# Data\n",
diff --git a/book/chapters/oceanscience.ipynb b/book/chapters/oceanscience.ipynb
index f21957e..ee8bd84 100644
--- a/book/chapters/oceanscience.ipynb
+++ b/book/chapters/oceanscience.ipynb
@@ -4,7 +4,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "[Jupyter Book](https://geo-smart.github.io/oceanography/intro.html) and [GitHub repo](https://github.com/geo-smart/oceanography).\n",
+    "[Jupyter Book](https://geo-smart.github.io/oceanography/chapters/oceanscience.html) \n",
+    "<br> [GitHub repo](https://github.com/geo-smart/oceanography)\n",
+    "<br> [RCA Learning Site](https://interactiveoceans.washington.edu)\n",
     "\n",
     "\n",
     "\n",
@@ -15,7 +17,7 @@
     "> But I now leave my cetological System standing thus unfinished, even as the great Cathedral of Cologne was left, with the crane still standing upon the top of the uncompleted tower. \\[For small monuments\\] may be finished by their first architects; grand ones, true ones, ever leave the copestone to posterity. God keep me from ever completing anything. This whole book is but a draught—nay, but the draught of a draught. Oh, Time, Strength, Cash, and Patience! <br><br> -Herman Melville\n",
     "\n",
     "\n",
-    "**Note: until images inline for both the Jupyter Notebook *and* the Jupyter Book: I will double up.**\n",
+    "**Note: Until fixed: Not appearing properly: Inline images in both the Jupyter Notebook and the Jupyter Book ontext: Temporary solution is to simply double up.**\n",
     "\n",
     "\n",
     "```{figure} ../img/revelle.jpg\n",
@@ -45,8 +47,7 @@
     "starting at the chapter on **`data`** goes into the technical means behind the science.\n",
     "\n",
     "\n",
-    "Let us begin, then, by attempting to frame the science, beginning \n",
-    "with an ambitious question:\n",
+    "Let us begin with an ambitious question:\n",
     "<br>"
    ]
   },
@@ -54,25 +55,26 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "${\\Large \\textrm{How stable is the epipelagic ocean?}}$\n",
+    "###### ${\\Large \\textrm{How stable is the epipelagic ocean?}}$\n",
     "\n",
     "\n",
-    "This question by itself is simplistic so let's qualify its meaning.\n",
+    "With that let's qualify what we mean.\n",
     "\n",
     "\n",
     "\n",
     "### *Epipelagic ocean* defined\n",
     "\n",
     "\n",
-    "Pelagic refers to the ocean water column, particularly away from the shore. \n",
-    "*Epipelagic* is then the *upper* water column and the term is synonymous with \n",
-    "*sun illuminated* or *photic*.  The most common expressions are \n",
-    "*epipelagic zone* and *photic zone*.\n",
-    "This is the upper 200 meters of the water column subjected \n",
-    "to downwelling sunlight. Sunlight is in turn the energy source of primary \n",
-    "production: Photosynthesis primarily by plankton. So we are looking at\n",
-    "the ecosystem of the upper ocean: The biological engine powering\n",
-    "life in the ocean.\n",
+    "Pelagic refers to the ocean water column, surface to sea floor, and \n",
+    "specifically some distance away from the shore. \n",
+    "*Epipelagic* is then the *upper* water column and the term coincides \n",
+    "with *sun illuminated* or *photic*.  In fact the most common expressions \n",
+    "are '*epipelagic zone*' and '*photic zone*':\n",
+    "This is the upper 200 meters of the water column subject to \n",
+    "downwelling sunlight. Sunlight is the energy source for primary \n",
+    "production, i.e. photosynthesis primarily of plankton. *Epipelagic*\n",
+    "is then the ecosystem of the upper ocean including this biological \n",
+    "engine that powers much of the life in the ocean.\n",
     "\n",
     "\n",
     "Our observational starting point is three observing sites located in the \n",
@@ -80,21 +82,49 @@
     "\n",
     "\n",
     "```\n",
-    "Site name               Latitude          Longitude\n",
-    "------------------      --------          ---------\n",
-    "Oregon Offshore         44.37415          -124.95648\n",
-    "Oregon Slope Base       44.52897          -125.38966 \n",
-    "Axial Base              45.83049          -129.75326\n",
-    "```   \n",
+    "Site name           Latitude  Longitude   Depth (m)  D-offshore (km)\n",
+    "-----------------   --------  ---------   ---------  ---------------\n",
+    "Oregon Offshore     44.37     -124.96      577        67\n",
+    "Oregon Slope Base   44.53     -125.39     2910       101\n",
+    "Axial Base          45.83     -129.75     2620       453 \n",
+    "```\n",
     "\n",
     "\n",
     "\n",
-    "Our initial observational focus is a\n",
+    "Our initial focus is a\n",
     "[shallow profiler](https://interactiveoceans.washington.edu/technology/shallow-profiler-moorings/) \n",
-    "maintained and by the Regional Cabled Array program located at the Oregon Slope Base site. \n",
-    "The shallow profiler generates a record of the state of the upper ocean with both time and \n",
-    "depth at fine scale. From this observational starting point we proceed to add other resources\n",
-    "including ARGO drifters, satellites, and NOAA buoys."
+    "maintained and by the Regional Cabled Array program at the Oregon Slope Base site. \n",
+    "The shallow profiler generates a record of the state of the upper ocean at fine scale \n",
+    "both in time and in depth. Once we have a handle on shallow profiler observations\n",
+    "we can proceed to add other sensor resources such as ARGO drifters, satellites, and NOAA buoys."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "67.06354079832528 101.96806724387616 452.8567919405785\n"
+     ]
+    }
+   ],
+   "source": [
+    "# using a spherical earth approximation here are offhore distances \n",
+    "from math import cos, pi\n",
+    "re=6378.\n",
+    "d_oof = .95648 - .10448\n",
+    "d_osb = 1.38966 - .09422\n",
+    "d_axb = 5.75326  # using shore lon = -124\n",
+    "d2r = pi/180\n",
+    "km_per_rad = (cos(pi/4)*(2*pi*re))/(2*pi)\n",
+    "s_oof = d_oof*d2r*km_per_rad\n",
+    "s_osb = d_osb*d2r*km_per_rad\n",
+    "s_axb = d_axb*d2r*km_per_rad\n",
+    "print(s_oof, s_osb, s_axb)"
    ]
   },
   {
@@ -162,10 +192,32 @@
     "\n",
     "\n",
     "*Coincidence* refers to ocean structure that persists across multiple sensor streams. \n",
-    "*Persistence* refers to structures that persist in time, i.e. for multiple consecutive observations.\n",
+    "*Persistence* refers to structures that persist in time, i.e. for multiple consecutive observations. Let's take a moment to anticipate both (coming up in the next chapter).\n",
+    "\n",
+    "\n",
+    "Suppose a smooth data curve concerned with temperature has a noticeable 'jag' or\n",
+    "anomaly in measurement at a depth of 100 meters. Perhaps this reflects actual \n",
+    "water temperature or it may be due to a temporary sensor issue. We can turn to\n",
+    "another sensor -- say salinity or chlorophyll -- and look for a matching anomaly \n",
+    "at a comparable depth. If present: We have evidence that the anomaly is in fact\n",
+    "due to the water via coincidence. \n",
+    "\n",
     "\n",
+    "Continuing onward from this point: Temperature data is collected on both ascent and\n",
+    "descent over the course of more than an hour. Seeing the above anomaly in both profiler\n",
+    "phases is an example of persistence of a signal of interest. Even stronger evidence:\n",
+    "The anomaly appears over the course of multiple profiles (of which there are nine \n",
+    "per day).\n",
     "\n",
-    "### How stable is the epipelagic ocean?\n",
+    "\n",
+    "To take this one step further: We will find that the shallow profiler also measures\n",
+    "water velocity as a function of depth. Suppose an anomaly persists for two days and\n",
+    "the upper water column has a consistent velocity of 2 kilometers per hour southward.\n",
+    "This suggests a water mass 100 kilometers across has drifted past the profiler site;\n",
+    "an estimate that could be compared with satellite data, both spectral and sea level anomaly. \n",
+    "\n",
+    "\n",
+    "### Returning to the question *How stable is the epipelagic ocean?*\n",
     "\n",
     "\n",
     "The water column is well understood as stratified. The upper layer is\n",
@@ -194,14 +246,32 @@
     "### Ocean chemistry\n",
     "\n",
     "\n",
-    "Let's begin with a table of molecules.\n",
+    "Let's motivate a very simple table of atoms and molecules distributed \n",
+    "in the ocean. We have on the one hand the physical ocean with tides and \n",
+    "currents and sunlight; we have ocean chemistry including pH and salinity (salt concentration); \n",
+    "and we have biology: Life in the ocean from plankton to apex predators.\n",
+    "These topics are interconnected and the \n",
+    "umbrella term invented for all of it -- with a particular eye to how\n",
+    "carbon is transported and stored -- is **biogeochemistry**. (For \n",
+    "a great deal more on the topic visit this\n",
+    "[ocean carbon and biogeochemistry website](https://www.us-ocb.org/).)\n",
+    "\n",
+    "\n",
+    "The following table is sorted in terms of molecular mass in Daltons.\n",
+    "(One Dalton is effectively the mass of a single hydrogen atom.) \n",
+    "The last three entries are life-based or *organic* compounds. \n",
+    "[Chlorophyll](https://en.wikipedia.org/wiki/Chlorophyll) is of particular\n",
+    "interest as the central agent in photosynthesis: Absorbing and transferring\n",
+    "light energy within a structure called a photosystem. \n",
     "\n",
     "    \n",
     "| Mass (Daltons) | Substance | Comment on measurement\n",
     "|---|---|---\n",
-    "|1|Hydrogen ion H<sup>+</sup> | pH sensor\n",
+    "|1|Hydrogen cation H<sup>+</sup> | pH sensor\n",
     "|17|Hydroxide ion OH<sup>-</sup> | -no direct observation-\n",
-    "|18|Water H<sub>2</sub>O | temperature and salinity sensors\n",
+    "|18|Water H<sub>2</sub>O | temperature, salinity, light sensors\n",
+    "|?|Calcium| -no direct observation-\n",
+    "|?|Silica| -no direct observation-\n",
     "|46|carbon dioxide CO<sub>2</sub> | 'partial pressure' pCO2 sensor\n",
     "|62|carbonic acid H<sub>2</sub>CO<sub>3</sub> | by inference\n",
     "|61|bicarbonate anion HCO<sub>3</sub><sup>-</sup> | by inference\n",
@@ -218,22 +288,31 @@
    "source": [
     "### Ocean structure\n",
     "\n",
+    "In addition to chemical composition here are some further attributes of the ocean.\n",
     "\n",
-    "- The ocean is 3700 meters in depth on average\n",
+    "- Locations in the ocean are given precisely in terms of latitude and longitude\n",
+    "    - Informally we discuss location using historical terminology\n",
+    "        - Example: The Coral and Tasman Seas are regions of the southwestern Pacific Ocean \n",
+    "- The ocean is 3700 meters deep on average, covering 70% of the earth's surface\n",
     "- Coastal ocean water (shelf water) is six times as productive as the deep ocean\n",
-    "- The photic zone is about 200 meters so 90% of the ocean is perpetually dark\n",
-    "- Heat capacity of seawater versus atmosphere\n",
-    "- Water temperature decreases with depth\n",
-    "    - Geothermal heat at the sea floor\n",
-    "- Salinity increases with depth\n",
-    "- Ocean water has greater capacity for dissolved oxygen (DO) with lower temperature\n",
-    "    - Dissolved oxygen concentration is affected by biological respiration\n",
-    "- Carbon dioxide is complicated\n",
-    "    - A more appropriate term to use is carbonate chemistry\n",
+    "- The photic zone is the upper 200 meters of the ocean\n",
+    "    - Consequently 90% of the ocean is in perpetual darkness\n",
+    "- Remark on the heat capacity of seawater relative to that of the atmosphere, to land\n",
+    "- Water temperature decreases with depth and is fairly constant below the thermocline\n",
+    "    - Geothermal heat emanates from the earth's interior: At the sea floor\n",
+    "    - Ocean spreading centers feature hydrothermal vents\n",
+    "- Salinity increases with depth, typically stable below the halocline\n",
+    "- Ocean water has the capacity to hold oxygen: A dissolved gas\n",
+    "    - This holding capacity increases with lower water temperature\n",
+    "    - Dissolved oxygen is depleted by biological respiration\n",
+    "- Carbon dioxide is an atmospheric gas that dissolves in the ocean\n",
+    "    - Within the ocean: Carbon dioxide is converted to carbonic acid\n",
+    "    - Carbonic acid in turn dissociates to bicarbonate and hydrogen ions\n",
+    "    - Collectively this is called *carbonate chemistry*\n",
     "- Productivity primarily refers to photosynthesis by phytoplankton\n",
-    "    - Photosynthesis is bounded on the low side by limited availability of nutrients and sunlight\n",
-    "    - Photosynthesis is bounded on the high side by saturation\n",
-    "- Nutrients: Nitrate and  \n",
+    "    - Photosynthesis is bounded on the low side by availability of nutrients and sunlight\n",
+    "    - Photosynthesis is bounded on the high side by saturation (availability of chlorophyll)\n",
+    "- Nutrients: Nitrate  \n",
     "    "
    ]
   },