Importing from WeatherCat

55 views
Skip to first unread message

vhel...@gmail.com

unread,
Dec 28, 2020, 8:31:34 AM12/28/20
to weewx-user
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-



wct.conf

vhel...@gmail.com

unread,
Dec 28, 2020, 8:33:54 AM12/28/20
to weewx-user
Weewx is latest version 4.2.0 installed on ubuntu 20.04 via apt-get.

-Ville-

gjr80

unread,
Dec 29, 2020, 9:47:22 PM12/29/20
to weewx-user
Hi,

Thank you, there is indeed a flaw in the weathercat import code. I have fixed it and it should appear in WeeWX 4.3.0. In the meantime you can carry on with your importing by downloading and using the updated file as follows:

1. move aside your existing weathercatimport.py:

$ sudo mv /usr/share/weewx/weeimport/weathercatimport.py /usr/share/weewx/weeimport/weathercatimport_orig.py

2. download the updated weathercatimport.py:


3. retry your import

Please let me know if there are any further errors.

Gary

vhel...@gmail.com

unread,
Dec 30, 2020, 1:30:19 PM12/30/20
to weewx-user
Hello Gary,

I can confirm that this updated script works now! I can finally, finally import my data from 2013 to weewx. 
Thank you so much for making this script!

-Ville-
Reply all
Reply to author
Forward
0 new messages