{
"cells": [
{
"cell_type": "raw",
"id": "3db54f47-6ef5-46af-aa61-e4975c252ad2",
"metadata": {},
"source": [
"---\n",
"title: Tutorial 3 - Make way for MOANA (Multi Ordination ANAlysis)\"\n",
"author: Ryan Vandermeulen (NOAA)\n",
"---"
]
},
{
"cell_type": "markdown",
"id": "07a90f3b-521a-4d61-8052-1363dbbef646",
"metadata": {},
"source": [
"[][colab-link]\n",
"\n",
" \n",
" [][download-link] [][jupyter-link]\n",
"\n",
"[download-link]: https://github.com/nmfs-opensci/EDMW-EarthData-Workshop-2025/blob/main/tutorials/clean/Tutorial_3_moana-erddap.ipynb\n",
"[colab-link]: https://colab.research.google.com/github/nmfs-opensci/EDMW-EarthData-Workshop-2025/blob/main/tutorials/clean/Tutorial_3_moana-erddap.ipynb\n",
"[jupyter-link]: https://workshop.nmfs-openscapes.2i2c.cloud/hub/user-redirect/lab?fromURL=https://raw.githubusercontent.com/nmfs-opensci/EDMW-EarthData-Workshop-2025/main/tutorials/clean/Tutorial_3_moana-erddap.ipynb"
]
},
{
"cell_type": "markdown",
"id": "9cc3aa99-fec2-41bd-b517-01393900d01f",
"metadata": {},
"source": [
">📘 Learning Objectives\n",
">\n",
"> 1. Create pretty maps of the three phytoplankton classes in MOANA\n",
"> 2. Plot how all three of these phytoplankton classes change in relation to latitude\n",
"> 3. Plot how all three of these phytoplankton classes change over the course of 1 year\n",
"> 4. Create a ternary plot and map that shows where each phytoplankton class dominates\n"
]
},
{
"cell_type": "markdown",
"id": "442bd92a-8f2d-4448-a59e-da4567710730",
"metadata": {},
"source": [
"## You will need 3.7Gb for this tutorial\n",
"\n",
"Go to File > Hub Control Panel > Stop my server\n",
"\n",
"Then restart after choosing 3.7 Gb in the drop-down.\n",
"\n",
"## Interacting with multiple phytoplankton groups simultaneously\n",
"\n",
"MOANA is the first phytoplankton community composition algorithm to be released by PACE. This product returns near-surface concentrations (cells mL-1) of three different picophytoplankton (i.e., phytoplankton <2 μm in size): Prochlorococcus, Synechococcus, and autotrophic picoeukaryotes (Figure 15). The algorithm uses empirical relationships between measured cell concentrations, in situ hyperspectral remote sensing reflectances, and sea surface temperatures. Details of this algorithm can be found in [Lange et al. (2020)](https://doi.org/10.1364/OE.398127).\n",
"\n",
"Picophytoplankton are composed of the cyanobacteria Prochlorococcus (∼0.8 µm) and Synechococcus (∼1 µm), as well as picoeukaryotes, which combined are responsible for 50 to 90% of all primary production in open ocean ecosystems and contribute up to 30% of carbon export in these regions. Geographically, Prochlorococcus tends to inhabit warmer and mostly oligotrophic waters surrounded by Synechococcus patches along frontal boundaries. These fronts often reside at boundaries where phytoplankton communities start to transition to higher concentrations of larger eukaryotic cells, such as picoeukaryotes and nanoeukaryotic flagellates. Thus, identification of Prochlorococcus and Synechococcus distributions may be useful in identifying trophic boundaries in oceanic ecosystems, in addition to providing insight into productivity, food web regimes, and carbon export.\n",
"\n",
"Note, for now, the MOANA product is only available for the Atlantic Ocean."
]
},
{
"cell_type": "markdown",
"id": "5af15182-81cd-4742-b9cd-a07f33c2b9a2",
"metadata": {},
"source": [
"## Load the data from ERDDAP"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "d05417c1-06e7-47af-ae9a-28a2401e5a52",
"metadata": {},
"outputs": [],
"source": [
"# ---- Load Libraries ----\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import xarray as xr\n",
"import cartopy\n",
"import cartopy.crs as ccrs\n",
"import cartopy.feature as cfeature\n",
"\n",
"# ---- Load Data ----\n",
"url = \"https://cwcgom.aoml.noaa.gov/erddap/griddap/noaa_aoml_a113_ab04_933f\"\n",
"ds = xr.open_dataset(url)\n",
"\n",
"# --- Get first week of Sept 2024\n",
"ds = ds.sel(time=\"2024-09-01\")"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "9c4b08f5-50ee-433d-9cc2-4835cb1469d6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Size in GB: 0.11 GB\n"
]
},
{
"data": {
"text/plain": [
"Frozen({'latitude': 3360, 'longitude': 2640})"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(f\"Size in GB: {ds.nbytes / 1e9:.2f} GB\")\n",
"ds.sizes"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "2128e85a-552c-4dbe-99ab-4cd758548d21",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
<xarray.Dataset> Size: 106MB\n",
"Dimensions: (latitude: 3360, longitude: 2640)\n",
"Coordinates:\n",
" time datetime64[ns] 8B 2024-09-01\n",
" * latitude (latitude) float32 13kB 69.98 69.94 69.9 ... -69.94 -69.98\n",
" * longitude (longitude) float32 11kB -84.98 -84.94 ... 24.94 24.98\n",
"Data variables:\n",
" prococcus_moana (latitude, longitude) float32 35MB ...\n",
" syncoccus_moana (latitude, longitude) float32 35MB ...\n",
" picoeuk_moana (latitude, longitude) float32 35MB ...\n",
"Attributes: (12/71)\n",
" _lastModified: 2025-02-28T17:56:21.000Z\n",
" cdm_data_type: Grid\n",
" comment: This dataset is redistributed by Atlan...\n",
" Conventions: CF-1.10, ACDD-1.3, COARDS\n",
" creator_email: data@oceancolor.gsfc.nasa.gov\n",
" creator_name: NASA/GSFC/OBPG\n",
" ... ...\n",
" temporal_range: 7-day\n",
" time_coverage_end: 2025-03-02T00:00:00Z\n",
" time_coverage_start: 2024-04-18T00:00:00Z\n",
" title: OCI L3 SMI, PACE MOANA 8DAY; via Atlan...\n",
" Westernmost_Easting: -84.97916\n",
" westernmost_longitude: -85.0<xarray.DataArray 'prococcus_moana' (time: 41)> Size: 164B\n",
"array([ 76012.04 , 139162.08 , 177361.06 , 161316.4 , 222840.39 ,\n",
" 137385. , 142513.7 , 114853.05 , 29329.648, 222419.66 ,\n",
" 159956.17 , 99857.34 , 92749.43 , 93915.49 , 89002.47 ,\n",
" 78405.47 , 113439.734, 132991.88 , 105341.13 , 68365.78 ,\n",
" 85625. , 117346.81 , 87780.3 , 124836.06 , 76297.945,\n",
" 111245.4 , 130434.305, 147058. , 114212.92 , 197231.17 ,\n",
" 199400.97 , 268445.97 , 258324.56 , 255930.8 , 271919.44 ,\n",
" 263647.38 , 260969.44 , 230369.28 , 278427.03 , 246284.44 ,\n",
" 308866.66 ], dtype=float32)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 328B 2024-04-18 2024-04-26 ... 2025-03-02