Code to aggregate up from hourly data to daily, monthly, etc