Skip to content

Commit 9610c61

Browse files
committed
Added recipe solutions and use unified diff
Fixed #107
1 parent 805148f commit 9610c61

4 files changed

Lines changed: 224 additions & 37 deletions

File tree

_episodes/04-recipe.md

Lines changed: 89 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -635,58 +635,110 @@ The snippets for the edits can be found below:
635635
636636
> ## Land surface average temperature
637637
>
638-
> ```YAML
639-
> ...
640-
> 23 - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
641-
> ...
642-
> 27 annual_statistics:
643-
> 28 operator: mean
644-
> XX area_statistics:
645-
> XX operator: mean
646-
> ...
647-
> 38 short_name: ts
648-
> 39 preprocessor: prep_timeseries
638+
> ```diff
639+
> --- data/recipe_example.yml 2020-07-31 14:43:48.976660742 +0200
640+
> +++ data/recipe_example_ts.yml 2020-08-03 14:57:45.962391097 +0200
641+
> @@ -20,12 +20,14 @@
642+
> - ukesm
643+
>
644+
> datasets:
645+
> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
646+
> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
647+
>
648+
> preprocessors:
649+
> prep_timeseries: # For 0D fields
650+
> annual_statistics:
651+
> operator: mean
652+
> + area_statistics:
653+
> + operator: mean
654+
>
655+
> diagnostics:
656+
> # --------------------------------------------------
657+
> @@ -35,7 +37,7 @@
658+
> description: simple_time_series
659+
> variables:
660+
> timeseries_variable:
661+
> - short_name: thetaoga
662+
> + short_name: ts
663+
> preprocessor: prep_timeseries
664+
> scripts:
665+
> timeseries_diag:
649666
> ```
650667
>
651668
> Note: The x-axis in the plot now shows the years 1900 - 2000.
652669
{: .solution}
653670
654671
> ## Atmospheric surface average temperature
655-
> ```YAML
656-
> ...
657-
> 23 - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
658-
> XX - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
659-
> ...
660-
> 27 annual_statistics:
661-
> 28 operator: mean
662-
> XX area_statistics:
663-
> XX operator: mean
664-
> ...
665-
> 38 short_name: tas
666-
> 39 preprocessor: prep_timeseries
672+
>
673+
> ```diff
674+
> --- data/recipe_example.yml 2020-07-31 14:43:48.976660742 +0200
675+
> +++ data/recipe_example_tas.yml 2020-08-03 14:58:22.981947194 +0200
676+
> @@ -20,12 +20,15 @@
677+
> - ukesm
678+
>
679+
> datasets:
680+
> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
681+
> + - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
682+
> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
683+
>
684+
> preprocessors:
685+
> prep_timeseries: # For 0D fields
686+
> annual_statistics:
687+
> operator: mean
688+
> + area_statistics:
689+
> + operator: mean
690+
>
691+
> diagnostics:
692+
> # --------------------------------------------------
693+
> @@ -35,7 +38,7 @@
694+
> description: simple_time_series
695+
> variables:
696+
> timeseries_variable:
697+
> - short_name: thetaoga
698+
> + short_name: tas
699+
> preprocessor: prep_timeseries
700+
> scripts:
701+
> timeseries_diag:
667702
> ```
668703
> Note: There are now 3 plots in the work directory. One for each dataset and one for the multiple dataset overview.
669704
{: .solution}
670705
671706
> ## Ocean surface average temperature
672-
> ```YAML
673-
> ...
674-
> 23 - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
675-
> XX - {dataset: HadGEM2-CC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
676-
> XX - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
677-
> ...
678-
> 27 annual_statistics:
679-
> 28 operator: mean
680-
> XX area_statistics:
681-
> XX operator: mean
682-
> ...
683-
> 38 short_name: tos
684-
> 39 preprocessor: prep_timeseries
707+
>
708+
> ```diff
709+
> --- data/recipe_example.yml 2020-07-31 14:43:48.976660742 +0200
710+
> +++ data/recipe_example_tos.yml 2020-08-03 14:11:33.721000000 +0200
711+
> @@ -20,12 +20,16 @@
712+
> - ukesm
713+
>
714+
> datasets:
715+
> - - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1859, end_year: 2005}
716+
> + - {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
717+
> + - {dataset: HadGEM2-CC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
718+
> + - {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
719+
>
720+
> preprocessors:
721+
> prep_timeseries: # For 0D fields
722+
> annual_statistics:
723+
> operator: mean
724+
> + area_statistics:
725+
> + operator: mean
726+
>
727+
> diagnostics:
728+
> # --------------------------------------------------
729+
> @@ -35,7 +39,7 @@
730+
> description: simple_time_series
731+
> variables:
732+
> timeseries_variable:
733+
> - short_name: thetaoga
734+
> + short_name: tos
735+
> preprocessor: prep_timeseries
736+
> scripts:
737+
> timeseries_diag:
685738
> ```
686739
> Note: The unit in the plots is now degrees celsius! There is a plot also for HadGEM2-CC.
687740
{: .solution}
688741
689-
690742
> ## Advanced:
691743
> If you want to add a different field, please have a look here:
692744
> http://clipc-services.ceda.ac.uk/dreq/index/CMORvar.html

data/recipe_example_tas.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
24+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
25+
26+
preprocessors:
27+
prep_timeseries: # For 0D fields
28+
annual_statistics:
29+
operator: mean
30+
area_statistics:
31+
operator: mean
32+
33+
diagnostics:
34+
# --------------------------------------------------
35+
# Time series diagnostics
36+
# --------------------------------------------------
37+
diag_timeseries_temperature:
38+
description: simple_time_series
39+
variables:
40+
timeseries_variable:
41+
short_name: tas
42+
preprocessor: prep_timeseries
43+
scripts:
44+
timeseries_diag:
45+
script: ocean/diagnostic_timeseries.py

data/recipe_example_tos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-AO, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
24+
- {dataset: HadGEM2-CC, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
25+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Omon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
26+
27+
preprocessors:
28+
prep_timeseries: # For 0D fields
29+
annual_statistics:
30+
operator: mean
31+
area_statistics:
32+
operator: mean
33+
34+
diagnostics:
35+
# --------------------------------------------------
36+
# Time series diagnostics
37+
# --------------------------------------------------
38+
diag_timeseries_temperature:
39+
description: simple_time_series
40+
variables:
41+
timeseries_variable:
42+
short_name: tos
43+
preprocessor: prep_timeseries
44+
scripts:
45+
timeseries_diag:
46+
script: ocean/diagnostic_timeseries.py

data/recipe_example_ts.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ESMValTool
2+
# recipe_example.yml
3+
---
4+
documentation:
5+
description: Demonstrate basic ESMValTool example
6+
7+
authors:
8+
- demora_lee
9+
- mueller_benjamin
10+
- swaminathan_ranjini
11+
12+
maintainer:
13+
- demora_lee
14+
15+
references:
16+
- demora2018gmd
17+
# Some plots also appear in ESMValTool paper 2.
18+
19+
projects:
20+
- ukesm
21+
22+
datasets:
23+
- {dataset: HadGEM2-ES, project: CMIP5, exp: historical, mip: Amon, ensemble: r1i1p1, start_year: 1901, end_year: 2000}
24+
25+
preprocessors:
26+
prep_timeseries: # For 0D fields
27+
annual_statistics:
28+
operator: mean
29+
area_statistics:
30+
operator: mean
31+
32+
diagnostics:
33+
# --------------------------------------------------
34+
# Time series diagnostics
35+
# --------------------------------------------------
36+
diag_timeseries_temperature:
37+
description: simple_time_series
38+
variables:
39+
timeseries_variable:
40+
short_name: ts
41+
preprocessor: prep_timeseries
42+
scripts:
43+
timeseries_diag:
44+
script: ocean/diagnostic_timeseries.py

0 commit comments

Comments
 (0)