radarx.retrieve.lightning.lightning_jump#

radarx.retrieve.lightning.lightning_jump(flash_rate, *, period='2min', sigma=2.0, min_rate=10.0, history=5, group='6min', ddof=1)[source]#

Lightning jumps with the “2σ” algorithm of Schultz et al. (2009).

Parameters:
  • flash_rate (xarray.DataArray) – Total flash rate (flashes min-1) on a regularly spaced time dimension, e.g. cell_flash_rate(...).flash_rate; other dimensions (cells) are processed independently.

  • period (str or timedelta, optional) – Averaging period of the flash rate. Default "2min" (Schultz et al. 2011 [2] step (i); 2016 [3] step 1).

  • sigma (float, optional) – Sigma level of a jump. Default 2 (the “2σ” algorithm; chosen “on a trial and error basis” by Schultz et al. 2009 [1], p. 2550).

  • min_rate (float, optional) – Flash rate (flashes min-1) the averaged rate must reach for a jump. Default 10 (Schultz et al. 2009 [1], p. 2550; 2011 [2] step (ii); 2016 [3] step 5). Applied to the averaged rate with >=, see Notes.

  • history (int, optional) – Number of previous DFRDT values of the standard deviation. Default 5 (Schultz et al. 2009 [1] p. 2549; 2011 [2] steps (iii)-(v); 2016 [3] step 3). The sigma level is first defined at the seventh period, i.e. after the 14-min spin-up of Schultz et al. 2016 [3] (six 2-min periods give the five DFRDT values, the seventh period is the current one).

  • group (str or timedelta, optional) – Jumps starting within this time of the start of an earlier one are not new jumps. Default "6min" (Schultz et al. 2009 [1] p. 2550; 2016 [3] step 6).

  • ddof (int, optional) – Delta degrees of freedom of the standard deviation. Default 1 (sample standard deviation); a radarx choice, see Notes.

Returns:

xarray.Dataset – On the averaging periods (time: first input time of each period): flash_rate (averaged), dfrdt (flashes min-2), sigma_level, jump (a jump is in progress) and jump_start (first period of a new jump).

Notes

The steps are those listed by Schultz et al. (2011) [2] (section 2c, pp. 747-748, appendix p. 753) and Schultz et al. (2016) [3] (section 2c, pp. 97-98), after the “2σ” algorithm of Schultz et al. (2009) [1] (pp. 2547-2550). The papers differ in, or leave open, the following points, so the conventions here are stated explicitly; they only matter for exact ties and for the absolute size of the sigma level.

  • Trigger. Schultz et al. (2009, p. 2550; 2011, step (vii)) say a jump occurs once DFRDT “exceeds” the 2σ threshold, and 2016 (step 5) that the flash rate “exceeds” 10 flashes min-1, i.e. strict inequalities. Schultz et al. 2016 (step 4) also call a “2σ jump” one with a sigma level of 2. Here a jump needs sigma_level >= sigma and flash_rate >= min_rate, which differs from the strict reading only when the values are exactly equal.

  • End of a jump. Schultz et al. (2009, p. 2550; 2011, section 3a, p. 748) end a jump once DFRDT is “less than or equal to 0”, whereas Schultz et al. (2016, step 5) end it once the sigma level “drops below zero”. Here the 2016 convention is used: the jump continues while sigma_level >= 0 and ends at a negative or undefined (NaN) sigma level. For a perfectly constant averaged rate with a non-zero standard deviation of the previous values (DFRDT = 0) the jump therefore continues here, where the 2009 and 2011 rule would end it.

  • Grouping. Jumps “separated by 6 min or fewer” are one jump (2009, p. 2550; “jump, no jump, jump in consecutive periods”), and within 6 min “only the first jump remains” (2016, step 6). Here a start counts as a new jump (jump_start) only when more than group has passed since the start of the most recent jump, including starts that were merged; jump itself is not merged. This reading of “separated” is a radarx choice.

  • Standard deviation. The papers say “standard deviation” of the five previous DFRDT values and do not say whether it is the sample or the population one. ddof=1 (sample) is a radarx choice; ddof=0 (population) would multiply every sigma level by \(\sqrt{n/(n-1)} = \sqrt{5/4} \approx 1.118\) for history \(n = 5\). This cannot be settled from the papers.

  • Zero standard deviation. If the previous DFRDT values are all equal (a perfectly linear ramp of the rate), the sigma level is infinite with the sign of DFRDT, and NaN when DFRDT is also zero. A positive DFRDT then triggers (if the rate is high enough), as the rule “DFRDT exceeds twice the standard deviation” (zero) of Schultz et al. gives.

  • Averaging. The flash rate is averaged over period from the first input time on; the 10 flashes min-1 activation is applied to this average (2011, step (ii)), not to the 1-min rates. The standard deviation uses the five values before the current one, “not including the period of interest” (2009, p. 2549).

References