pywws.process

Generate hourly, daily & monthly summaries of raw weather station data

usage: python -m pywws.process [options] data_dir
options are:
 -h or --help     display this help
 -v or --verbose  increase number of informative messages
data_dir is the root directory of the weather data

This module takes raw weather station data (typically sampled every five or ten minutes) and generates hourly, daily and monthly summary data, which is useful when creating tables and graphs.

Before computing the data summaries, raw data is “calibrated” using a user-programmable function. See pywws.calib for details.

The hourly data is derived from all the records in one hour, e.g. from 18:00:00 to 18:59:59, and is given the index of the last complete record in that hour.

The daily data summarises the weather over a 24 hour period typically ending at 2100 or 0900 hours, local (non DST) time, though midnight is another popular convention. It is also indexed by the last complete record in the period. Daytime and nighttime, as used when computing maximum and minimum temperatures, are assumed to start at 0900 and 2100 local time, or 1000 and 2200 when DST is in effect, regardless of the meteorological day.

To adjust the meteorological day to your preference, or that used by your local official weather station, edit the “day end hour” line in your weather.ini file, then run pywws.reprocess to regenerate the summaries.

Monthly summary data is computed from the daily summary data. If the meteorological day does not end at midnight, then each month may begin and end up to 12 hours before or after midnight.

Wind speed data is averaged over the hour (or day) and the maximum gust speed during the hour (or day) is recorded. The predominant wind direction is calculated using vector arithmetic.

Rainfall is converted from the raw “total since last reset” figure to a more useful total in the last hour, day or month.

Functions

calibrate_data(params, raw_data, calib_data)

'Calibrate' raw data, using a user-supplied function.

generate_daily(day_end_hour, use_dst, ...)

Generate daily summaries from calibrated and hourly data.

generate_hourly(calib_data, hourly_data, ...)

Generate hourly summaries from calibrated data.

generate_monthly(rain_day_threshold, ...)

Generate monthly summaries from daily data.

get_day_end_hour(params)

main([argv])

process_data(context)

Generate summaries from raw weather station data.

Classes

Average()

Compute average of multiple data values.

DayAcc()

'Accumulate' weather data to produce daily summary.

HourAcc(last_rain)

'Accumulate' raw weather data to produce hourly summary.

Maximum()

Compute maximum value and timestamp of multiple data values.

Minimum()

Compute minimum value and timestamp of multiple data values.

MonthAcc(rain_day_threshold)

'Accumulate' daily weather data to produce monthly summary.

WindFilter([decay])

Compute average wind speed and direction.


Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.