-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recreate perfmetrics portrait plot in python #3551
base: main
Are you sure you want to change the base?
Changes from all commits
bc2a6b2
b74414f
f78d2e5
93c5544
db30131
215ee95
b4f8238
5c30d4a
07e676a
42fdd81
4ab76cb
32ad034
d66e5e2
e1bb9c4
30541be
5eb01f2
d6a541f
7fb8a10
eba93db
ffee698
54ad3d8
7cbcf86
f7b6c87
39df74e
a896ce6
62086aa
8c9aa90
9b20ac3
db01441
efc026a
af917bc
d25290e
9ae502c
666837c
ac0e95e
0492849
946cb00
7242b23
bc6d237
4712895
5e337b3
bf61ccf
78a8146
6d39ff6
6fe20a1
d9ba763
e592aa3
05c03eb
051513c
9863272
c8f2136
216a7af
fb73bac
22e1c5d
5df02db
4cb1154
11fc9d9
2b5781b
9707d29
e80f39e
0f5af79
404ad27
7484d5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,12 @@ | ||||||||||
|
||||||||||
.. _api.esmvaltool.diag_scripts.portrait_plot: | ||||||||||
|
||||||||||
Portrait Plot | ||||||||||
============= | ||||||||||
|
||||||||||
Plot performance metrics of multiple datasets vs up to four references | ||||||||||
A :doc:`documented example recipe </recipes/recipe_portrait>` to use this | ||||||||||
diagnostic is provided as `recipes/recipe_portrait_CMIP.yml`. | ||||||||||
|
||||||||||
.. automodule:: esmvaltool.diag_scripts.portrait_plot | ||||||||||
:members: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Do you think it makes sense to use the functions of this module outside of it? If not, I wouldn't show them. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,10 +67,13 @@ Atmosphere | |
|
||
Climate metrics | ||
^^^^^^^^^^^^^^^ | ||
.. _climate_metrics: | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
recipe_perfmetrics | ||
recipe_portrait | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should appear under General-purpose diagnostics. |
||
recipe_smpi | ||
|
||
Future projections | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,95 @@ | ||||||
.. _recipe_portrait: | ||||||
|
||||||
Portrait plot | ||||||
============= | ||||||
|
||||||
|
||||||
Overview | ||||||
-------- | ||||||
Portrait plots are a flexible way to visualize performance metrics for multiple | ||||||
datasets and up to four references. In this recipe `recipe_portrait_CMIP.yml` | ||||||
the normalized Root Mean Squared Deviation (RMSD) of global mean seasonal | ||||||
climatologies is calculated for a selection of CMIP models. | ||||||
In the example recipe, for each variable up to two observation based datasets | ||||||
are used as reference. | ||||||
See :ref:`variables` for complete list of references. | ||||||
The recipe uses preprocessor functions (distance metrics, global mean, | ||||||
climate statistics) to calculate a scalar metric for each combination of | ||||||
dataset, variable and reference, which is plotted by the `portrait_plot.py` | ||||||
diagnostic script. | ||||||
|
||||||
|
||||||
User settings in recipe | ||||||
----------------------- | ||||||
|
||||||
By default cells are plotted for combinations of `short_name`, | ||||||
`dataset`, `project` and `split`, | ||||||
where `split` is an optional extra_facet for variables. | ||||||
However, this can be customized using the `x_by`, | ||||||
`y_by`, `group_by` and `split_by` script settings. | ||||||
For a complete and detailed list of settings, see the | ||||||
:doc:`diagnostic documentation </api/esmvaltool.diag_scripts.portrait_plot>`. | ||||||
While this allows very flexible use for any kind of data, there are some | ||||||
limitations as well: The grouping (subplots) and normalization is always | ||||||
applied along the x-axis. | ||||||
With default settings this means normalizing all metrics for each variable | ||||||
and grouping all datasets by project. | ||||||
|
||||||
To plot distance metrics like RMSE, pearson R, bias etc. the | ||||||
:func:`distance_metrics <esmvalcore.preprocessor.derive>` preprocessor or | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
custom diagnostics can be used. | ||||||
|
||||||
|
||||||
|
||||||
.. _variables: | ||||||
|
||||||
Variables and Datasets | ||||||
------------------------ | ||||||
|
||||||
.. note:: | ||||||
|
||||||
The recipe generally works for any variable that is preprocessed correctly. | ||||||
To use different preprocessors or reference datasets it could be useful | ||||||
to create different variable groups and link them with the same extra_facet | ||||||
like `variable_name`. See recipe for examples. Listed below are the variables | ||||||
used to produce the example figure. | ||||||
|
||||||
|
||||||
The following list shows which observational dataset is used as reference for | ||||||
each variable in this recipe. All variables are atmospheric monthly means. | ||||||
For 3D variables the selected pressure level is specified in parentheses. | ||||||
|
||||||
* clt (Ref1: ESACCI-CLOUD, Ref2: PATMOS-x) | ||||||
* pr (Ref1: GPCP-V2.2) | ||||||
* rlut, rsut (Ref1: CERES-EBAF) | ||||||
* tas (Ref1: ERA-Interim, Ref2: NCEP-NCAR-R1) | ||||||
* ts (Ref1: ESACCI-SST, Ref2: HadISST) | ||||||
* ua (200 hPa, Ref1: ERA-Interim, Ref2: NCEP-NCAR-R1) | ||||||
* zg (500 hPa, Ref1: ERA-Interim, Ref2: NCEP-NCAR-R1) | ||||||
|
||||||
|
||||||
References | ||||||
---------- | ||||||
|
||||||
* Gleckler, P. J., K. E. Taylor, and C. Doutriaux, Performance metrics for climate models, J. | ||||||
Geophys. Res., 113, D06104, doi: 10.1029/2007JD008972 (2008). | ||||||
|
||||||
* Righi, M., Eyring, V., Klinger, C., Frank, F., Gottschaldt, K.-D., Jöckel, P., | ||||||
and Cionni, I.: Quantitative evaluation of ozone and selected climate parameters in a set of EMAC simulations, | ||||||
Geosci. Model Dev., 8, 733, doi: 10.5194/gmd-8-733-2015 (2015). | ||||||
|
||||||
|
||||||
Example plots | ||||||
------------- | ||||||
|
||||||
.. _fig_portrait_plot: | ||||||
|
||||||
.. figure:: /recipes/figures/portrait/portrait_plot.png | ||||||
:width: 90% | ||||||
:align: center | ||||||
|
||||||
|
||||||
Relative space-time root-mean-square deviation (RMSD) calculated from the climatological | ||||||
seasonal cycle of CMIP5 and CMIP6 simulations. A relative performance is displayed, with blue shading | ||||||
indicating better and red shading indicating worse performance than the median of all model results. | ||||||
A diagonal split of a grid square shows the relative error with respect to the reference data set. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,11 @@ authors: | |
institute: DLR, Germany | ||
email: [email protected] | ||
orcid: | ||
cammarano_diego: | ||
name: Cammarano, Diego | ||
institute: DLR, Germany | ||
email: [email protected] | ||
github: diegokam | ||
debeire_kevin: | ||
name: Debeire, Kevin | ||
institute: DLR, Germany | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go into the docstring of the Python module.