Tests for tag $station

Station location: Ĺōćāţĩőń with UTF8 characters
Latitude: 45° 41.16' N
Longitude: 121° 33.96' W
Altitude (default unit): 328 feet
Altitude (feet): 328 feet
Altitude (meters): 100 meters

Tests for tag $current

Current dateTime: 03-Sep-2010 11:00
Current dateTime with formatting: 11:00
Raw dateTime: 1283536800
Outside Temperature (normal formatting) 63.9°F
Outside Temperature (explicit unit conversion to Celsius) 17.7°C
Outside Temperature (explicit unit conversion to Fahrenheit) 63.9°F
Outside Temperature (explicit unit conversion to Celsius, plus formatting) 17.734°C
Outside Temperature (explicit unit conversion to Fahrenheit, plus formatting) 63.921°F
Outside Temperature (with explicit binding to 'wx_binding') 63.9°F
Outside Temperature (with explicit binding to 'alt_binding') 25.1°F
Outside Temperature with nonsense binding $current($data_binding='foo_binding').outTemp $current($data_binding='foo_binding').outTemp
Outside Temperature with explicit time 63.9°F
Outside Temperature with nonsense time N/A
Outside Temperature trend (3 hours) 15.1°F
Outside Temperature trend with explicit time_delta (3600 seconds) 5.2°F
Trend with nonsense type $trend.foobar
Barometer (normal) 29.207 inHg
Barometer trend where previous value is known to be None (3 hours) N/A
Barometer using $latest 29.207 inHg
Barometer using $latest and explicit data binding 29.670 inHg at 1283536800
Wind Chill (normal) 63.9°F
Heat Index (normal) 63.9°F
Heat Index (in Celsius) 17.7°C
Heat Index (in Fahrenheit) 63.9°F
Dewpoint 58.2°F
Humidity 82%
Wind 18 mph from 128°
Wind (beaufort) 4
Rain Rate 0.00 in/h
Inside Temperature 68.0°F
Test tag "exists" for an existent type: $current.outTemp.exists TRUE
Test tag "exists" for a nonsense type: $current.nonsense.exists FALSE
Test tag "has_data" for an existing type with data: $current.outTemp.has_data TRUE
Test tag "has_data" for an existing type without data: $current.hail.has_data FALSE
Test tag "has_data" for a nonsense type: $current.nonsense.has_data FALSE
Test tag "has_data" for the last hour: $hour.outTemp.has_data TRUE
Test tag "has_data" for the last hour of a nonsense type: $hour.nonsense.has_data FALSE
Test for a bad observation type on a $current tag: $current.foobar ?'foobar'?

Tests for tag $hour

Start of hour: 09/03/2010 10:00:00
Start of hour (unix epoch time): 1283533200
Max Temperature 63.9°F
Min Temperature 61.4°F
Time of max temperature: 11:00
Time of min temperature: 10:30

Wind related tags

$current

$current.windSpeed 18 mph
$current.windDir 128°
$current.windGust 22 mph
$current.windGustDir 128°

$hour

Hour start, stop 1283533200
1283536800
$hour.wind.vecdir 127°
$hour.wind.vecavg 18 mph
$hour.wind.max 22 mph
$hour.wind.gustdir 126°
$hour.wind.maxtime 10:30

$month

$month.start.raw 1283324400
$month.end.raw 1285916400
$month.length.raw 2592000
$month.start 01-Sep-2010 00:00
$month.end 01-Oct-2010 00:00
$month.length 2592000 seconds
$month.length.long_form("%(day)d %(day_label)s") 30 days
$month.windSpeed.avg 11 mph
$month.wind.avg 11 mph
$month.wind.vecavg 8 mph
$month.wind.vecdir 061°
$month.windGust.max 24 mph
$month.wind.max 24 mph
$month.wind.gustdir 090°
$month.windGust.maxtime 03-Sep-2010 01:00
$month.wind.maxtime 03-Sep-2010 01:00
$month.windSpeed.max 20 mph
$month.windDir.avg 168°

Iterate over three hours:

Start of hour Min temperature When
07:00 46.7°F 07:30
08:00 51.2°F 08:30
09:00 56.2°F 09:30
10:00 61.4°F 10:30

Tests for tag $span

Current dateTime: 03-Sep-2010 11:00
Min Temperature in last hour (via $span($time_delta=3600)): 61.4°F
Min Temperature in last hour (via $span($hour_delta=1)): 61.4°F
Min Temperature in last 90 min (via $span($time_delta=5400)): 58.8°F
Min Temperature in last 90 min (via $span($hour_delta=1.5)): 58.8°F
Max Temperature in last 24 hours (via $span($time_delta=86400)): 79.2°F
Max Temperature in last 24 hours (via $span($hour_delta=24)): 79.2°F
Max Temperature in last 24 hours (via $span($day_delta=1)): 79.2°F
Min Temperature in last 7 days (via $span($time_delta=604800)): 38.9°F
Min Temperature in last 7 days (via $span($hour_delta=168)): 38.9°F
Min Temperature in last 7 days (via $span($day_delta=7)): 38.9°F
Min Temperature in last 7 days (via $span($week_delta=1)): 38.9°F
Rainfall in last 24 hours (via $span($time_delta=86400)): 1.28 in
Rainfall in last 24 hours (via $span($hour_delta=24)): 1.28 in
Rainfall in last 24 hours (via $span($day_delta=1)): 1.28 in
Max Windchill in last hour (existing obs type that is None): 63.9°F

Tests for tag $day

Start of day: 09/03/2010 00:00:00
Start of day (unix epoch time): 1283497200
End of day (unix epoch time): 1283583600
Max Temperature 63.9°F
Min Temperature 38.9°F
Time of max temperature: 11:00
Time of min temperature: 04:00
Last temperature of the day 63.9°F
Time of the last temperature of the day 09/03/2010 11:00:00
First temperature of the day 46.8°F
Time of the first temperature of the day 09/03/2010 00:30:00
Max Temperature in alt_binding 25.1°F
Max Temperature with bogus binding $day($data_binding='foo_binding').outTemp.max
Min temp with explicit conversion to Celsius 3.8°C
Min temp with explicit conversion to Fahrenheit 38.9°F
Min temp with explicit conversion to nonsense type $day.outTemp.min.badtype
Min temperature with inappropriate conversion: $day.outTemp.min.mbar $day.outTemp.min.mbar
Max value for a type with no data: $day.UV.max N/A
Sum aggregation (rain) 0.76 in
Aggregation of xtype: $day.humidex.avg 47.8°F
Aggregation of xtype: $day.humidex.min 38.9°F
Aggregation of xtype: $day.humidex.mintime 04:00
Aggregation of xtype: $day.humidex.max 70.6°F
Aggregation of xtype: $day.humidex.maxtime 11:00
High Wind from "$day.wind.max" 24 mph from 090° at 01:00
High Wind from "$day.windGust.max" 24 mph
High Wind from "$day.windSpeed.max" 20 mph
Average wind from "$day.wind.avg" 19 mph
Average wind from "$day.windSpeed.avg" 19 mph
Average wind w/alt_binding: "$day(data_binding='alt_binding').wind.avg" 7 mph
RMS aggregation: "$day.wind.rms" 19 mph
Vector average: "$day.wind.vecavg" 19 mph
Aggregation Vector Direction (wind) 107°
Test tag "has_data" with nonsense type $day.nonsense.has_data FALSE
Test tag "exists" with an existing type that has no data $day.UV.exists TRUE
Test tag "has_data" with existent type that has no data $day.UV.has_data FALSE
Test tag "has_data" with existent type that has data $day.outTemp.has_data TRUE
Test tag "not_null" with existent type that has no data $day.UV.not_null 0
Test tag "not_null" with existent type that has data $day.outTemp.not_null 1
Test for a bad observation type on a $day tag: $day.foobar.min $day.foobar.min
Test for a bad aggregation type on a $day tag: $day.outTemp.foo $day.outTemp.foo
Test tag "has_data" for an xtype: $day.humidex.has_data TRUE
Test tag "has_data" for another xtype: $month.heatdeg.has_data TRUE
Test for sunshineDur: $day.sunshineDur.sum 25200 seconds
Test for sunshineDur: $day.sunshineDur.sum.long_form 7 hours, 0 minutes, 0 seconds
Test for sunshineDur, custom format: 7 hours, 0 minutes
sunshineDur in hours: 7.00 hours
$day.stringData.first.raw S1283499000
$day.stringData.last.raw S1283536800
$day.stringData.first.format("%s") S1283499000

Tests for tag $yesterday

Start of yesterday: 09/02/2010 00:00:00
Start of yesterday (unix epoch time): 1283410800
Max Temperature yesterday 79.2°F
Min Temperature yesterday 39.5°F
Time of max temperature yesterday: 16:00
Time of min temperature yesterday: 04:00
Yesterday's last temperature 49.0°F
Time of yesterday's last temperature 09/03/2010 00:00:00

Tests for tag $rainyear

Rainyear total 79.36 in

Test for tag $alltime

Max temp from $alltime.outTemp.max 100.0°F
at 02-Jul-2010 16:00
High Wind from "$alltime.wind.max" 24 mph
from 090°
at 02-Jan-2010 00:00

Test for tag $seven_day

Max temp from $seven_day.outTemp.max 82.7°F
at 27-Aug-2010 16:00
High Wind from "$seven_day.wind.max" 24 mph
from 090°
at 30-Aug-2010 01:00

Test for various versions of $colorize

Current temperature using $colorize_1 63.9°F
Current temperature using $colorize_2 63.9°F
Current temperature using $colorize_3 63.9°F

Tests at timestamp 1280692800, when the temperature is null:

Null temperature using $colorize_1 N/A
Null temperature using $colorize_2 N/A
Null temperature using $colorize_3 N/A

Tests for tag $Extras

Radar URL "http://radar.weather.gov/ridge/lite/N0R/RTX_loop.gif"

Tests for tag $almanac

Sunrise: 06:29
Sunset: 19:40
Moon: Waning crescent (29%full)
$almanac.sun.visible: 13 hours, 10 minutes, 42 seconds
(47442 seconds)
$almanac.sun.visible_change: 3 minutes, 6 seconds (-186 seconds)

Test for tag $unit

Tag "$unit.unit_type.outTemp" degree_F
Tag "$unit.label.outTemp" °F
Tag "$unit.format.outTemp" %.1f
Example from customizing guide
("$day.outTemp.max.format(add_label=False)$unit.label.outTemp")
63.9°F
Test the above with backwards compatibility
("$day.outTemp.max.formatted$unit.label.outTemp")
63.9°F
Add a new unit type, existing group degree_F
Check its label °F
Check its format %.1f
Add a new unit type, new group amp
Check its label A
Check its format %.1f

Test for tag $obs

Tag "$obs.label.outTemp" Outside Temperature

Test for formatting examples in the Customizing Guide

$current.outTemp 63.9°F
$current.outTemp.format 63.9°F
$current.outTemp.format() 63.9°F
$current.outTemp.format(format_string="%.3f") 63.921°F
$current.outTemp.format("%.3f") 63.921°F
$current.outTemp.format(add_label=False) 63.9
$current.UV N/A
$current.UV.format(None_string="No UV") No UV
$current.windDir 128°
$current.windDir.ordinal_compass SE
$current.dateTime 03-Sep-2010 11:00
$current.dateTime.format(format_string="%H:%M") 11:00
$current.dateTime.format("%H:%M") 11:00
$current.dateTime.raw 1283536800
$current.outTemp.raw 63.92146

Test for aggregates

$month.outTemp.maxmin 40.1°F
$month.outTemp.maxmintime 01-Sep-2010 04:00
$month.outTemp.minmax 63.9°F
$month.outTemp.minmaxtime 03-Sep-2010 11:00
$month.outTemp.minsum 981.7°F
$month.outTemp.minsumtime 03-Sep-2010 00:00
$month.outTemp.maxsumtime 02-Sep-2010 00:00
$month.heatdeg.sum 29.4°F-day
$month.cooldeg.sum 0.0°F-day
$month.growdeg.sum 18.8°F-day
$year.rain.sum_le((0.1, 'inch', 'group_rain')) 122
$year.outTemp.avg_ge((41, 'degree_F', 'group_temperature')) 153
$year.outTemp.avg_le((32, 'degree_F', 'group_temperature')) 80

Tests for $gettext

$lang en
$page test
$gettext("Foo") Foo
$gettext("Today") Today
$pgettext("test","Plots") test
$pgettext($page,"Plots") History
$pgettext($page,"Something") Something
$pgettext("Foo","Plots") Plots
$pgettext("Foo","Bar") Bar