Hi,
Trying to import from weathercat monthly .cat files.
I get this error:
ville@weewx:~/Location1/2017$ sudo wee_import
--config=/etc/weewx/weewx.conf --import-config=/etc/weewx/import/wct.conf
--verbose
Using WeeWX configuration file /etc/weewx/weewx.conf
Starting wee_import...
WeatherCat monthly .cat files in the '/home/ville/Location1' directory will
be imported
The following options will be used:
config=/etc/weewx/weewx.conf, import-config=/etc/weewx/import/wct.conf
from=None, to=None
dry-run=None, calc-missing=True
tranche=250, interval=derive
UV=True, radiation=True
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Destination table 'archive' unit system is '0x01' (US).
Missing derived observations will be calculated.
Starting import ...
Records covering multiple periods have been identified for import.
Period 1 ...
Obtaining raw import data for period 1 ...
Raw import data read successfully for period 1.
Mapping raw import data for period 1 ...
Traceback (most recent call last):
File "/usr/share/weewx/wee_import", line 900, in <module>
main()
File "/usr/share/weewx/wee_import", line 830, in main
source_obj.run()
File "/usr/share/weewx/weeimport/weeimport.py", line 401, in run
_mapped_data = self.mapRawData(_raw_data, self.archive_unit_sys)
File "/usr/share/weewx/weeimport/weeimport.py", line 698, in mapRawData
for _row in data:
File "/usr/share/weewx/weeimport/weathercatimport.py", line 332, in
getRawData
_line = _clean_line.strip()
UnboundLocalError: local variable '_clean_line' referenced before assignment
Checking syslog says:
ville@weewx:~/Location1/2017$ tail -f /var/log/syslog
Dec 28 15:26:09 weewx wee_import[52575] DEBUG weeimport.weathercatimport:
config=/etc/weewx/weewx.conf, import-config=/etc/weewx/import/wct.conf
Dec 28 15:26:09 weewx wee_import[52575] DEBUG weeimport.weathercatimport:
from=None, to=None
Dec 28 15:26:09 weewx wee_import[52575] DEBUG weeimport.weathercatimport:
dry-run=None, calc-missing=True
Dec 28 15:26:09 weewx wee_import[52575] DEBUG weeimport.weathercatimport:
tranche=250, interval=derive
Dec 28 15:26:09 weewx wee_import[52575] DEBUG weeimport.weathercatimport:
UV=True, radiation=True
Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weathercatimport:
Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weathercatimport:
Destination table 'archive' unit system is '0x01' (US).
Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weeimport: Obtaining
raw import data for period 1 ...
Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weeimport: Raw
import data read successfully for period 1.
Dec 28 15:26:09 weewx wee_import[52575] INFO weeimport.weeimport: Mapping
raw import data for period 1 ...
I really don't know what to try next?
Can somebody advice?
-Ville-
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/63ee0609-6414-4aff-be6b-2e1c26d729f3n%40googlegroups.com.
# EXAMPLE CONFIGURATION FILE FOR IMPORTING FROM WEATHERCAT
#
# Copyright (c) 2009-2020 Tom Keffer <[email protected]> and Gary Roderick.
# See the file LICENSE.txt for your rights.
##############################################################################
# Specify our source. Available options are:
# CSV - import obs from a single CSV format file
# WU - import obs from a Weather Underground PWS history
# Cumulus - import obs from a one or more Cumulus monthly log files
# WeatherCat - import obs from a one or more WeatherCat monthly .cat files
# Format is:
# source = (CSV | WU | Cumulus | WeatherCat)
source = WeatherCat
##############################################################################
[WeatherCat]
# Parameters used when importing WeatherCat monthly .cat files
#
# Directory containing WeatherCat year folders that contain the monthly
# .cat files to be imported. Format is:
# directory = full path without trailing /
directory = /home/ville/Location1
# When importing WeatherCat monthly .cat file data the following WeeWX
# database fields will be populated directly by the imported data:
# barometer
# dateTime
# dewpoint
# inHumidity
# inTemp
# outHumidity
# outTemp
# radiation (if WeatherCat data available)
# rain
# rainRate
# UV (if WeatherCat data available)
# windDir
# windGust
# windSpeed
# windchill
# extraTemp1 (if WeatherCat data available)
# extraTemp2 (if WeatherCat data available)
# extraTemp3 (if WeatherCat data available)
# extraHumid1 (if WeatherCat data available)
# extraHumid2 (if WeatherCat data available)
# SoilTemp1 (if WeatherCat data available)
# SoilTemp2 (if WeatherCat data available)
# SoilTemp3 (if WeatherCat data available)
# SoilTemp4 (if WeatherCat data available)
# SoilMoist1 (if WeatherCat data available)
# SoilMoist2 (if WeatherCat data available)
# LeafTemp1 (if WeatherCat data available)
# LeafTemp1 (if WeatherCat data available)
# LeafWet1 (if WeatherCat data available)
# LeafWet2 (if WeatherCat data available)
#
# The following WeeWX database fields will be populated from other
# settings/config files:
# interval
# usUnits
#
# The following WeeWX database fields will be populated with values derived
# from the imported data provided the --calc-missing command line option is
# used during import:
# altimeter
# ET
# heatindex
# pressure
# windrun
#
# The following WeeWX fields will be populated with derived values from the
# imported data provided the --calc-missing command line option is used
# during import. These fields will only be saved to the WeeWX database if
# the WeeWX schema has been modified to accept them. Note that the pyephem
# module is required in order to calculate maxSolarRad - refer WeeWX Users
# Guide.
# appTemp
# cloudbase
# humidex
# maxSolarRad
# How will the interval field be determined for the imported records.
# Available options are:
# derive - Derive the interval field from the timestamp of successive
# records. This setting is best used when the imported records
# are equally spaced in time and there are no missing records.
# conf - Use the interval setting from weewx.conf. This setting is
# best used if the records to be imported have been produced by
# WeeWX using the same archive interval as set in weewx.conf on
# this machine.
# x - Use a fixed interval of x minutes for every record. This
# setting is best used if the records to be imported are
# equally based in time but there are some missing records.
# This setting is recommended for WU imports.
# To import WeatherCat records it is recommended that the interval setting
# be set to the Sampling Rate setting used by WeatherCat as set on the
# Misc2 tab under WeatherCat Preferences unless the Adapative Sampling Rate
# was used in which case interval = derive should be used.
# Format is:
# interval = (derive | conf | x)
interval = derive
# Should the [StdQC] max/min limits in weewx.conf be applied to the
# imported data. This may be useful if the source has extreme values that
# are clearly incorrect for some observations. Available options are:
# True - weewx.conf [StdQC] max/min limits are applied.
# False - weewx.conf [StdQC] max/min limits are not applied.
# Format is:
# qc = (True | False)
qc = True
# Should any missing derived observations be calculated from the imported
# data if possible. Available options are:
# True - Any missing derived observations are calculated.
# False - Any missing derived observations are not calculated.
# Format is:
# calc_missing = (True | False)
calc_missing = True
# Specify the character used as the decimal point. WeatherCat monthly .cat
# files may not always use a fullstop character as the decimal point. The
# character must be enclosed in quotes. Format is:
# decimal = '.'
decimal = '.'
# Imported records are written to archive in transactions of tranche
# records at a time. Increase for faster throughput, decrease to reduce
# memory requirements. Format is:
# tranche = x
# where x is an integer
tranche = 250
# For correct import of the WeatherCat monthly .cat files wee_import needs
# to know what units are used in the imported data. The units used by
# WeatherCat are set via the 'Units/Misc1` tab under the WeatherCat
# 'Preferences' menu. The WeatherCat unit preferences should be mirrored
# below under the [[Units]] stanza and each assigned a WeeWX unit value. As
# WeatherCat allows dewpoint to have different units to other temperatures
# settings for both temperature and dewpoint should be specified; however,
# if only temperature is specified then the temperature units will be
# applied to all temperatures and dewpoint.
#
# An example [[Units]] stanza might be:
# [[Units]]
# temperature = degree_F # options are 'degree_F' or 'degree_C'
# dewpoint = degree_C # options are 'degree_F' or 'degree_C'
# pressure = hPa # options are 'inHg', 'mbar' or 'hPa'
# windspeed = km_per_hour # options are 'mile_per_hour',
# # 'km_per_hour', 'knot' or
# # 'meter_per_second'
# precipitation = mm # options are 'inch' or 'mm'
[[Units]]
temperature = degree_C
dewpoint = degree_C
pressure = hPa
windspeed = meter_per_second
precipitation = mm