diff --git a/README.md b/README.md index 9b7c377..9555cd2 100644 --- a/README.md +++ b/README.md @@ -858,7 +858,7 @@ GRIB File: contains data starting from step 0 to 72 every 6 hours: 0,6,12,18,24, Day 2: same as Day 1 starting from (24+24)-24=24: the step 24 will have a weight of 3, while steps 30,36 and 42 will be counted 6 times, and finally the step 48 will have a weight of 3. -- if start_step is zero or is not specified, the aggregation will start from 0 +- if start_step is zero or is not specified, the aggregation will behave exactly as using start_step=24, so it will start from 1 ### Accumulation For precipitation values, accumulation over 6 or 24 hours is often performed. Here's an example of configuration and execution output in DEBUG mode. diff --git a/src/pyg2p/main/manipulation/aggregator.py b/src/pyg2p/main/manipulation/aggregator.py index cf385ff..640bed6 100644 --- a/src/pyg2p/main/manipulation/aggregator.py +++ b/src/pyg2p/main/manipulation/aggregator.py @@ -167,13 +167,13 @@ def _average(self, values): v_ord = collections.OrderedDict(sorted(dict((k.end_step, v_) for (k, v_) in values.items()).items(), key=lambda k: k)) if self._start == 0 or self._second_t_res: iter_start = self._start - iter_end = self._end - self._aggregation_step + 2 + iter_end = self._end - self._aggregation_step + 2 # CR: TODO: check if +2 instead of +1 is actually needed else: iter_start = self._start - self._aggregation_step iter_end = self._end - self._aggregation_step + 1 for iter_ in range(iter_start, iter_end, self._aggregation_step): - if self._aggregation_halfweights or self._start == 0: + if self._aggregation_halfweights: iter_from = iter_ iter_to = iter_ + self._aggregation_step + 1 else: