view db/tidy-observations @ 0:9dab44dcb331

Initial commit of Greg's code from http://www.lemis.com/grog/tmp/wh1080.tar.gz
author Daniel O'Connor <darius@dons.net.au>
date Tue, 09 Feb 2010 13:44:25 +1030
parents
children
line wrap: on
line source

/*
 * $Id: tidy-observations,v 1.4 2010/01/03 03:03:17 grog Exp grog $
 *
 * Tidy up messed-up values returned from various stations.
 */
USE weather
UPDATE remote_observations SET wind_gust = NULL WHERE wind_gust < 0;
UPDATE remote_observations SET rain = NULL WHERE rain < 0;
/* Never likely to go below this temperature here */
UPDATE remote_observations SET outside_temp = NULL WHERE outside_temp < -10;
/* This one is 0° F, which must mean something special to Wunderground */
UPDATE remote_observations SET outside_dewpoint = NULL WHERE outside_dewpoint = -17.8;
UPDATE remote_observations SET wind_gust = NULL WHERE wind_gust < 0;
UPDATE remote_observations SET rain = NULL WHERE rain < 0;
UPDATE remote_observations SET wind_speed = NULL WHERE wind_speed < 0;
UPDATE remote_observations SET outside_humidity = NULL WHERE outside_humidity < 0;
UPDATE remote_observations SET wind_direction = NULL WHERE wind_direction < 0;
UPDATE remote_observations SET pressure_msl = NULL WHERE pressure_msl < 900 OR pressure_msl > 1100;
UPDATE remote_observations SET outside_dewpoint = NULL WHERE outside_dewpoint < -20;