Hallo,

Where is my error

from weewx-wd >>> weewx-wd 
<https://bitbucket.org/ozgreg/weewx-wd/src/110688ada0c6?at=v1.2.0_development> 
/ bin 
<https://bitbucket.org/ozgreg/weewx-wd/src/110688ada0c6/bin/?at=v1.2.0_development>
 
/ user 
<https://bitbucket.org/ozgreg/weewx-wd/src/110688ada0c6/bin/user/?at=v1.2.0_development>
 
/ weewxwd_config



i use to update  "maxSolarRad", "cloudbase", "windRun" and so on

def clear_v2_data(config_dict, db_binding_wx):    """ Clear any legacy humidex 
and apparent temperature data from the         Weewx (not Weewx-WD) database.   
         Under Weewx v2.x Weewx-WD stored humidex and apparent temperature      
   data in the Weewx archive in fields extraTemp1 and extratemp2         
respectively. Under Weewx v3 Weewx-WD now stores this data in a         
separate database and hence this legacy data can be removed from         the 
Weewx database.        Parameters:            config_dict: a dictionary of the 
weewx.conf settings            db_binding_wx: binding for Weewx database        
            Returns:            Nothing.    """
    ...
    # we do so go ahead and clear them    for _rec in 
dbmanager_wx.genBatchRecords(start_ts - 1, stop_ts):             
dbmanager_wx.updateValue(_rec['dateTime'], 'extraTemp1', None)             
dbmanager_wx.updateValue(_rec['dateTime'], 'extraTemp2', None)             
nrecs += 1    # all done, say so and give some stats    print "Done. 
'extraTemp1' and 'extraTemp2' cleared in %d records (approx %d days)." %(nrecs, 
ndays)
    ...

i have the line "dbmanager_wx.updateValue(_rec['dateTime'], 'extraTemp1', None)"

replaced by "dbmanager_wx.updateValue(_rec['dateTime'], 'maxSolarRad', msr) "

my plan is:
"""

msr = weewx.wxformulas.solar_rad_Bras(53.605963, 11.341407, 53, 
_rec['dateTime'], 2)
dbmanager_wx.updateValue(_rec['dateTime'], 'maxSolarRad', msr) 

if _rec['outTemp'] <> 0 and _rec['outHumidity'] <> 0:
       cb1 = weewx.wxformulas.cloudbase_Metric(_rec['outTemp'], 
_rec['outHumidity'], 53)
else:
        cb1 = 0
dbmanager_wx.updateValue(_rec['dateTime'], 'cloudbase', cb1)

if _rec['windSpeed'] > 0:
         vt = (_rec['windSpeed'], "mile_per_hour", "group_speed")
         ws_kts = weewx.units.convert(vt, "knot")[0]
         be2 = ws_kts * 5.0 / 60.0
else:
         be2 = 0.0
dbmanager_wx.updateValue(_rec['dateTime'], 'windrun', be2)
"""

The data "msr, cb1 and be2" are calculated correctly.

The calculated data is not written to the database "Weewx database" to 
record "dateTime"

sorry my english is not so good

Hartmut


Reply via email to