Skip to content

Commit bc20305

Browse files
Final pre-review updates for recipe 19
1 parent 9aeadc3 commit bc20305

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/source/recipes/plot_19_recipe.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
Calculate and plotting per-season trends in global sea surface extrema
3-
======================================================================
2+
Plotting per-season trends in global sea surface tempreature extrema
3+
====================================================================
44
55
In this recipe we find the area-based extrema of global sea surface
66
temperature per month and, because it is very difficult to
@@ -19,10 +19,10 @@
1919
# %%
2020
# 2. Read the dataset in extract the SST Field from the FieldList:
2121
f = cf.read("~/recipes_break/ERA5_monthly_averaged_SST.nc")
22-
sst = f[0]
22+
sst = f[0] # this gives the sea surface temperature (SST)
2323

2424
# %%
25-
# 3. Collapse data by area extrema (average over spatial dimensions):
25+
# 3. Collapse the SST data by area extrema (extrema over spatial dimensions):
2626
am_max = sst.collapse("area: maximum") # equivalent to "X Y: maximum"
2727
am_min = sst.collapse("area: minimum") # equivalent to "X Y: minimum"
2828

@@ -38,7 +38,7 @@
3838
# the four seasons, along with our description of them, as a value, with
3939
# the key of the string encoding the colour we want to plot these
4040
# trendlines in. This structure will be iterated over to make our plot:
41-
colours_seasons_map = {
41+
colours_seasons_mapping = {
4242
"red": (cf.mam(), "Mean across MAM: March, April and May"),
4343
"blue": (cf.jja(), "Mean across JJA: June, July and August"),
4444
"green": (cf.son(), "Mean across SON: September, October and November"),
@@ -61,11 +61,11 @@
6161
# "T: mean" collapse setting the season as the grouping:
6262
cfp.gpos(1)
6363
cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=304, ymax=312)
64-
for colour, season_query in colours_seasons_map.items():
64+
for colour, season_query in colours_seasons_mapping.items():
6565
query_on_season, season_description = season_query
66-
am_sub = am_max.collapse("T: mean", group=query_on_season)
66+
am_max_collapse = am_max.collapse("T: mean", group=query_on_season)
6767
cfp.lineplot(
68-
am_sub,
68+
am_max_collapse,
6969
color=colour,
7070
markeredgecolor=colour,
7171
marker="o",
@@ -85,11 +85,11 @@
8585
# mapping and doing a "T: mean" collapse setting the season as the grouping:
8686
cfp.gpos(2)
8787
cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=269, ymax=272)
88-
for colour, season_query in colours_seasons_map.items():
88+
for colour, season_query in colours_seasons_mapping.items():
8989
query_on_season, season_description = season_query
90-
am_sub = am_min.collapse("T: mean", group=query_on_season)
90+
am_min_collapse = am_min.collapse("T: mean", group=query_on_season)
9191
cfp.lineplot(
92-
am_sub,
92+
am_min_collapse,
9393
color=colour,
9494
markeredgecolor=colour,
9595
marker="o",
@@ -104,8 +104,8 @@
104104
# %%
105105
# 9. Add an overall title to the plot and close the file to save it:
106106
plt.suptitle(
107-
"Global Average Sea Surface Temperature monthly minima\nand maxima "
108-
"including seasonal means of these extrema",
107+
"Global mean sea surface temperature (SST) monthly\nminima and maxima "
108+
"showing seasonal means of these extrema",
109109
fontsize=18,
110110
)
111111
cfp.gclose()

0 commit comments

Comments
 (0)