Mercurial > ~darius > hgwebdir.cgi > wh1080
view db/tidy-observations @ 8:e3d2b5500b53 default tip
Missed part of earlier commit to only print the query if -vv is used as well as compiling in the mysql stuff (now that I know -n DTRT)
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Thu, 11 Feb 2010 12:48:57 +1030 |
parents | 9dab44dcb331 |
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;