|
18 | 18 |
|
19 | 19 | # Collapse data by area mean (average over spatial dimensions)
|
20 | 20 | am_max = sst.collapse("area: maximum") # equivalent to "X Y: mean"
|
21 |
| -am_min = sst.collapse("area: minimum") # equivalent to "X Y: mean" |
22 |
| -print("AM SEASONAL IS", am_min, am_max) |
| 21 | +am_min = sst.collapse("area: minimum") |
23 | 22 |
|
24 | 23 | # Reduce all timeseries down to just 1980+ since there are some data
|
25 | 24 | # quality issues before 1970
|
26 | 25 | am_max = am_max.subspace(T=cf.ge(cf.dt("1980-01-01")))
|
27 | 26 | am_min = am_min.subspace(T=cf.ge(cf.dt("1980-01-01")))
|
28 |
| -print("FINAL FIELDS ARE", am_max, am_min) |
29 | 27 |
|
30 |
| -# TODO |
| 28 | +# TODO COMMENT |
31 | 29 | colours_seasons_map = {
|
32 | 30 | "red": (cf.mam(), "Mean across MAM: March, April and May"),
|
33 | 31 | "blue": (cf.jja(), "Mean across JJA: June, July and August"),
|
|
36 | 34 | }
|
37 | 35 |
|
38 | 36 | cfp.gopen(
|
39 |
| - rows=2, columns=1, bottom=0.1, top=0.75, file="global_avg_sst_plot.png") |
| 37 | + rows=2, columns=1, bottom=0.1, top=0.85, file="global_avg_sst_plot.png") |
40 | 38 |
|
41 | 39 | # Put maxima subplot at top since these values are higher, given
|
42 | 40 | # increasing x axis
|
|
46 | 44 | "including seasonal means of these extrema",
|
47 | 45 | fontsize=18,
|
48 | 46 | )
|
| 47 | +# Set limits manually only to allow space so the legend doesn't overlap the |
| 48 | +# data, which isn't possible purely from positioning it anywhere |
| 49 | +cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=304, ymax=312) |
49 | 50 | for colour, season_query in colours_seasons_map.items():
|
50 | 51 | query_on_season, season_description = season_query
|
51 | 52 | am_sub = am_max.collapse("T: mean", group=query_on_season)
|
|
54 | 55 | color=colour,
|
55 | 56 | markeredgecolor=colour,
|
56 | 57 | marker="o",
|
57 |
| - xlabel="", |
58 | 58 | label=season_description,
|
59 | 59 | title="Maxima per month or season",
|
60 |
| - # TODO FONTSIZE HERE |
61 | 60 | )
|
62 | 61 | cfp.lineplot(
|
63 | 62 | am_max,
|
64 | 63 | color="grey",
|
65 | 64 | xlabel="",
|
66 |
| - ylabel="Temperature (K)", |
67 |
| - label="All months" |
| 65 | + label="All months", |
68 | 66 | )
|
69 | 67 |
|
70 | 68 | # Minima subplot below the maxima one
|
71 | 69 | cfp.gpos(2)
|
| 70 | +cfp.gset(xmin="1980-01-01", xmax="2022-12-01", ymin=269, ymax=272) |
72 | 71 | for colour, season_query in colours_seasons_map.items():
|
73 | 72 | query_on_season, season_description = season_query
|
74 | 73 | am_sub = am_min.collapse("T: mean", group=query_on_season)
|
|
0 commit comments