Skip to content

Commit

Permalink
add docs, authors and save data
Browse files Browse the repository at this point in the history
  • Loading branch information
flicj191 committed Jun 28, 2024
1 parent e03c8f5 commit e8ad989
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 11 deletions.
14 changes: 12 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@
"name": "Hagemann, Stefan",
"orcid": "0000-0001-5444-2945"
},
{
"affiliation": "University of Canterbury, New Zealand",
"name": "Hardacre, Catherine",
"orcid": "0000-0001-9093-4656"
},
{
"affiliation": "ISAC-CNR, Italy",
"name": "von Hardenberg, Jost",
Expand Down Expand Up @@ -380,15 +385,20 @@
"affiliation": "DLR, Germany",
"name": "Bonnet, Pauline",
"orcid": "0000-0003-3780-0784"
},
{
"affiliation": "ACCESS-NRI, Australia",
"name": "Chun, Felicity",
"orcid": "0009-0007-0845-0953"
}
],
"description": "ESMValTool: A community diagnostic and performance metrics tool for routine evaluation of Earth system models in CMIP.",
"license": {
"id": "Apache-2.0"
},
"publication_date": "2023-07-06",
"publication_date": "2023-12-20",
"title": "ESMValTool",
"version": "v2.9.0",
"version": "v2.10.0",
"communities": [
{
"identifier": "is-enes3"
Expand Down
5 changes: 5 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@ authors:
family-names: Bonnet
given-names: Pauline
orcid: "https://orcid.org/0000-0003-3780-0784"
-
affiliation: "ACCESS-NRI, Australia"
family-names: Chun
given-names: Felicity
orcid: "https://orcid.org/0009-0007-0845-0953"

cff-version: 1.2.0
date-released: 2023-12-20
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/sphinx/source/recipes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Other
recipe_rainfarm
recipe_seaice
recipe_seaice_drift
recipe_seaice_extents_sh
recipe_seaice_feedback
recipe_shapeselect
recipes_testing
Expand Down
72 changes: 72 additions & 0 deletions doc/sphinx/source/recipes/recipe_seaice_extents_sh.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. _recipes_seaice_extents_sh:

Sea Ice area and extents
========================

Overview
--------

This recipe plots sea ice concentration from CICE (sea ice model) output
around the southern polar region and compares it to the NSIDC CDR
(National Snow and Ice Data Centre, Climate Data Record) dataset.


Available recipes and diagnostics
---------------------------------

Recipes are stored in esmvaltool/recipes/

* recipe_seaice_extents_sh.yml

Diagnostics are stored in esmvaltool/diag_scripts/seaice_area_extents/

* seaicearea_trends.py: plot minima and maxima sea ice area trends
* seaice_mapextents.py: plot sea ice extent and differences to Observations


User settings in recipe
-----------------------

#. Script seaice_mapextents.py

*Required settings for script*

* `months`: months by month number which the mean are to be plotted


Variables
---------

* siconc (seaIce, monthly, longitude latitude time)
* areacello (fx)


Observations and reformat scripts
---------------------------------

*Note: (1) obs4MIPs data can be used directly without any preprocessing;
(2) see headers of reformat scripts for non-obs4MIPs data for download
instructions.*

* NSIDC CDR sh (siconc - esmvaltool/cmorizers/data/formatters/datasets/nsidc_g02202_sh.py)


References
----------

* COSIMA(Consortium for Ocean-Sea Ice Modelling in Australia) recipe: https://cosima-recipes.readthedocs.io/en/latest/DocumentedExamples/SeaIce_Obs_Model_Compare.html

Example plots
-------------

.. _trends:
.. figure:: /recipes/figures/seaice_extents_sh/min_trend.png
:align: center

Minima trends of sea ice area with observation data. ACCESS OM model data years from 0, added 1652 years to model years for comparability.

.. _map extents:
.. figure:: /recipes/figures/seaice_extents_sh/map_difference.png
:align: center

Difference and extents of models with observations for selected months.
23 changes: 18 additions & 5 deletions esmvaltool/diag_scripts/seaice_area_extents/seaice_mapextents.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
import numpy as np
import pandas as pd

from esmvaltool.diag_scripts.shared import run_diagnostic, save_figure
from esmvaltool.diag_scripts.shared import (
run_diagnostic,
save_figure,
save_data
)
from esmvaltool.diag_scripts.shared._base import get_plot_filename


Expand Down Expand Up @@ -47,7 +51,7 @@ def model_regrid_diff(mod_si, obs_si, cdr, mon, latmax):
return diff_ds, mod_regrid


def map_diff(mod_si_ls, obs_si, months):
def map_diff(mod_si_ls, obs_si, months, cfg, prov):
"""Create figure mapping extents for models and months."""
# get lat max for regridding
latmax = obs_si.lat.max().values.item()
Expand All @@ -66,7 +70,12 @@ def map_diff(mod_si_ls, obs_si, months):

diff_ds, mod_regrid = model_regrid_diff(mod_si, obs_si,
cdr, mon, latmax)

# save plot data
save_data(mod_label + calendar.month_abbr[mon] + '_mean',
prov, cfg, mod_regrid.to_iris())
save_data(mod_label + calendar.month_abbr[mon] + '_obs_diff',
prov, cfg, diff_ds.to_iris())

axes = plt.subplot(len(months), 3, i + j * 3, projection=proj)

diffmap = axes.contourf(
Expand Down Expand Up @@ -124,10 +133,13 @@ def main(cfg):
mod_si_dict[data_name] = xr.open_dataset(filepath)

logger.info("creating map differences")
mapfig = map_diff(mod_si_dict, obs_si, cfg['months'])
provenance_record = get_provenance_record(inputs_df['filename'].to_list())

mapfig = map_diff(mod_si_dict, obs_si, cfg['months'],
cfg, provenance_record)
# Save output
output_path = get_plot_filename('map_difference', cfg)
provenance_record = get_provenance_record(inputs_df['filename'].to_list())

save_figure(output_path, provenance_record, cfg, figure=mapfig)


Expand All @@ -137,6 +149,7 @@ def get_provenance_record(ancestor_files):
'ancestors': ancestor_files,
'authors': [
'chun_felicity',
'steketee_anton'
],
'caption': '',
'domains': ['shpolar'],
Expand Down
15 changes: 11 additions & 4 deletions esmvaltool/diag_scripts/seaice_area_extents/seaicearea_trends.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import pandas as pd
import xarray as xr

from esmvaltool.diag_scripts.shared import run_diagnostic, save_figure
from esmvaltool.diag_scripts.shared import (
run_diagnostic, save_figure, save_data
)
from esmvaltool.diag_scripts.shared._base import get_plot_filename


Expand Down Expand Up @@ -62,7 +64,7 @@ def min_and_max_year(yeardata):
return annual_min_max_ds


def plot_trend(model_min_max, obs_a, minmax):
def plot_trend(model_min_max, obs_a, minmax, prov, cfg):
"""
function to plot min or max trend
Expand All @@ -78,6 +80,9 @@ def plot_trend(model_min_max, obs_a, minmax):
# add note for years change
for mod_label, model_min_max_dt in model_min_max.items():
model_min_max_dt[minmax].plot(label=mod_label)
# save data
save_data(mod_label + minmax, prov, cfg,
model_min_max_dt[minmax].to_iris())

if minmax == 'max':
obs_a.cdr_area.groupby('time.year').max().plot(label='Obs CDR')
Expand Down Expand Up @@ -138,7 +143,8 @@ def main(cfg):

provenance = get_provenance_record(inputfiles_df['filename'].to_list())
for trend_type in ['min', 'max']:
fig = plot_trend(min_max, sea_ice_area_obs(obs_si), trend_type)
fig = plot_trend(min_max, sea_ice_area_obs(obs_si), trend_type,
provenance, cfg)
# Save output
save_figure(get_plot_filename(f'{trend_type}_trend', cfg),
provenance, cfg, figure=fig)
Expand All @@ -150,11 +156,12 @@ def get_provenance_record(ancestor_files):
'ancestors': ancestor_files,
'authors': [
'chun_felicity',
'steketee_anton'
],
'caption': 'added 1652 years to model years for comparability',
'domains': ['shpolar'],
'plot_types': ['times'],
'references': [],
'references': ['access_nri'],
'statistics': ['mean'],
}
return record
Expand Down

0 comments on commit e8ad989

Please sign in to comment.