Probably a sqlite database query would be easiest. This can be done in
either Python or the shell. If you are doing some image manipulation in
order to overlay the values, Python is probably easiest. Best of all,
modern Python includes a sqlite driver
<https://docs.python.org/2.7/library/sqlite3.html>. Your code will look
something like this (NOT TESTED):
import sqlite3
# Open up a sqlite database connection
with sqlite3.connect('/home/weewx/archive/weewx.sdb') as conn:
# Do the query and fetch the results
lastTime, windSpeed, windDir = conn.execute('SELECT dateTime,
windSpeed, windDir '
'FROM archive ORDER BY
dateTime DESC LIMIT 1;').fetchone()
# Open the file with the binary image...
with open('imagefile', 'rb+') as fd:
# ... read it ...
image = fd.read()
# ... then manipulate it
new_image = fancy_function_to_overlay_wind(image, windSpeed,
windDir)
# Replace the old image with the new image
fd.seek(0)
fd.write(image)
fd.truncate()
On Fri, Feb 1, 2019 at 1:25 AM Andrew Elwell <[email protected]>
wrote:
> Hi Folks,
>
> I've just set up a basic webcam (r-pi camera module) and I'd like to
> overlay the wind speed and direction (ideally I'd like to simply
> overlay a wind barb, but suspect my imagemagick-fu isn't strong
> enough)
>
> I've got a couple of days worth of historic images just now (one frame
> every 5 mins with raspistill) and I'd like to pull out the weather
> info at the time of the exif image capture time.
>
> Is this possible (wee_reports or sqlite query?) for historic stuff,
> and whats the simplest way to get 'current conditions' as a machine
> readable file or API call at the time of future image generation?
>
> Many thanks
>
> Andrew
>
> --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>
--
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].
For more options, visit https://groups.google.com/d/optout.