Skip to content

Commit aed4ddb

Browse files
committed
add case studies document as notebook
1 parent edeeacf commit aed4ddb

File tree

3 files changed

+221
-0
lines changed

3 files changed

+221
-0
lines changed

docs/user-guide/assignments/case_studies_virtualship.ipynb

Lines changed: 177 additions & 0 deletions
Large diffs are not rendered by default.

docs/user-guide/assignments/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Research_proposal_intro.ipynb
1010
Research_Proposal_only.ipynb
1111
sciencecommunication_assignment.ipynb
1212
Code_of_conduct.ipynb
13+
case_studies_virtualship.ipynb
1314
```
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import cartopy.crs as ccrs
2+
import matplotlib.pyplot as plt
3+
4+
REGIONS = {
5+
"Irminger Sea": {"label": "1", "coords": (57.25, -33.0)},
6+
"California Current": {"label": "2", "coords": (35, -132)},
7+
"Gulf Stream and Deep Western Boundary Current": {
8+
"label": "3",
9+
"coords": (32.0, -72.0),
10+
},
11+
"Japan current": {"label": "4", "coords": (31.7, 141)},
12+
"Atlantic Meridional Overturning Circulation (AMOC)": {
13+
"label": "5",
14+
"coords": (26, -47),
15+
},
16+
"El Niño Southern Oscillation (ENSO)": {"label": "6", "coords": (-5.0, -91.5)},
17+
"North Brazil current": {"label": "7", "coords": (2.0, -43.0)},
18+
"Somali current": {"label": "8", "coords": (6.0, 53.0)},
19+
"East Australian Current": {"label": "9", "coords": (-28.0, 156)},
20+
"Drake passage": {"label": "10", "coords": (-58.0, -57.0)},
21+
}
22+
23+
24+
def _global_plot(width=10, height=5, regions=None) -> None:
25+
fig = plt.figure(figsize=(width, height), dpi=300)
26+
ax = fig.add_subplot(1, 1, 1, projection=ccrs.Robinson())
27+
28+
ax.set_global()
29+
30+
if regions:
31+
for _, info in regions.items():
32+
ax.text(
33+
info["coords"][1],
34+
info["coords"][0],
35+
info["label"],
36+
transform=ccrs.PlateCarree(),
37+
fontsize=8,
38+
fontweight="bold",
39+
color="red",
40+
)
41+
42+
ax.stock_img()
43+
ax.coastlines(linewidth=0.5)

0 commit comments

Comments
 (0)