Skip to content

Commit

Permalink
Merge branch 'hovmoeller_time_vs_latlon' of https://github.com/ESMVal…
Browse files Browse the repository at this point in the history
…Group/ESMValTool into hovmoeller_time_vs_latlon
  • Loading branch information
jeremykraftdlr committed Sep 6, 2023
2 parents 3667629 + 00dc5d2 commit e2eb393
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 109 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 3 additions & 3 deletions doc/sphinx/source/recipes/recipe_monitor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ Zonal mean profile of ta including a reference dataset.
1D profile of ta including a reference dataset.


.. _fig_hovmoeller_time_vs_lon_with_ref:
.. figure:: /recipes/figures/monitor/hovmoeller_time_vs_lon_with_ref.png
.. _fig_hovmoeller_time_vs_lot_with_ref:
.. figure:: /recipes/figures/monitor/hovmoeller_time_vs_lat_with_ref.png
:align: center
:width: 14cm

Hovmoeller diagram (time vs longitude) of near surface temperature including a
Hovmoeller diagram (time vs latitude) of near surface temperature including a
reference dataset and biases.
10 changes: 5 additions & 5 deletions esmvaltool/diag_scripts/monitor/multi_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@
curly brackets which will be derived from the corresponding dataset, e.g.,
``{project}``, ``{short_name}``, ``{exp}``. Examples: ``title: 'Awesome
Plot of {long_name}'``, ``xlabel: '{short_name}'``, ``xlim: [0, 5]``.
rasterize: bool, optional (default: False) # TODO: not working
rasterize: bool, optional (default: False)
If ``True``, use `rasterization
<https://matplotlib.org/stable/gallery/misc/rasterization_demo.html>`_ for
profile plots to produce smaller files. This is only relevant for vector
Expand Down Expand Up @@ -1229,6 +1229,7 @@ def _plot_hovmoeller_time_vs_lat_or_lon_with_ref(self, plot_func, dataset,
# Make sure that the data has the correct dimensions
cube = dataset['cube']
ref_cube = ref_dataset['cube']
print(cube)
dim_coords_dat = self._check_cube_dimensions(cube, plot_type)
self._check_cube_dimensions(ref_cube, plot_type)

Expand All @@ -1252,11 +1253,10 @@ def _plot_hovmoeller_time_vs_lat_or_lon_with_ref(self, plot_func, dataset,
plot_data = plot_func(cube, **plot_kwargs)
axes_data.set_title(self._get_label(dataset), pad=3.0)
axes_data.set_ylabel('Time / Year')
plt.gca().yaxis.set_major_locator(mdates.YearLocator())
plt.gca().yaxis.set_major_formatter(mdates.DateFormatter("%Y"))
# TODO: %Y = time_format
plt.gca().yaxis.set_major_formatter(mdates.DateFormatter(
self.plots[plot_type]['time_format']))
if self.plots[plot_type]['show_y_minor_ticks']:
plt.gca().yaxis.set_minor_locator(mdates.MonthLocator())
plt.gca().yaxis.set_minor_locator(AutoMinorLocator())
if self.plots[plot_type]['show_x_minor_ticks']:
plt.gca().xaxis.set_minor_locator(AutoMinorLocator())

Expand Down

This file was deleted.

37 changes: 35 additions & 2 deletions esmvaltool/recipes/monitor/recipe_monitor_with_refs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ documentation:
authors:
- schlund_manuel
- winterstein_franziska
- kraft_jeremy
- ruhe_lukas
maintainer:
- schlund_manuel


datasets:
# Note: plot_label currently only used by diagnostic plot_multiple_annual_cycles
- {project: CMIP6, dataset: EC-Earth3, exp: historical, ensemble: r1i1p1f1, grid: gr, plot_label: 'EC-Earth3 historical'}
- {project: CMIP6, dataset: CanESM5, exp: historical, ensemble: r1i1p1f1, grid: gn, plot_label: 'Reference (CanESM5 historical)', reference_for_monitor_diags: true}
# - {project: CMIP6, dataset: EC-Earth3, exp: historical, ensemble: r1i1p1f1, grid: gr, plot_label: 'EC-Earth3 historical'}
# - {project: CMIP6, dataset: CanESM5, exp: historical, ensemble: r1i1p1f1, grid: gn, plot_label: 'Reference (CanESM5 historical)', reference_for_monitor_diags: true}
- {project: CMIP6, dataset: MPI-ESM1-2-HR, exp: historical, ensemble: r1i1p1f1, grid: gn, plot_label: 'MPI-ESM1-2-HR historical'}
- {project: CMIP6, dataset: MPI-ESM1-2-LR, exp: historical, ensemble: r1i1p1f1, grid: gn, plot_label: 'MPI-ESM1-2-LR MPI historical', reference_for_monitor_diags: true}



preprocessors:
Expand Down Expand Up @@ -55,6 +60,16 @@ preprocessors:
coordinate: air_pressure
zonal_statistics:
operator: mean

zonal_mean_2d:
custom_order: true
regrid:
target_grid: 2x2
scheme:
reference: esmf_regrid.schemes:ESMFAreaWeighted
zonal_statistics:
operator: mean


extract_1d_profile:
custom_order: true
Expand Down Expand Up @@ -150,6 +165,7 @@ diagnostics:
plot_kwargs_bias:
levels: [-10.0, -7.5, -5.0, -2.5, 0.0, 2.5, 5.0, 7.5, 10.0]


plot_1D_profiles_with_references:
description: Plot 1D profiles including reference datasets.
variables:
Expand All @@ -168,3 +184,20 @@ diagnostics:
color: C0
CanESM5:
color: black

plot_time_vs_lat_with_references:
description: Plot Hovmöller diagram (time vs lon) incl. reference datasets.
variables:
tas:
mip: Amon
preprocessor: zonal_mean_2d
timerange: '2000/2014'
scripts:
plot:
script: monitor/multi_datasets.py
plot_folder: '{plot_dir}'
plot_filename: '{plot_type}_{real_name}_{dataset}_{mip}'
plots:
hovmoeller_time_vs_lat_or_lon:
common_cbar: true
show_x_minor_ticklabels: false

0 comments on commit e2eb393

Please sign in to comment.