One additional hint: I've checked if there is forecast info available at 
the right border of my timeline. Sadly, it is - the forcast roughly covers 
10 days into the future w.r.t. current date. And most other week diagrams 
are rendered correctly when weekwindvec is failing.



Michael Waldor schrieb am Donnerstag, 16. November 2023 um 07:49:38 UTC+1:

> During this night I did save the weewx HTML output from 3 o'clock. And now 
> I know what images are not updated - the weekwindvec diagram (and all week 
> diagrams being rendered "afterwards").
>
> The time axis of all diagrams are fine, i.e. my tweak of utilities.py 
> seems NOT to be the cause of my problem.
>
> Since the rendering of even the weekwindvec diagram  works fine if the 
> current time is later then 5:15 I guess that there might be a hidden bug 
> within imagegenerator.py itself. I have no idea howto debug that. I only 
> know that imagegenerator fails for weekwindvec if the current time is 
> between 0:00 and 5:15 - exactly during that time the forecast DB contains 
> data from the previous day. But that doesn't disturb creation of daywindvec 
> being fine at 3:00.
>
> As a starter I give here the most relevant parts of the involved 
> configuration files.
> First weewx.conf:
>     [[dwd_binding]]
>         database = dwd_sqlite
>         table_name = forecast
>         manager = weewx.manager.Manager
>         schema = schemas.dwd.schema
>
> Next my skin.conf:
>         [[[weekwindvec]]]
>             [[[[windvec]]]]
>                 plot_type = vector
>             [[[[forecast_windvec]]]]
>                 data_type = windvec
>                 data_binding = dwd_binding
>                 plot_type = vector
> label = ' '
> color = blue
>
> BTW, within the original Seasons skin for week/month/year [[[wind]]] is 
> used and should be replaced by [[[windDir]]]
>
> And below you see the not updated diagram itself - it has timestamp 23:00, 
> but should be 3:00. Here you also see my intention of merging data from two 
> DBs - the "real" life data are in Seasons blue, and the forecast data are 
> in dark blue. Keep in mind current date is 11-14, and you see data till 
> 11-18 from forecast. There is a small overlap (not visible here) since the 
> forecast data contains "old outdated" data of some hours - but I like that 
> to compare outdated forecast with real data.
> [image: weekwindvec.png]
> Tom Keffer schrieb am Mittwoch, 15. November 2023 um 16:24:52 UTC+1:
>
>> Hard to say. Plots are regenerated only as often as their aggregation 
>> interval. Perhaps it is the "year" windvec plot that is failing: it would 
>> be regenerated only once a day.
>>
>> Just guessing. You have a complicated configuration and we haven't seen 
>> your configuration files.
>>
>> On Wed, Nov 15, 2023 at 7:10 AM 'Michael Waldor' via weewx-user <
>> weewx...@googlegroups.com> wrote:
>>
>>> Thanks for your quick reply. But why does my setup work fine after 5:15 
>>> all over the day? From my perspective a wrong configuration should fail 
>>> always. 
>>>
>>> Tom Keffer schrieb am Mittwoch, 15. November 2023 um 14:12:31 UTC+1:
>>>
>>>> Imagegenerator is trying to calculate a wind vector. This typically 
>>>> happens for a plot with a spec that looks something like this:
>>>>
>>>>
>>>>
>>>> *[[[weekwindvec]]]    [[[[windvec]]]]        plot_type = vector*
>>>>
>>>> Normally, it uses the "wx_binding" database binding to do this, which 
>>>> is normally pointed at the "archive" table. For whatever reason, your 
>>>> installation is attempting to do this with the "forecast" table. It could 
>>>> be that you are using the wrong binding, or it could be that the 
>>>> wx_binding 
>>>> is pointing to the "forecast" table.
>>>>
>>>>
>>>>
>>>> On Wed, Nov 15, 2023 at 1:12 AM 'Michael Waldor' via weewx-user <
>>>> weewx...@googlegroups.com> wrote:
>>>>
>>>>> I seem to have a very specific problem due to my complex changes 
>>>>> within weewx. First I'll shortly describe my problem, then I'll explain 
>>>>> my 
>>>>> weewx environment:
>>>>>
>>>>> My problem: weewx 4.10.2 is working fine during daytimes, but 
>>>>> imagegenerator fails daily between 0:00 and 5:15 all 5min with the same 
>>>>> set 
>>>>> of error messages, e.g.
>>>>>
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine: Caught unrecoverable exception in generator 
>>>>> 'weewx.imagegenerator.ImageGenerator'
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  no such table: forecast_day_wind
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  Traceback (most recent call last):
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weedb/sqlite.py", line 39, in guarded_fn
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      return fn(*args, **kwargs)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weedb/sqlite.py", line 233, in execute
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      return sqlite3.Cursor.execute(self, 
>>>>> *args, **kwargs)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  sqlite3.OperationalError: no such 
>>>>> table: 
>>>>> forecast_day_wind
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  During handling of the above exception, 
>>>>> another exception occurred:
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  Traceback (most recent call last):
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/reportengine.py", line 197, in run
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      obj.start()
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/reportengine.py", line 385, in start
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      self.run()
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 44, in run
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      self.gen_images(self.gen_ts)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 109, in gen_images
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      plot = self.gen_plot(plotgen_ts,
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 248, in gen_plot
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      start_vec_t, stop_vec_t, data_vec_t 
>>>>> = 
>>>>> weewx.xtypes.get_series(
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/xtypes.py", line 100, in get_series
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      return xtype.get_series(obs_type, 
>>>>> timespan, db_manager, aggregate_type,
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/xtypes.py", line 920, in get_series
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      return 
>>>>> ArchiveTable.get_series(obs_type, timespan, db_manager, aggregate_type,
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/xtypes.py", line 167, in get_series
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      agg_vt = get_aggregate(obs_type, 
>>>>> stamp, do_aggregate, db_manager)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/xtypes.py", line 127, in get_aggregate
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      return 
>>>>> xtype.get_aggregate(obs_type, 
>>>>> timespan, aggregate_type, db_manager,
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/xtypes.py", line 1102, in get_aggregate
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      row = db_manager.getSql(sql, 
>>>>> timespan)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weewx/manager.py", line 579, in getSql
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      _cursor.execute(sql, sqlargs)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****    File 
>>>>> "/usr/share/weewx/weedb/sqlite.py", line 47, in guarded_fn
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****      raise weedb.NoTableError(e)
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  weedb.NoTableError: no such table: 
>>>>> forecast_day_wind
>>>>> Nov 13 00:00:33 imurr9 python3[579]: weewx[579] ERROR 
>>>>> weewx.reportengine:         ****  Generator terminated
>>>>>
>>>>> My weewx environment:
>>>>> I'm using the current weewx version 4.10.2 with a highly customized 
>>>>> Seasons skin on a raspberry pi 3 with current bullseye linux.
>>>>> I also use the German DWD forecast module to get local forecasts, 
>>>>> being stored within a separate sqlite DB (updated each hour by cron).
>>>>>
>>>>> I want to see the forecast data within the same diagrams as the 
>>>>> measured data, i.e. those diagrams contain data from 2 sqlite databases. 
>>>>> Sadly there seeme to be no standard mechanism to extend the x-axis (time) 
>>>>> into the "future". Thus I've tweaked the function scaletime within 
>>>>> utities.py to include an optional parameter offset. This offset is 
>>>>> forwarded from skin.conf to extend the x-axis by 10h (for daily reports) 
>>>>> resp. 5days (for weekly reports).
>>>>>
>>>>> This complicated setup works fine - except every neight between 0:00 
>>>>> and 5:15. I have noticed that exactly after 5:15 the forecast DB no 
>>>>> longer 
>>>>> contains data from the previous day, i.e. exactly after midnight the 
>>>>> current time and the first data within forecast DB are from different 
>>>>> dates.
>>>>>
>>>>> At first I've asked the same question within the German GIT project 
>>>>> https://github.com/roe-dl/weewx-DWD/issues/57, but that module does 
>>>>> not access a table named forecast_day_wind. (The DWD sqlite table is 
>>>>> named 
>>>>> forecast).
>>>>>
>>>>> Then I've tried to debug my code changes of scaletime by
>>>>>
>>>>> cd /usr/share/weewx/weeplot
>>>>> PYTHONPATH=/usr/share/weewx python3 -i utilities.py
>>>>>
>>>>> and calling scaletime step by step at some critical dates after 
>>>>> midnight. But my modifications to extend the time interval exactly work 
>>>>> as 
>>>>> intended (and I see completly correct images during daytime including all 
>>>>> lnes from both sqlite DBs).
>>>>>
>>>>> I've checked the created forecast DB - it's fine all over the day, 
>>>>> especially nightly.
>>>>>
>>>>> Of course I might post my changes if you ask for. But it would make my 
>>>>> current post even more unreadable:-) . Here only 2 code lines from 
>>>>> utilities.py (I do more)
>>>>>
>>>>> def scaletime(tmin_ts, tmax_ts, offset=0):
>>>>> ...
>>>>>     tmax_dt = datetime.datetime.fromtimestamp(tmax_ts + offset)
>>>>> ...
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> -- 
>>>>> 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+...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/2baf8c90-d283-4e06-9d33-1daa7a6f50can%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-user/2baf8c90-d283-4e06-9d33-1daa7a6f50can%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> 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+...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/b39ac44e-25cf-4983-8f12-860eb479473bn%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/weewx-user/b39ac44e-25cf-4983-8f12-860eb479473bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/4b76c619-57dc-41bc-a7ef-b7703a3ac6d6n%40googlegroups.com.

Reply via email to