cerfacs-globc/icclim

ENH: Enable indices grouped called for icclim

bzah opened this issue · 0 comments

bzah commented
  • icclim version: 5.0.2
  • Python version: all

Description

Through discussions it appears a few people would be interested in computing multiple indices at once.
This is an existing feature of climpact, which can compute all possible indices in one call.

Examples of calls

All heat indices (tx90p, wsdi, txx...)

icclim.index(group="heat", 
                      in_files="netcdf_files/tasmax.1991-2010.nc", 
                      out_file="netcdf_files/output/heat_indices.nc" )

All heat and all cold indices (assuming input contains both tasmax and tasmin variables)

icclim.index(group=["heat", "cold"], 
                      in_files="netcdf_files/input.1991-2010.nc", 
                      out_file="netcdf_files/output/heat_indices.nc" )

All 49 indices (assuming tas, tasmax, tasmin and pr exist in input file).

icclim.index(group="all", 
                      in_files=["tasmax.nc", "tasmin.nc", "tas.nc", "pr.nc"]
                      out_file="netcdf_files/output/all_indices.nc" )

Notes

1/ We might need optimize a few things though:
For example WSDI and TX90p would both require the bootstrapping of percentiles of tasmax. Instead of doing it twice it's obviously better to reuse the resulting percentiles.
We must investigate if dask graph optimization is sufficient to properly group identical operations.

If it's not the case we will have quite a lot of work to optimize this.
But we can publish a non optimized version and work on this in a new issue.

2/ I'm not sure if we should create a single netcdf output or multiple files. We could also have a parameter to let the user control this ?