Skip to content

climate_ref_esmvaltool.diagnostics.ozone #

O3LatMonthMapplot #

Bases: ESMValToolDiagnostic

Calculate the ozone diagnostics - zonal mean total column ozone vs. annual cycle plot.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
class O3LatMonthMapplot(ESMValToolDiagnostic):
    """
    Calculate the ozone diagnostics - zonal mean total column ozone vs. annual cycle plot.
    """

    name = "Ozone Diagnostics"
    slug = "ozone-annual-cycle"
    base_recipe = "ref/recipe_ref_ozone.yml"
    version = 4

    data_requirements = toz_data_requirement
    facets = ()
    test_data_spec = toz_test_spec
    files = (
        FileDefinition(
            file_pattern="plots/lat_month_mapplot/plot/*.png",
            dimensions={"variable_id": "toz", "statistic": "zonal mean annual cycle"},
        ),
    )

    @staticmethod
    def update_recipe(
        recipe: Recipe,
        input_files: dict[SourceDatasetType, pandas.DataFrame],
    ) -> None:
        """Update the recipe."""
        _prepare_recipe(recipe, input_files, "lat_month_mapplot", "toz", cmip7_timerange="1997/2021")

update_recipe(recipe, input_files) staticmethod #

Update the recipe.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
@staticmethod
def update_recipe(
    recipe: Recipe,
    input_files: dict[SourceDatasetType, pandas.DataFrame],
) -> None:
    """Update the recipe."""
    _prepare_recipe(recipe, input_files, "lat_month_mapplot", "toz", cmip7_timerange="1997/2021")

O3LatTimeMapplot #

Bases: ESMValToolDiagnostic

Calculate the ozone diagnostics - zonal mean total column ozone vs. time.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
class O3LatTimeMapplot(ESMValToolDiagnostic):
    """
    Calculate the ozone diagnostics - zonal mean total column ozone vs. time.
    """

    name = "Ozone Diagnostics"
    slug = "ozone-lat-time"
    base_recipe = "ref/recipe_ref_ozone.yml"
    version = 4

    data_requirements = toz_data_requirement
    facets = ()
    test_data_spec = toz_test_spec
    files = (
        FileDefinition(
            file_pattern="plots/lat_time_mapplot/plot/*.png",
            dimensions={"variable_id": "toz", "statistic": "zonal mean vs time"},
        ),
    )

    @staticmethod
    def update_recipe(
        recipe: Recipe,
        input_files: dict[SourceDatasetType, pandas.DataFrame],
    ) -> None:
        """Update the recipe."""
        _prepare_recipe(recipe, input_files, "lat_time_mapplot", "toz", cmip7_timerange="1997/2021")

update_recipe(recipe, input_files) staticmethod #

Update the recipe.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
@staticmethod
def update_recipe(
    recipe: Recipe,
    input_files: dict[SourceDatasetType, pandas.DataFrame],
) -> None:
    """Update the recipe."""
    _prepare_recipe(recipe, input_files, "lat_time_mapplot", "toz", cmip7_timerange="1997/2021")

O3PolarCapTimeseriesNH #

Bases: ESMValToolDiagnostic

Calculate the ozone diagnostics - March NH polar mean (60N-85N) time series.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
class O3PolarCapTimeseriesNH(ESMValToolDiagnostic):
    """
    Calculate the ozone diagnostics - March NH polar mean (60N-85N) time series.
    """

    name = "Ozone Diagnostics"
    slug = "ozone-nh-mar"
    base_recipe = "ref/recipe_ref_ozone.yml"
    version = 4

    data_requirements = toz_data_requirement
    facets = ()
    test_data_spec = toz_test_spec
    files = (
        FileDefinition(
            file_pattern="plots/polar_cap_time_series_NH/plot/timeseries_toz_NH_MAR.png",
            dimensions={
                "variable_id": "toz",
                "statistic": "Northern Hemisphere March polar mean",
            },
        ),
    )
    # NOTE: ESMValTool sorts the datasets in the file by label, so the selector `dim0: 0` might be
    #       incorrect if models or observations with different names are used. (~fh)
    series = (
        SeriesDefinition(
            file_pattern="work/polar_cap_time_series_NH/plot/timeseries_toz_NH_MAR.nc",
            sel={"dim0": 0},
            dimensions={
                "variable_id": "toz",
                "statistic": "Northern Hemisphere March polar mean",
            },
            values_name="toz",
            index_name="time",
            attributes=[],
        ),
    )

    @staticmethod
    def update_recipe(
        recipe: Recipe,
        input_files: dict[SourceDatasetType, pandas.DataFrame],
    ) -> None:
        """Update the recipe."""
        _prepare_recipe(
            recipe,
            input_files,
            "polar_cap_time_series_NH",
            "toz",
            cmip7_timerange="1950/2021",
        )

update_recipe(recipe, input_files) staticmethod #

Update the recipe.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
@staticmethod
def update_recipe(
    recipe: Recipe,
    input_files: dict[SourceDatasetType, pandas.DataFrame],
) -> None:
    """Update the recipe."""
    _prepare_recipe(
        recipe,
        input_files,
        "polar_cap_time_series_NH",
        "toz",
        cmip7_timerange="1950/2021",
    )

O3PolarCapTimeseriesSH #

Bases: ESMValToolDiagnostic

Calculate the ozone diagnostics - October SH polar mean (60S-85S) time series.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
class O3PolarCapTimeseriesSH(ESMValToolDiagnostic):
    """
    Calculate the ozone diagnostics - October SH polar mean (60S-85S) time series.
    """

    name = "Ozone Diagnostics"
    slug = "ozone-sh-oct"
    base_recipe = "ref/recipe_ref_ozone.yml"
    version = 4

    data_requirements = toz_data_requirement
    facets = ()
    test_data_spec = toz_test_spec
    files = (
        FileDefinition(
            file_pattern="plots/polar_cap_time_series_SH/plot/timeseries_toz_SH_Oct.png",
            dimensions={
                "variable_id": "toz",
                "statistic": "Southern Hemisphere October polar mean",
            },
        ),
    )
    # NOTE: ESMValTool sorts the datasets in the file by label, so the selector `dim0: 0` might be
    #       incorrect if models or observations with different names are used. (~fh)
    series = (
        SeriesDefinition(
            file_pattern="work/polar_cap_time_series_SH/plot/timeseries_toz_SH_Oct.nc",
            sel={"dim0": 0},
            dimensions={
                "variable_id": "toz",
                "statistic": "Southern Hemisphere October polar mean",
            },
            values_name="toz",
            index_name="time",
            attributes=[],
        ),
    )

    @staticmethod
    def update_recipe(
        recipe: Recipe,
        input_files: dict[SourceDatasetType, pandas.DataFrame],
    ) -> None:
        """Update the recipe."""
        _prepare_recipe(
            recipe,
            input_files,
            "polar_cap_time_series_SH",
            "toz",
            cmip7_timerange="1950/2021",
        )

update_recipe(recipe, input_files) staticmethod #

Update the recipe.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
@staticmethod
def update_recipe(
    recipe: Recipe,
    input_files: dict[SourceDatasetType, pandas.DataFrame],
) -> None:
    """Update the recipe."""
    _prepare_recipe(
        recipe,
        input_files,
        "polar_cap_time_series_SH",
        "toz",
        cmip7_timerange="1950/2021",
    )

O3ZonalMeanProfiles #

Bases: ESMValToolDiagnostic

Calculate the ozone diagnostics - stratospheric zonal mean profiles.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
class O3ZonalMeanProfiles(ESMValToolDiagnostic):
    """
    Calculate the ozone diagnostics - stratospheric zonal mean profiles.
    """

    name = "Ozone Diagnostics"
    slug = "ozone-zonal"
    base_recipe = "ref/recipe_ref_ozone.yml"
    version = 6

    data_requirements = (
        (
            DataRequirement(
                source_type=SourceDatasetType.CMIP6,
                filters=(
                    FacetFilter(
                        facets={
                            "variable_id": "o3",
                            "experiment_id": ("historical", "esm-hist"),
                            "table_id": "Amon",
                        },
                    ),
                ),
                group_by=("source_id", "experiment_id", "member_id", "grid_label"),
                constraints=(
                    RequireTimerange(
                        group_by=("instance_id",),
                        start=PartialDateTime(1990, 1),
                        end=PartialDateTime(2000, 12),
                    ),
                    RequireContiguousTimerange(group_by=("instance_id",)),
                ),
            ),
        ),
        (
            DataRequirement(
                source_type=SourceDatasetType.CMIP7,
                filters=(
                    FacetFilter(
                        facets={
                            "variable_id": "o3",
                            "experiment_id": ("historical", "esm-hist"),
                            "branded_variable": "o3_tavg-p19-hxy-air",
                            "frequency": "mon",
                            "region": "glb",
                        },
                    ),
                ),
                group_by=("source_id", "experiment_id", "variant_label", "grid_label"),
                constraints=(
                    RequireTimerange(
                        group_by=("instance_id",),
                        start=PartialDateTime(1990, 1),
                        end=PartialDateTime(2000, 12),
                    ),
                    RequireContiguousTimerange(group_by=("instance_id",)),
                ),
            ),
        ),
        # TODO: Use ESACCI-OZONE (SAGE-OMPS, variable o3) from obs4MIPs once available.
    )
    facets = ()
    test_data_spec = TestDataSpecification(
        test_cases=(
            TestCase(
                name="cmip6",
                description="Test with CMIP6 data.",
                requests=(
                    CMIP6Request(
                        slug="cmip6",
                        facets={
                            "experiment_id": "historical",
                            "frequency": "mon",
                            "source_id": "GFDL-ESM4",
                            "variable_id": "o3",
                        },
                        remove_ensembles=True,
                        time_span=("1990", "2001"),
                    ),
                ),
            ),
            TestCase(
                name="cmip7",
                description="Test with CMIP7 data.",
                requests=(
                    # Published CMIP7 o3 cannot be compared with obs yet:
                    # https://github.com/ESMValGroup/ESMValCore/issues/3093
                    ConvertedCMIP7Request(
                        slug="cmip7",
                        facets={
                            "experiment_id": ["historical"],
                            "source_id": "GFDL-ESM4",
                            "variable_id": "o3",
                            "branded_variable": [
                                "o3_tavg-p19-hxy-air",
                            ],
                            "variant_label": "r1i1p1f1",
                            "frequency": ["fx", "mon"],
                            "region": "glb",
                        },
                        remove_ensembles=True,
                        time_span=("1990", "2001"),
                    ),
                ),
            ),
        ),
    )

    @staticmethod
    def update_recipe(
        recipe: Recipe,
        input_files: dict[SourceDatasetType, pandas.DataFrame],
    ) -> None:
        """Update the recipe."""
        _prepare_recipe(recipe, input_files, "zonal_mean_profiles", "o3")

update_recipe(recipe, input_files) staticmethod #

Update the recipe.

Source code in packages/climate-ref-esmvaltool/src/climate_ref_esmvaltool/diagnostics/ozone.py
@staticmethod
def update_recipe(
    recipe: Recipe,
    input_files: dict[SourceDatasetType, pandas.DataFrame],
) -> None:
    """Update the recipe."""
    _prepare_recipe(recipe, input_files, "zonal_mean_profiles", "o3")