Hello Tom.
Thanks for your answer. I've already tried that and it doesn't work. I get
this error:
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: Generate failed with
exception '<class 'weewx.ViolatedPrecondition'>'
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Ignoring
template /etc/weewx/skins/Belchertown/stats/stats-YYYY-MM.txt.tmpl
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Reason: Invalid
aggregation type 'raw'
I've attached a larger log with debug level = 1
On Thursday, April 11, 2019 at 5:47:44 PM UTC-3, Thomas Keffer wrote:
>
> You need $hour.outTemp.raw, not $hour.outTemp. The latter actually
> returns a "ValueHelper" object, which is ignorant of any comparison
> operators.
>
> Incidentally, every tag $hour.outTemp involves a database lookup. You
> could be looking at 100 for each day. A simple speed up is to an
> intermediate, temporary variable:
>
> #set $hourTemp=$hour.outTemp.raw
> #if hourTemp >= 30
> $set $VeryHotCount +=1
>
> etc.
>
>
> On Thu, Apr 11, 2019 at 12:43 PM HoracioDos <[email protected]
> <javascript:>> wrote:
>
>> Hello
>> I'm writing my own stats template like NOAA text files. I defined a four
>> values temperature range and I want to count all hours in a month according
>> to its range. Final objetive is to create a monthly heatmap.
>> As aggregation types min/max_le/ge work with a day period or longer. I
>> made a cycle for the hours in each day for a month and evaluated the
>> temperature for each hour according to a range. There is a counter for each
>> range value that I want to report.
>> I can't make it work and I can't see $hour.outTemp value. What am I doing
>> wrong? I've attached the template and its output.
>> Thanks in advance
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
You received this message because you are subscribed to the Google Groups
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: Generate failed with
exception '<class 'weewx.ViolatedPrecondition'>'
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Ignoring template
/etc/weewx/skins/Belchertown/stats/stats-YYYY-MM.txt.tmpl
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Reason: Invalid
aggregation type 'raw'
Apr 11 19:06:27 PiWeewx weewx[8408]: **** Traceback (most recent call last):
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/cheetahgenerator.py", line 332, in generate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** fd.write(str(compiled_template))
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Apr 11 19:06:27 PiWeewx weewx[8408]: **** rc = getattr(self,
mainMethName)()
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"cheetah__etc_weewx_skins_Belchertown_stats_stats_YYYY_MM_txt_tmpl_1555020387_39_31826.py",
line 476, in respond
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/tags.py", line 329, in __getattr__
Apr 11 19:06:27 PiWeewx weewx[8408]: **** return
self._do_query(aggregate_type)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/tags.py", line 343, in _do_query
Apr 11 19:06:27 PiWeewx weewx[8408]: **** val=val, **self.option_dict)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/wxmanager.py", line 60, in getAggregate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** return
weewx.manager.DaySummaryManager.getAggregate(self, timespan, obs_type,
aggregateType, **option_dict)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/manager.py", line 1268, in getAggregate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** **option_dict)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/manager.py", line 450, in getAggregate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** raise
weewx.ViolatedPrecondition("Invalid aggregation type '%s'" % aggregate_type)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** ViolatedPrecondition: Invalid
aggregation type 'raw'
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: Generate failed with
exception '<class 'weewx.ViolatedPrecondition'>'
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Ignoring template
/etc/weewx/skins/Belchertown/stats/stats-YYYY-MM.txt.tmpl
Apr 11 19:06:27 PiWeewx weewx[8408]: cheetahgenerator: **** Reason: Invalid
aggregation type 'raw'
Apr 11 19:06:27 PiWeewx weewx[8408]: **** Traceback (most recent call last):
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/cheetahgenerator.py", line 332, in generate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** fd.write(str(compiled_template))
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__
Apr 11 19:06:27 PiWeewx weewx[8408]: **** rc = getattr(self,
mainMethName)()
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"cheetah__etc_weewx_skins_Belchertown_stats_stats_YYYY_MM_txt_tmpl_1555020387_39_31826.py",
line 476, in respond
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/tags.py", line 329, in __getattr__
Apr 11 19:06:27 PiWeewx weewx[8408]: **** return
self._do_query(aggregate_type)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/tags.py", line 343, in _do_query
Apr 11 19:06:27 PiWeewx weewx[8408]: **** val=val, **self.option_dict)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/wxmanager.py", line 60, in getAggregate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** return
weewx.manager.DaySummaryManager.getAggregate(self, timespan, obs_type,
aggregateType, **option_dict)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/manager.py", line 1268, in getAggregate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** **option_dict)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** File
"/usr/share/weewx/weewx/manager.py", line 450, in getAggregate
Apr 11 19:06:27 PiWeewx weewx[8408]: **** raise
weewx.ViolatedPrecondition("Invalid aggregation type '%s'" % aggregate_type)
Apr 11 19:06:27 PiWeewx weewx[8408]: **** ViolatedPrecondition: Invalid
aggregation type 'raw'