mrgmarsh / wfrog

Automatically exported from code.google.com/p/wfrog
GNU General Public License v3.0
0 stars 0 forks source link

Gust errors in log file #106

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. wfrog running normal 
2. wh1080.py driver
3. seems to only happen with wind very low under 1 mph like .4 or .8

What is the expected output? What do you see instead?

expected: no error in log file
I see errors in log file (see additional info)

What version of the product are you using? On what operating system?

version 0.8.1 or 0.8.2
os linux

Please provide any additional information below.

2012-02-23 01:54:20,195 ERROR [wflogger] Could not send event to 
<wfcommon.generic.YamlMultiElement object at 0x9b2dd0c>
Traceback (most recent call last):
  File "/var/wfrog-0.8.2/wflogger/wflogger.py", line 127, in output_loop
    self.collector.send_event(event, context=context)
  File "/var/wfrog-0.8.2/wfcommon/generic/multi.py", line 62, in _call
    result[name] = r.__getattribute__(attr).__call__(*args, **keywords)
  File "/var/wfrog-0.8.2/wflogger/collector/flush.py", line 77, in send_event
    self.collector.send_event(event, context)
  File "/var/wfrog-0.8.2/wfcommon/generic/user.py", line 65, in _call
    return self.target.__getattribute__(attr).__call__(*args, **keywords)
  File "/var/wfrog-0.8.2/wflogger/collector/base.py", line 52, in send_event
    self._report_wind(event.mean.speed, event.mean.dir, event.gust.speed, event.gust.dir)
AttributeError: 'Event' object has no attribute 'gust'
2012-02-23 01:55:56,610 INFO [collector.aggregator] New period

Original issue reported on code.google.com by eclut...@frontier.com on 23 Feb 2012 at 2:30

GoogleCodeExporter commented 9 years ago
Hi,

the following path fixes the problem.

in wh1080.py near line 93 change this:
                        e.create_child('gust')
                        e.gust.speed = 0.0;
                        e.gust.dir = 0.0;
                        if data['wind_gust']:
                            #e.create_child('gust')
                            e.gust.speed = data['wind_gust']
                            e.gust.dir = 22.5*(data['wind_dir'])
                        send_event(e)

regards

Original comment by Arabella...@gmail.com on 9 Jun 2013 at 12:17