rcatool.stats.climateindex.cdd

rcatool.stats.climateindex.cdd(data, thr=1.0, periods=array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60]), maxper=False, axis=0, keepdims=False)[source]

Calculate the Consecutive Dry Days index (CDD).

Parameters:
  • data (array) – 1D/2D daily precipitation data array in mm.

  • thr (float) – Value of threshold to define dry day. Default 1 mm.

  • periods (list/array) – Array of lenghts of dry periods to consider; e.g. [1, 3, 10, 14, 21, 30] computes frequency of dry periods with lengths 1-3 days, 3-10 days, etc. Leftmost interval edge is included, not the right. Default periods is set to 60 days with 1 day increment.

  • maxper (boolean) – If set to True the longest CDD period and positioned at last position in returned array. Default False.

  • axis (int) – Along which axis to calculate cdd. Defaults to 0

  • keepdims (boolean) – If False (default) calculation is performed on all data collectively, otherwise for each timeseries on each point in 2d space. ‘Axis’ then defines along which axis the timeseries are located.

Returns:

  • dlen (list) – list with lengths of each dry day event in timeseries

  • cdd (list/array) – 1D/2D array with frequencies of cdd intervals. For intervals where non exists, positions are set to NaN. Length of returned array (along computed ‘axis’) is equal to length of ‘periods’ list/array minus 1.