Cloudbase calculation help

579 views
Skip to first unread message

Giacomo Querio

unread,
Apr 11, 2016, 5:23:30 AM4/11/16
to weewx-user
Hello,
could somebody provide some basic tip on how to modify the weewx.conf, Skin.conf, index.html.tmpl to add the cloudbase + humidex calculations + its graphs to the Standard template?
I'm using a VP2 station with Weewx 3.5.0
Thanks a lot, regards,
Jack.

pterodaktil

unread,
Apr 11, 2016, 6:28:51 AM4/11/16
to weewx-user
I add it directly to trmplate. But i use old weewx version (2.7)

#set $delta_temp = $current.outTemp.raw-$current.dewpoint.raw

#set $cloud_base = int($delta_temp * 122)
#set $cloud_temp = int($delta_temp * -0.227 + $current.dewpoint.raw)
             
<tr>
               
<td class="stats_label">Нижняя граница облаков (оценка)</td>
               
<td class="stats_data">$cloud_base м</td>
             
</tr>

In new versions  you can  define variables  and plot them and so on. http://weewx.com/docs/customizing.htm#add_archive_type


http://weewx.com/docs/customizing.htm#add_archive_type

понедельник, 11 апреля 2016 г., 12:23:30 UTC+3 пользователь Giacomo Querio написал:

gjr80

unread,
Apr 11, 2016, 8:51:36 AM4/11/16
to weewx-user
Hi,

This is one way to calculate cloudbase but as of 3.2.0 weewx automatically calculates cloudbase, humidex and apparent temperature but they are not stored in the archive. In order to plot any observation you need to be saving it in the archive. This thread covers adding cloudbase to the archive, as pterodaktil says Add a new type to the archive database in the Customization Guide is where you need to look.

Gary

Giacomo Querio

unread,
Apr 11, 2016, 11:02:08 AM4/11/16
to weewx-user
Well, I thank you for the suggestions, I hoped that somebody already created a script to add these parameters because for me it's not so straightforward to deal with python at that level, I can just copy and paste hoping that it will work, tha't what I did:
I was going to follow the steps and create a cloudbase.py based on the example of the electricity one:
import weewx
from weewx.engine import StdService
        
class AddElectricity(StdService):

    def __init__(self, engine, config_dict):
      # Initialize my superclass first:
      super(AddElectricity, self).__init__(engine, config_dict)
      # Bind to any new archive record events:
      self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_packet)

    def new_archive_packet(self, event):

        (code that downloads the consumption data from the connection to the meter)

        event.record['electricity'] = retrieved_value

But I found that there is already a cloudbase.py in the /etc/weewx folder like that:

from weewx.wxengine import StdService
class CloudBase(StdService):
  def __init__(self, engine, config_dict):
    StdService.__init__(self, engine, config_dict)
    self.bind(weewx.NEW_LOOP_PACKET, self.new_loop_packet)
    self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
  def new_loop_packet(self, event):
    try:
      event.packet[.leafWet2.] = 250.0*(event.packet['outTemp'] - event.packet['dewpoint']) - 1372.0
    except KeyError:
      pass
  def new_archive_record(self, event):
    try:
      event.record[.leafWet2.] = 250.0*(event.record['outTemp'] - event.record['dewpoint']) - 1372.0
    except KeyError:
      pass

Now what do I do with that?
Thanks, regards,

Thomas Keffer

unread,
Apr 11, 2016, 11:06:33 AM4/11/16
to weewx-user
Ummm, why not just upgrade to V3.5? It has cloudbase built in. Then add it to your database schema.

-tk

--
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.
For more options, visit https://groups.google.com/d/optout.

Giacomo Querio

unread,
Apr 11, 2016, 11:32:18 AM4/11/16
to weewx...@googlegroups.com
It's already 3.5.0 version, but I'm a so basic user that I don't have enough knowledge to add the cloudbase calculations to it....
Regards,


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/kQZvc6UpLtA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
.. --.. .---- -.. ... .---
Giacomo Giuseppe Querio
Via Del Fort 3
10085 Pont Canavese TO
M: +393487656631
F: +390124418221
Skype: giacomo.querio

Andrew Milner

unread,
Apr 11, 2016, 12:13:11 PM4/11/16
to weewx-user
Did you click the link in Tom's message??  The user guide tells you what needs to be done - perhaps you should seek answers to specific questions relating to the method and steps described in the documentation - or maybe wait until your knowledge of weewx and the system is greater before attempting to customise it.  Just a friendly suggestion ....

vince

unread,
Apr 11, 2016, 12:37:04 PM4/11/16
to weewx-user
On Monday, April 11, 2016 at 9:13:11 AM UTC-7, Andrew Milner wrote:
Did you click the link in Tom's message??  The user guide tells you what needs to be done - perhaps you should seek answers to specific questions relating to the method and steps described in the documentation - or maybe wait until your knowledge of weewx and the system is greater before attempting to customise it.  Just a friendly suggestion ....

On Monday, 11 April 2016 18:32:18 UTC+3, Giacomo Querio wrote:
It's already 3.5.0 version, but I'm a so basic user that I don't have enough knowledge to add the cloudbase calculations to it....


Jack - the instructions are a bit scary I guess for a new user.

Can you provide more info please ?
  • what os you are running (debian, raspbian, ubuntu, etc.)
  • how you installed weewx onto it (prepackaged, or from .tgz using setup.py ?

vince

unread,
Apr 11, 2016, 1:56:05 PM4/11/16
to weewx-user
ok - I got this working in the simulator, you need to be able to do simple editing of files, and know how to stop/start weewx.

Following the Customization Guide at http://weewx.com/docs/customizing.htm#add_archive_type

1. add the type:  - create a file /home/weewx/bin/user/myschema.py containing just two lines:

      import schemas.wview
      schema_with_cloudbase = schemas.wview.schema + [('cloudbase', 'REAL')]

2. modify wx_binding - edit /home/weewx/weewx.conf to change one line
    from:
              schema = schemas.wview.schema
    to:
             schema = user.myschema.schema_with_cloudbase

3-6. follow the doc above - if you are sqlite3, nothing to do here
4. follow the doc above
5. follow the doc above
6. follow the doc above

Then you need to make plots happen.  Follow the 'Use the new type' section.

     In your skin.conf file you need to add a stanza to create a daily plot of cloudbase within the [[day_images]] section:

       [[[daycloudbase]]]
          [[[[cloudbase]]]]

Similarly, you could add weekly/monthly/yearly images to their sections in skin.conf if you wanted

Lastly you'd need to edit your skin .tmpl template file(s) to reference the image(s) you defined so the image shows up when weewx generates the web pages. I edited mine to add cloudbase stuff right under each of the UV references already in the file.

(under the first UV block)
 #if $day.cloudbase.has_data
<tr>
<td class="stats_label">Cloud Base</td>
<td class="stats_data">$current.cloudbase</td>
</tr>
#end if


(under the second UV block)
#if $day.cloudbase.has_data
<tr>
<td class="stats_label">
High Cloud Base<br/>
Low Cloud Base
</td>
<td class="stats_data">
$day.cloudbase.max at $day.cloudbase.maxtime<br/>
$day.cloudbase.min at $day.cloudbase.mintime
</td>
</tr>
#end if


(under the third UV block)
#if $day.cloudbase.has_data
<img src="daycloudbase.png" alt="Cloud Base" />
#end if

You can run the reports anytime by cd to /home/weewx and running ./bin/wee_reports if you don't want to wait 5 minutes.

(lastly, if you used the .deb packaged version above, the path would probably be /usr/share/weewx above rather than /home/weewx - see the 'where to find things' in http://www.weewx.com/docs/usersguide.htm#Where_to_find_things)




And of course start weewx.conf when you get done editing, and probably set debug=1 in weewx.conf just in case....




Giacomo Querio

unread,
Apr 12, 2016, 4:25:23 AM4/12/16
to weewx...@googlegroups.com
Alright Vince
thanks for the tips, you're right, I'm more afraid of screwing something and have to reinstall than else.
The hardware is an Alix 2D13 running a Debian with VOIP server for home numbers and a local instance of emoncms for home monitoring,
In December my WS2350 broke after 5 years of service so I upgraded to version 3.5.0 and a Davis VP2, cloudbase was present before and it disappeared,
for paraglider pilots in my zone it's a very useful parameter.
For sure the manual is more than exaustive but if it was for that the forum wouldn't be needed!
Will let you know if I succeed, thanks,
Jack,

Reply all
Reply to author
Forward
0 new messages