-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
477 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from xml.etree.ElementInclude import include | ||
from datetime import datetime | ||
from weewx.cheetahgenerator import SearchList | ||
|
||
|
||
class ArchiveUtil(SearchList): | ||
def filter_months(self, months, year): | ||
""" | ||
Returns a filtred list of months | ||
Args: | ||
months (list): A list of months [2022-01, 2022-02] | ||
year (string): Year. | ||
Returns: | ||
str: A icon include string. | ||
""" | ||
months_filtered = [] | ||
|
||
for month in months: | ||
if year in month: | ||
months_filtered.append(month) | ||
|
||
return months_filtered | ||
|
||
def month_string_format(self, month): | ||
""" | ||
Returns a formatted value of a weewwx month string (2022-01) | ||
Args: | ||
month (string): A month | ||
Returns: | ||
str: Formatted month string. | ||
""" | ||
date_time_obj = datetime. strptime(month, '%Y-%m') | ||
|
||
return date_time_obj.strftime('%B') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "weewx-wdc", | ||
"version": "1.0.0-alpha2", | ||
"version": "1.0.0-alpha3", | ||
"description": "Weather Data Center skin for weewx.", | ||
"author": "David Baetge <[email protected]>", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#errorCatcher Echo | ||
#set $YM="%Y %m" | ||
#set $D=" %d" | ||
#set $M=" %b" | ||
#set $Time=" %H:%M" | ||
#set $NODAY=" N/A" | ||
#set $Temp="%6.1f" | ||
#set $Wind="%6.1f" | ||
#set $Dir="%6.0f" | ||
#set $Count="%6d" | ||
#set $NONE=" N/A" | ||
#if $unit.unit_type_dict.group_rain == "mm" | ||
#set $Rain="%6.1f" | ||
#else | ||
#set $Rain="%6.2f" | ||
#end if | ||
MONTHLY CLIMATOLOGICAL SUMMARY for $month_name $year_name | ||
|
||
|
||
NAME: $station.location | ||
ELEV: $station.altitude LAT: $station.latitude[0]-$station.latitude[1] $station.latitude[2] LONG: $station.longitude[0]-$station.longitude[1] $station.longitude[2] | ||
|
||
|
||
TEMPERATURE ($unit.label.outTemp.strip()), RAIN ($unit.label.rain.strip()), WIND SPEED ($unit.label.windSpeed.strip()) | ||
|
||
HEAT COOL AVG | ||
MEAN DEG DEG WIND DOM | ||
DAY TEMP HIGH TIME LOW TIME DAYS DAYS RAIN SPEED HIGH TIME DIR | ||
--------------------------------------------------------------------------------------- | ||
#for $day in $month.days | ||
#if $day.outTemp.has_data or $day.rain.has_data or $day.wind.has_data | ||
$day.dateTime.format($D, add_label=False) $day.outTemp.avg.format($Temp,$NONE,add_label=False) $day.outTemp.max.format($Temp,$NONE,add_label=False) $day.outTemp.maxtime.format($Time,add_label=False) $day.outTemp.min.format($Temp,$NONE,add_label=False) $day.outTemp.mintime.format($Time,add_label=False) $day.heatdeg.sum.format($Temp,$NONE,add_label=False) $day.cooldeg.sum.format($Temp,$NONE,add_label=False) $day.rain.sum.format($Rain,$NONE,add_label=False) $day.wind.avg.format($Wind,$NONE,add_label=False) $day.wind.max.format($Wind,$NONE,add_label=False) $day.wind.maxtime.format($Time,add_label=False) $day.wind.vecdir.format($Dir,$NONE,add_label=False) | ||
#else | ||
$day.dateTime.format($D) | ||
#end if | ||
#end for | ||
#if $month.outTemp.has_data or $month.rain.has_data or $month.wind.has_data | ||
--------------------------------------------------------------------------------------- | ||
$month.outTemp.avg.format($Temp,$NONE,add_label=False) $month.outTemp.max.format($Temp,$NONE,add_label=False) $month.outTemp.maxtime.format($D,add_label=False) $month.outTemp.min.format($Temp,$NONE,add_label=False) $month.outTemp.mintime.format($D,add_label=False) $month.heatdeg.sum.format($Temp,$NONE,add_label=False) $month.cooldeg.sum.format($Temp,$NONE,add_label=False) $month.rain.sum.format($Rain,$NONE,add_label=False) $month.wind.avg.format($Wind,$NONE,add_label=False) $month.wind.max.format($Wind,$NONE,add_label=False) $month.wind.maxtime.format($D,add_label=False) $month.wind.vecdir.format($Dir,add_label=False) | ||
#end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#errorCatcher Echo | ||
#set $YM="%Y %m" | ||
#set $D=" %d" | ||
#set $M=" %b" | ||
#set $NODAY=" N/A" | ||
#set $Temp="%6.1f" | ||
#set $Wind="%6.1f" | ||
#set $Dir="%6.0f" | ||
#set $Count="%6d" | ||
#set $NONE=" N/A" | ||
#if $unit.unit_type_dict.group_temperature == "degree_F" | ||
#set $Hot =(90.0,"degree_F") | ||
#set $Cold =(32.0,"degree_F") | ||
#set $VeryCold=(0.0, "degree_F") | ||
#else | ||
#set $Hot =(30.0,"degree_C") | ||
#set $Cold =(0.0,"degree_C") | ||
#set $VeryCold=(-20.0,"degree_C") | ||
#end if | ||
#if $unit.unit_type_dict.group_rain == "inch" | ||
#set $Trace =(0.01,"inch") | ||
#set $SomeRain =(0.1, "inch") | ||
#set $Soak =(1.0, "inch") | ||
#set $Rain="%6.2f" | ||
#elif $unit.unit_type_dict.group_rain == "mm" | ||
#set $Trace =(.3, "mm") | ||
#set $SomeRain =(3, "mm") | ||
#set $Soak =(30.0,"mm") | ||
#set $Rain="%6.1f" | ||
#else | ||
#set $Trace =(.03,"cm") | ||
#set $SomeRain =(.3, "cm") | ||
#set $Soak =(3.0,"cm") | ||
#set $Rain="%6.2f" | ||
#end if | ||
#def ShowInt($T) | ||
$("%6d" % $T[0])#slurp | ||
#end def | ||
#def ShowFloat($R) | ||
$("%6.2f" % $R[0])#slurp | ||
#end def | ||
CLIMATOLOGICAL SUMMARY for year $year_name | ||
|
||
|
||
NAME: $station.location | ||
ELEV: $station.altitude LAT: $station.latitude[0]-$station.latitude[1] $station.latitude[2] LONG: $station.longitude[0]-$station.longitude[1] $station.longitude[2] | ||
|
||
|
||
TEMPERATURE ($unit.label.outTemp.strip()) | ||
|
||
HEAT COOL MAX MAX MIN MIN | ||
MEAN MEAN DEG DEG >= <= <= <= | ||
YR MO MAX MIN MEAN DAYS DAYS HI DAY LOW DAY $ShowInt($Hot) $ShowInt($Cold) $ShowInt($Cold) $ShowInt($VeryCold) | ||
------------------------------------------------------------------------------------------------ | ||
#for $month in $year.months | ||
#if $month.outTemp.has_data | ||
$month.dateTime.format($YM) $month.outTemp.meanmax.format($Temp,$NONE,add_label=False) $month.outTemp.meanmin.format($Temp,$NONE,add_label=False) $month.outTemp.avg.format($Temp,$NONE,add_label=False) $month.heatdeg.sum.format($Temp,$NONE,add_label=False) $month.cooldeg.sum.format($Temp,$NONE,add_label=False) $month.outTemp.max.format($Temp,$NONE,add_label=False) $month.outTemp.maxtime.format($D,$NODAY) $month.outTemp.min.format($Temp,$NONE,add_label=False) $month.outTemp.mintime.format($D,$NODAY) $month.outTemp.max_ge($Hot).format($Count,$NONE,add_label=False) $month.outTemp.max_le($Cold).format($Count,$NONE,add_label=False) $month.outTemp.min_le($Cold).format($Count,$NONE,add_label=False) $month.outTemp.min_le($VeryCold).format($Count,$NONE,add_label=False) | ||
#else | ||
$month.dateTime.format($YM) | ||
#end if | ||
#end for | ||
#if $year.outTemp.has_data | ||
------------------------------------------------------------------------------------------------ | ||
$year.outTemp.meanmax.format($Temp,$NONE,add_label=False) $year.outTemp.meanmin.format($Temp,$NONE,add_label=False) $year.outTemp.avg.format($Temp,$NONE,add_label=False) $year.heatdeg.sum.format($Temp,$NONE,add_label=False) $year.cooldeg.sum.format($Temp,$NONE,add_label=False) $year.outTemp.max.format($Temp,$NONE,add_label=False) $year.outTemp.maxtime.format($M,$NODAY) $year.outTemp.min.format($Temp,$NONE,add_label=False) $year.outTemp.mintime.format($M,$NODAY) $year.outTemp.max_ge($Hot).format($Count,$NONE,add_label=False) $year.outTemp.max_le($Cold).format($Count,$NONE,add_label=False) $year.outTemp.min_le($Cold).format($Count,$NONE,add_label=False) $year.outTemp.min_le($VeryCold).format($Count,$NONE,add_label=False) | ||
#end if | ||
|
||
|
||
PRECIPITATION ($unit.label.rain.strip()) | ||
|
||
MAX ---DAYS OF RAIN--- | ||
OBS. OVER | ||
YR MO TOTAL DAY DATE $ShowFloat(Trace) $ShowFloat($SomeRain) $ShowFloat($Soak) | ||
------------------------------------------------ | ||
#for $month in $year.months | ||
#if $month.rain.has_data | ||
$month.dateTime.format($YM) $month.rain.sum.format($Rain,$NONE,add_label=False) $month.rain.maxsum.format($Rain,$NONE,add_label=False) $month.rain.maxsumtime.format($D,$NODAY) $month.rain.sum_ge($Trace).format($Count,$NONE,add_label=False) $month.rain.sum_ge($SomeRain).format($Count,$NONE,add_label=False) $month.rain.sum_ge($Soak).format($Count,$NONE,add_label=False) | ||
#else | ||
$month.dateTime.format($YM) | ||
#end if | ||
#end for | ||
#if $year.rain.has_data | ||
------------------------------------------------ | ||
$year.rain.sum.format($Rain,$NONE,add_label=False) $year.rain.maxsum.format($Rain,$NONE,add_label=False) $year.rain.maxsumtime.format($M,$NODAY) $year.rain.sum_ge($Trace).format($Count,$NONE,add_label=False) $year.rain.sum_ge($SomeRain).format($Count,$NONE,add_label=False) $year.rain.sum_ge($Soak).format($Count,$NONE,add_label=False) | ||
#end if | ||
|
||
|
||
WIND SPEED ($unit.label.windSpeed.strip()) | ||
|
||
DOM | ||
YR MO AVG HI DATE DIR | ||
----------------------------------- | ||
#for $month in $year.months | ||
#if $month.wind.has_data | ||
$month.dateTime.format($YM) $month.wind.avg.format($Wind,$NONE,add_label=False) $month.wind.max.format($Wind,$NONE,add_label=False) $month.wind.maxtime.format($D,$NODAY) $month.wind.vecdir.format($Dir,$NONE,add_label=False) | ||
#else | ||
$month.dateTime.format($YM) | ||
#end if | ||
#end for | ||
#if $year.wind.has_data | ||
----------------------------------- | ||
$year.wind.avg.format($Wind,$NONE,add_label=False) $year.wind.max.format($Wind,$NONE,add_label=False) $year.wind.maxtime.format($M,$NODAY) $year.wind.vecdir.format($Dir,$NONE,add_label=False) | ||
#end if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.