

def _period_cdd(self, period, unit, base, per_day):
    'The total cooling degree days observed during a particular\n        time period.\n\n        Parameters\n        ----------\n        period : eemeter.evaluation.Period\n            Time period over which cooling degree days will be summed.\n        unit : {"degC", "degF"}\n            The temperature unit to be used\n        base : int or float\n            The base of the cooling degree day\n        per_day : bool\n            If True, the total should be returned as an average instead of\n            a sum.\n\n        Returns\n        -------\n        out : float\n            Total cooling degree days observed during the time period.\n        '
    temps = self._period_daily_temperatures(temps, unit)
    masked_temps = np.ma.masked_array(temps, np.isnan(temps))
    total_cdd = np.sum(np.maximum((masked_temps - base), 0))
    if per_day:
        n_days = period.timedelta.days
        return (total_cdd / n_days)
    else:
        return total_cdd

dataset/ETHPy150Open impactlab/eemeter/eemeter/weather.py WeatherSourceBase._period_cdd/VarMisuse@26/252 `period`->`temps`