• English
  • Nederlands

User Tools

Site Tools


en:wxsim

WXSIM and the template

Tom Ehrensberger has created a great program called WXSIM to create weather forecasts based on observation data from public sources and your own weather station.

This program (better set of programs) has to run on a Windows PC and the forecasts created has to be uploaded to your website to be used to generate textual and graphical forecasts.

A link to the demonstration page of the WXSIM processing scripts included in this template.

The demonstration page is for information only. The WXSIM scripts are already fully installed in this template

The WXSIM website: http://www.wxsim.com/

The WXSIM forum area: http://www.weather-watch.com/smf/index.php/board,36.0.html

ATTENTION: All forecast-scripts from the Leuven-Template process the forecast data in two steps.

  1. First the raw forecast-data is read, unit conversion is done, superfluous data discarded and everything is saved as an easy to use PHP-array in a cache-file in the weather28/cache/ folder.
  2. All subsequent request for output use this intermediate file from the cache up until a new raw data file is available. Only then the first step is executed.

If you change a setting and want to test if this change is reflected in the generated output on the screen, you have to discard the intermediate file in the cache. Because as long as the cached file is valid only small parts of the scripts are executed.

WXSIM Settings in wsUserSettings.php

There are multiple settings to either set which script must be run and what type of output has to be displayed.

:?: Will WXSIM be used to display a forecast on the startpage?

$SITE["fctOrg"]         = "wxsim";

:?: Do we want a WXSIM forecast page (in the menu)?

#---------------------------------------------------------
# Extra weather-programs used for this station
#---------------------------------------------------------
# 
# WXSIM weather-forecasting
$SITE["wxsimPage"]      = false;                # true = Yes, we use the WXSIM paid program to make our weather-forecasts  |  false = Do not display

There are now multiple settings to find the right scripts and the data these scripts has to process.

$SITE["wxsimData"]      = "../";
$SITE["wxsim_file"]     = "latest.csv";         # latest.csv = lates.csv file will be used  |  lastret.txt = lastret.txt file will be used
$SITE["wxsimIconsOwn"]  = false;                # false = Use template standard icons  |  true = Use YrNo icons

$SITE["wxsimData"] - Where are the WXSIM files on your webserver uploaded to

Normaly the files $SITE['wxsimData'] are already uploaded to '../' the root of your site. If you have them uploaded to another place, specify the correct place here.

$SITE["wxsim_file"] -Which data set to use

There are two data sets abailable for upload when running WXSIM.

  1. latest.csv is the file with the largest number of data fields and
  2. lastret.txt which is smaller

Normaly you use latest.csv but if there is a problem / program error in WXSIM you can switch to the other file.

$SITE["wxsimIconsOwn"] - Which icons to use

Here you can choose between the yrno isons or the default template icons.

WXSIM settings in the scripts folder

Most settings for wxsim are in the wxsim scripts folder in wsWxsimSettings.php. First a lot of settings are copied from the template wide settings as stored in the $SITE settings.

# Hours when wxsim runs on the PC  You find that in wxsim ==> menu start ==> autorun
$updateHour 		= array(2,4,6,8,10,12,14,16,18,20);  // Hours when wxsim runs
$updateMin 		= 15;			     // minutes after the hour whenwxsim uploads

Set the hours which WXSIM runs the same as on your PC.

Youn also have to check the units used in lastret.txt/plaintext.txt. The following part of the settings should be studied and adapted:

# uom           = unit of measurement = units for temp baro etc.
$uoms 		= array ('C', 'mm','km/h', 'hPa','cm','km');    // for non US users
#$uoms         = array('F','in','mph','hPa','in','mi');       // for US uoms 
#
# IMPORTANT! Units used as by wxsim, array ('C', 'mm','km/h', 'hPa','cm','km');
# temperature, precipitation, wind, pressure, snowdepth, visibility
# you find the units used by your copy ofWXSIM at the near end of the lastret.txt file
# as in the following example
/*
Units:                                                                                              
temperature: Celsius, precipitation: mm, snow: cm, wind: m/s                                        
thickness: meters, solar energy: Watt x hr/m^2, visibility: km                                      
Convective basis: N.W. European                                                                     
*/
# normaly you should set the units in WXSIM equal to the units in the rest of your scripts
#   

Example above is often valid for NON-imperial countries. This following one is from a US user:

Units:                                                                                               
temperature: Fahrenheit, precipitation: inches, snow: inches, wind: mi/hr                            
thickness: meters, solar energy: Watt x hr/m^2, visibility: miles                                    
Convective basis: North American                                                                     

The settings lines for the units should become as in this example and REMOVE the comment mark:

$uoms         = array('F','in','mph','hPa' ,'in','mi');       // for US uoms  should be

There is no mention in the lastret.txt of the unit for pressure used.
It seems to be always in hPa=mb=in.Hg x 33.864
The scripts will recalculate to your desired uom, but set in the line here the setting for the INPUT file which is hPa.

Please set these settings correctly and carefully. Do not forget to delete the wswxsim* files in the cache. As only after a new upload or a removal of the cached file your changes become visible.

WXSIM Settings in the output generating scripts

In the scrips which generate the output there are settings for the width of the different area's, if tabs should be used, if the graphs should be separate or in a tab also.

Those settings are well documented and easy to change and test.

There are two sacripts which generate the information:

  1. wsWxsimPrintFull.php which generates the full page
  2. wsDashWxsim.php which generates the dashboard item

Both scripts are build the same and can be modified extensively.

en/wxsim.txt · Last modified: 2015/09/17 14:04 by wvdkuil