def process_data(context):
    """Generate summaries from raw weather station data.

    The meteorological day end (typically 2100 or 0900 local time) is
    set in the preferences file ``weather.ini``. The default value is
    2100 (2200 during DST), following the historical convention for
    weather station readings.

    """
    logger.info('Generating summary data')
    # get time of last record
    last_raw = context.raw_data.before(datetime.max)
    if last_raw is None:
        raise IOError('No data found. Check data directory parameter.')
    # get daytime end hour (in local time)
    day_end_hour, use_dst = get_day_end_hour(context.params)
    # get other config
    rain_day_threshold = float(
        context.params.get('config', 'rain day threshold', '0.2'))
    # calibrate raw data
    start = calibrate_data(context.params, context.raw_data, context.calib_data)
    # generate hourly data
    start = generate_hourly(context.calib_data, context.hourly_data, start)
    # generate daily data
    start = generate_daily(day_end_hour, use_dst,
                           context.calib_data, context.hourly_data, context.daily_data, start)
    # generate monthly data
    generate_monthly(rain_day_threshold, day_end_hour, use_dst,
                     context.daily_data, context.monthly_data, start)
    return 0
Generate summaries from raw weather station data.

    The meteorological day end (typically 2100 or 0900 local time) is
    set in the preferences file ``weather.ini``. The default value is
    2100 (2200 during DST), following the historical convention for
    weather station readings.