added jspier's code for generating figures from DIA. - #318
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
🟡 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.pyutilities for loading, plotting, and exporting modular “pieces”. - Added local
.gitignoreguidance 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.
| 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] |
| 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) | |||
| # conda env create -f environment.yml | ||
| # conda activate swot-dia | ||
| # | ||
| # Then follow DATA.md to download the input data into ./data/. |
Adding code from Jacob Spier's DIA work.