index_calculator.index_calculator

class index_calculator.index_calculator(write=False, **kwargs)

Class for calculating climate indices with xclim.

Parameters

write (bool (default: False), optional) – If True write climate index dataset on disk.

Notes

For more parameter information see:

Example

Calculate climate indicator and write dataset as netcdf fiel on disk:

from pyhomogenize import open_xrdataset
from index_calculator import index_calculator

netcdf_file = "tas_EUR-11_MPI-M-MPI-ESM-LR_historical_r3i1p1_"
              "GERICS-REMO2015_v1_day_20010101-20051231.nc"
ds = open_xrdataset(netcdf_file)

idx = index_calculator(
        write=True,
        ds=ds,
        index="TG",
        project="CORDEX",
        institution_id="GERICS",
        institution="Helmholtz-Zentrum hereon GmbH,"
                    "Climate Service Center Germany",
        contact="gerics-cordex@hereon.de",
)

--> File written: cordex/climdex/EUR-11/GERICS/GERICS/MPI-M-MPI-ESM-LR/
                  historical/r3i1p1/GERICS-REMO2015/v1/year/TG/
                  TG_EUR-11_MPI-M-MPI-ESM-LR_historical_r3i1p1_
                  GERICS-REMO2015_v1_day_GERICS_year_2001-2005.nc
__init__(write=False, **kwargs)

Methods

__init__(*args, **kwargs)

Initialize self.