When maxSolardRad has to be calculated with the Bras method one has to add 
to weewx.conf:

[StdWXCalculate]
    nfac = 2                    # for solar radiation Bras
    [[Algorithms]]
        maxSolarRad = Bras  # RS or Bras
        
Because parameter nfac is not read/initialized weewx crashes with error:

Mar 26 10:17:55 pi21 vpro[8455]: engine: Caught unrecoverable exception in 
engine:
Mar 26 10:17:55 pi21 vpro[8455]:     ****  'WXCalculate' object has no 
attribute 'nfac'
Mar 26 10:17:55 pi21 vpro[8455]:     ****  Traceback (most recent call 
last):
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/engine.py", line 880, in main
Mar 26 10:17:55 pi21 vpro[8455]:     ****      engine.run()
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/engine.py", line 159, in run
Mar 26 10:17:55 pi21 vpro[8455]:     ****     
 self.dispatchEvent(weewx.Event(weewx.STARTUP))
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/engine.py", line 223, in dispatchEvent
Mar 26 10:17:55 pi21 vpro[8455]:     ****      callback(event)
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/engine.py", line 508, in startup
Mar 26 10:17:55 pi21 vpro[8455]:     ****     
 self._catchup(self.engine.console.genStartupRecords)
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/engine.py", line 627, in _catchup
Mar 26 10:17:55 pi21 vpro[8455]:     ****      origin='hardware'))
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/engine.py", line 223, in dispatchEvent
Mar 26 10:17:55 pi21 vpro[8455]:     ****      callback(event)
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/wxservices.py", line 48, in new_archive_record
Mar 26 10:17:55 pi21 vpro[8455]:     ****     
 self.calc.do_calculations(event.record, 'archive')
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/wxservices.py", line 189, in do_calculations
Mar 26 10:17:55 pi21 vpro[8455]:     ****      getattr(self, 'calc_' + 
obs)(data_us, data_type)
Mar 26 10:17:55 pi21 vpro[8455]:     ****    File 
"/home/weewx/bin/weewx/wxservices.py", line 302, in calc_maxSolarRad
Mar 26 10:17:55 pi21 vpro[8455]:     ****      data['dateTime'], self.nfac)
Mar 26 10:17:55 pi21 vpro[8455]:     ****  AttributeError: 'WXCalculate' 
object has no attribute 'nfac'
Mar 26 10:17:55 pi21 vpro[8455]:     ****  Exiting.

Solution:
Added at line 129:
        # atmospheric turbidity (2=clear, 4-5=smoggy)
        self.nfac = float(svc_dict.get('nfac', 2))
        
Luc

-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to