Skip to content

added jspier's code for generating figures from DIA. - #318

Merged
mike-gangl merged 1 commit into
masterfrom
jspier_DIA
Sep 3, 2026
Merged

mike-gangl merged 1 commit into
masterfrom
jspier_DIA

Conversation

@mike-gangl

Copy link
Copy Markdown
Collaborator

Adding code from Jacob Spier's DIA work.

@mike-gangl
mike-gangl requested a lite review from Copilot September 3, 2026 16:46
@mike-gangl mike-gangl self-assigned this Sep 3, 2026
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A confirmed parsing bug in parse_bounding_polygon() (Figure 1 & 2 commons) can break footprint loading, and there are documentation issues including a future “Last Accessed” date and an incorrect data-location note.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds Jacob Spier’s “SWOT Data in Action” figure-generation materials to the Sea_Surface_to_Sea_Life DataStory, including runnable Python scripts and equivalent Jupytext-synced notebooks, plus setup and data-download documentation to reproduce the published figures.

Changes:

  • Added conda/pip dependency specifications and a data download guide for external satellite products.
  • Added Figure 1 (2x2 mosaic) and Figure 2 (1x3 triptych) scripts/notebooks plus shared figure*_common.py utilities for loading, plotting, and exporting modular “pieces”.
  • Added local .gitignore guidance to keep caches and notebook checkpoints out of version control.
File summaries
File Description
notebooks/DataStories/Sea_Surface_to_Sea_Life/requirements.txt Adds pip dependencies for running the figure scripts.
notebooks/DataStories/Sea_Surface_to_Sea_Life/README.md Documents figure contents, setup, quickstart, and attribution/source links.
notebooks/DataStories/Sea_Surface_to_Sea_Life/environment.yml Adds a conda environment definition for easier geospatial dependency installation.
notebooks/DataStories/Sea_Surface_to_Sea_Life/DATA.md Provides detailed instructions for acquiring required external datasets and directory layout.
notebooks/DataStories/Sea_Surface_to_Sea_Life/.gitignore Ignores Python caches and notebook checkpoint artifacts in this DataStory folder.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2.py Composite Figure 2 generator (two variants of panel A) and piece export driver.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2.ipynb Notebook equivalent of Figure2.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2_panelA.py Standalone generator/exporter for Figure 2 panel (a) (with/without MIOST background).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2_panelA.ipynb Notebook equivalent of Figure2_panelA.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2_panelB.py Standalone generator/exporter for Figure 2 panel (b) (VIIRS SST).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2_panelB.ipynb Notebook equivalent of Figure2_panelB.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2_panelC.py Standalone generator/exporter for Figure 2 panel (c) (VIIRS chlorophyll-a).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/Figure2_panelC.ipynb Notebook equivalent of Figure2_panelC.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 2/figure2_common.py Shared config, data loaders, drawing primitives, and modular piece renderer for Figure 2.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1.py Composite Figure 1 generator and piece export driver.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1.ipynb Notebook equivalent of Figure1.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelA.py Standalone generator/exporter for Figure 1 panel (a) (MUR SST + SWOT speed + globe inset).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelA.ipynb Notebook equivalent of Figure1_panelA.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelB.py Standalone generator/exporter for Figure 1 panel (b) (MIOST ADT + SWOT ADT + velocity).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelB.ipynb Notebook equivalent of Figure1_panelB.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelC.py Standalone generator/exporter for Figure 1 panel (c) (NISAR GCOV grayscale).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelC.ipynb Notebook equivalent of Figure1_panelC.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelD.py Standalone generator/exporter for Figure 1 panel (d) (PACE MOANA composite + legend).
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/Figure1_panelD.ipynb Notebook equivalent of Figure1_panelD.py.
notebooks/DataStories/Sea_Surface_to_Sea_Life/Data in Action Figure 1/figure1_common.py Shared config, data loaders, drawing primitives, and modular piece renderer for Figure 1.
Review details
  • Files reviewed: 25/109 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +186 to +189
def parse_bounding_polygon(wkt):
nums = re.findall(r"-?\d+\.\d+", wkt)
vals = np.array(nums, dtype=float).reshape(-1, 3)
return vals[:, 0], vals[:, 1]
Comment on lines +176 to +179
def parse_bounding_polygon(wkt):
nums = re.findall(r"-?\d+\.\d+", wkt)
vals = np.array(nums, dtype=float).reshape(-1, 3)
return vals[:, 0], vals[:, 1]
@@ -0,0 +1,106 @@
# SWOT Data in Action Figures

The Dataa In Action article can be found at [https://www.earthdata.nasa.gov/learn/data-in-action/from-sea-surface-sea-life-swot-pace-nisar-watch-gulf-stream-frontal-eddies](https://www.earthdata.nasa.gov/learn/data-in-action/from-sea-surface-sea-life-swot-pace-nisar-watch-gulf-stream-frontal-eddies)
Comment on lines +6 to +9
# conda env create -f environment.yml
# conda activate swot-dia
#
# Then follow DATA.md to download the input data into ./data/.
@mike-gangl
mike-gangl merged commit 157a3b9 into master Sep 3, 2026
2 checks passed
@tloubrieu-jpl tloubrieu-jpl moved this from needs:triage to closed in podaac Sep 3, 2026
@mike-gangl
mike-gangl deleted the jspier_DIA branch September 3, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: closed

Development

Successfully merging this pull request may close these issues.

3 participants