How to use humidex, apparent temperature, evapotranspiration, cloud base and maximum solar radiation?

557 views
Skip to first unread message

Hugo Valentim

unread,
Feb 9, 2015, 7:24:13 AM2/9/15
to weewx...@googlegroups.com
It seems with release 3.1 WeeWX is now able to do a bunch of calculations previously done in separate components, which is great and much needed:


Right now I am trying to add the current cloudbase value to the standard HTML skin with no luck. My understanding of the way WeeWX works is a bit vague. I tried adding something like adding $current.cloudbase_Metric but it is not being recognized.

Can anyone please point me in the right direction? What am I missing? Adding something to [StdWXCalculate] perhaps?

Thanks!




Thomas Keffer

unread,
Feb 9, 2015, 9:17:47 AM2/9/15
to weewx-user
Hello, Hugo

Yes, the formulas for cloud base, etc., were added to the list of algorithms, but they are not included in the archive records, nor are they included in the database schemas.  

To change that would require some work on your part. First, you'd have to subclass the present class StdWXCalculate and add the necessary code to use the cloud base formula and put the results in the archive record.

Then you'd have to add the type to the schema of the database.

This would let you do what you want.

Thinking about this, StdWXCalculate should probably do the first part --- add the new variables to the archive record --- in the standard distribution. I've put in a ticket for this.

For the second part --- adding them to the archive --- that is not possible without breaking compatibility with wview.

-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.

Hugo Valentim

unread,
Feb 28, 2015, 4:54:40 AM2/28/15
to weewx...@googlegroups.com
Thanks a lot for the explanation. It seems a bit more than I can chew :)

The first part would probably be enough.

Stephen Coates

unread,
Apr 16, 2015, 8:30:00 PM4/16/15
to weewx...@googlegroups.com
Hi Tom,
I am trying to use Apparent Temperature,
Like Hugo, I have no idea how this can be done so it presents within the standard skin.
I have tried to use "current.aptemp" as a guess which failed.
Sadly I think it means I don't understand how to use this calc within weewk.
any assistance would be fantastic

herve FRELAT

unread,
Oct 28, 2016, 4:32:04 PM10/28/16
to weewx-user
Hello Tom
I'm trying to use apparent temp on my site http://meteoguibeville.free.fr but I can't find algorithm for calculate it and link of sourceforge is inactive .
Can you help me ?
Thanks for help and sorry for my Englis (I'french)

H.frelat

gjr80

unread,
Oct 28, 2016, 7:16:35 PM10/28/16
to weewx-user
Hi,

You will find the formula use for Apparent Temperature here. If you understand python you will find the weewx implementation of this formula in the file wxformulas.py which, depending on your install, you will most likely find in the /home/weewx/bin/weewx or /usr/share/weewx directory. You can easily include the calculations in your template. weewx does calculate Apparent Temperature and inlcudes it in each archive record and loop packet but if you wish to use these values (ie without calculating them yourself) you will need to alter your setup to save appTemp to your weewx archive, in effect you would need to do most of the steps here (you can skip the first, weewx already does this). If you search the forums you may find further info, I seem to remember this has been asked (or something similar) before.

Gary

herve FRELAT

unread,
Oct 29, 2016, 3:58:47 AM10/29/16
to weewx-user
Thanks for information
I have found wx formulas py.
But I don't understand how to use apptemp on my site.
I don't want archieve it,just show current apptemp on my index.
Sorry for questions but .Im a newbie

H.frelat

gjr80

unread,
Oct 29, 2016, 10:31:41 AM10/29/16
to weewx-user
Hi,


Sorry for questions but .Im a newbie
 
Don't worry, we all started like that, somewhere.

As you just want to display Apparent Temperature on a weewx generated page that means we have a few options. You could write a Search List Extension that calculates Apparent Temperature and would ultimately let you just use something like $appTemp in you template to display Apparent Temperature with all the unit conversion and formatting capabilities that weewx provides. Secondly, you could embed some python in your template to do the calculations through a few calls to the weewx 'API'. This means we can still make use of the weewx unit conversion and formatting capabilities. The third approach is to calculate out the Apparent Temperature formula in some python code in the template but you would then need to manually format your results. I will cover the second approach as it is probably the simplest in to implement and still provides us with unit conversion/formatting.

You could place the following code in your template somewhere before you want to use the Apparent temperature tag:

#import math
#from weewx.wxformulas import apptempC

#from weewx.units import ValueHelper
#if $varExists('current.outTemp') and $current.outTemp.raw is not None and $varExists('current.outHumidity') and $current.outHumidity.raw is not None and $varExists('current.windSpeed') and $current.windSpeed.raw is not None
   
#set $Ta = $current.outTemp.degree_C.raw
   
#set $rh = $current.outHumidity.raw
   
#set $ws = $current.windSpeed.meter_per_second.raw
   
#set $appTemp_C = apptempC($Ta, $rh, $ws)
    #set $appTemp = ValueHelper(($appTemp_C, "degree_C", "group_temperature"))
#else
   
#set $appTemp = ValueHelper((None, "degree_C", "group_temperature"))
#end if   

you could then use $appTemp to display Apparent Temperature with a units label converted to the units you specified in your skin.conf. $appTemp.degree_F would always display in F, $appTemp.formatted would display the value without a label. You essentially have the freedom to use all of the weewx unit conversion and formatting capabilities.

Gary




herve FRELAT

unread,
Oct 30, 2016, 3:07:07 PM10/30/16
to weewx-user
Thank you very very much
All seems ok now.

H.frelat

Reply all
Reply to author
Forward
0 new messages