<a id="api-esmvaltool-diag-scripts-monitor-compute-eofs"></a>

# Monitoring diagnostic to plot EOF maps and associated PC timeseries

Diagnostic to compute and plot the first EOF of an arbitrary input.

## Description

This diagnostic can be used to compute and show Empirical Orthogonal Functions
(EOFs) and Principal Components (PCs) of arbitrary input. It creates a map plot
of the first EOF and the associated PC time series.

## Configuration options in recipe

cartopy_data_dir: str, optional (default: None)
: Path to cartopy data dir. Defaults to None. See
  [https://scitools.org.uk/cartopy/docs/latest/](https://scitools.org.uk/cartopy/docs/latest/).

config_file: str, optional
: Path to the monitor configuration file. Defaults to `monitor_config.yml`
  in the same folder as the diagnostic script. More information on the
  monitor configuration file can be found [here](../../recipes/recipe_monitor.html.md#monitor-config-file).

plot_filename: str, optional
: Filename pattern for the plots.
  Defaults to `{plot_type}_{real_name}_{dataset}_{mip}_{exp}_{ensemble}`.
  All tags (i.e., the entries in curly brackets, e.g., `{dataset}`, are
  replaced with the corresponding tags).

plot_folder: str, optional
: Path to the folder to store figures. Defaults to
  `{plot_dir}/../../{dataset}/{exp}/{modeling_realm}/{real_name}`.  All
  tags (i.e., the entries in curly brackets, e.g., `{dataset}`, are
  replaced with the corresponding tags). `{plot_dir}` is replaced with the
  default ESMValTool plot directory (i.e.,
  `output_dir/plots/diagnostic_name/script_name/`, see
  [Output](https://docs.esmvaltool.org/projects/ESMValCore/en/latest/quickstart/output.html#outputdata)).

rasterize_maps: bool, optional (default: True)
: If `True`, use [rasterization](https://matplotlib.org/stable/gallery/misc/rasterization_demo.html) for
  map plots to produce smaller files. This is only relevant for vector
  graphics (e.g., `output_file_type=pdf,svg,ps`).

#### HINT
Extra arguments given to the recipe are ignored, so it is safe to use yaml
anchors to share the configuration of common arguments with other monitor
diagnostic script.
