Technical Notes Contains technical notes that have been prepared by the HCA Staff. These usually focus on one particular point in great detail.

Reply
 
Thread Tools Display Modes
Old Sep 01, 2009, 12:22 PM   [Permalink]  #1
How to work with weather data
HCA Admin
Forum Administrator
Join Date: Sep 2009
Posts: 64

HCA Admin is offline Show Printable Version
Rating: (0 votes - average)

Summary

This technical note discusses some of the issues that you be aware of when using weather data. This is intended to supplement and not replace the information contained in the HCA User Guide Appendix 10 which can be found within the Documentation section of the site.

You must have already read Appendix 10 before you read this technical note or you will be confused!


Using weather data

Once HCA has obtained weather data, you can use that data in one of two ways. The first is the weather test visual programmer element. This is fully described in the HCA User Guide Weather appendix.

The other method is to use the Compute element with the _weather functions. As described in the HCA User Guide Expressions chapter the _weather function looks like this:
_weather (itemName)
What are valid item names? And what type of data does it produce: a number, date, time, or string? All these questions are answered in an Excel worksheet - named WeatherKeys.xls - that we prepared.

The start of this table looks like this:
KEYWORDTypeStation
VP
Station
WL2
Internet
METAR
File
WDisplay
File
VWS
File
WLink HTML
Put In
Database?
VP elmt
Trigger
insideTempNxx xxxxx
hiinsideTempN     x  
In the keyword column are the exact strings that you would use in the _weather function. For example:
_weather(insideTemp)
The other columns are:
  • Type
    This defines what sort of data is return? N is number, S is text string, DT is date time, D is date, T is Time.
  • Station VP
    If checked, this item is supported with a directly connected VantagePro station.
  • Station WL2
    If checked, this item is supported with a directly connected WeatherLink II station.
  • Internet METAR
    If checked, this item is supported when reading METAR reports from the internet.
  • File WDisplay
    If checked, this item is supported when reading data from the Weather Display program export.
  • File VWS
    If checked, this item is supported when reading data from the Virtual Weather Station program export.
  • File WLink HTML
    If checked, this item is supported when reading data from the WeatherLink program export.
  • Put In Database?
    If checked, the data for this item is recorded in the historical weather database. This means you can use this keyword with the _weatherHigh, _weatherLow, _weatherAvg, etc functions.
  • VP elmt Trigger (VP element / trigger)
    If checked, this item can be tested for with the VP weather test element and also can be used to create weather trigger for programs.
Lets take an example weather item and see what this table tells us. The weather item we will focus on for this is example is WindGust. Let's assume that you are using the Davis WeatherLink II station.

KEYWORDTypeStation
VP
Station
WL2
Internet
METAR
File
WDisplay
File
VWS
File
WLink HTML
Put In
Database?
VP elmt
Trigger
.....         
WindGustN  xxx   
.....         
As we said before, some data comes direct from the station and some data is computed by HCA. Where does WindGust come from?

To answer this, look in weatherKeys.xls. There is a row for each weather item. There are columns for each weather provider (columns C to H).

Find the row with the key you care about and look in the column for your provider. If there is an "x" in that cell you can get that data directly from your weather provider so you can use it in the _weather function.

WindGust is supported by the METAR, WDisplay, and VWS providers but not by the directly connected WeatherLink II. Since that is the unit you have, it can't be used in the _weather function in your design.

Next question: Can windGust be used in a _weatherHigh, _weatherLow, etc. function?

To answer that, look in the Wind Gust row and the "Put in database?" column (column I). If there is an "x" in that cell you can use that weather item in one of the historical weather functions. In this case the cell is blank so you can't use WindGust with _weatherHigh or _weatherLow.

If we repeat the same lookup with WindSpeed you can see that the Weather Monitor II
station supports it (x in that column) and it can be used in a weather historical functions (x in the Put in Database column)

KEYWORDTypeStation
VP
Station
WL2
Internet
METAR
File
WDisplay
File
VWS
File
WLink HTML
Put In
Database?
VP elmt
Trigger
.....         
WindSpeedNxxx xxxx
.....         

Metar weather data

As described in the Appendix 10, you can read weather data periodically from the internet. The one piece of information you will need to configure this is the four letter/number station identifier of the station you want to read data from. This is often called the ICAO Location Indicator and can found on the NOAA Station Information page. On this page there is an option to Display All Stations In a State. Select your state from the drop down list and on the resulting page find the station closest to you. Click on the link for that location and the resulting page will display the 4 letter/number ICAO Location Indicator.

Here are some tips for setting up METAR data retrieval.

When you go to the station map by the link given above and drill down to your state, make sure that you click through to the station you selected and see if the data displayed is reasonably current. Sometime station you selected is not operational.

Next in HCA open the weather provider setup dialog and on the provider tab make sure the provider is set to METAR and you enter your four letter station id correctly.

The next tab in the setup dialog is the METAR schedule table. Make sure that all the schedules times are in the right column. This will have the data retrieval happen each hour. Then go change the "Retrieve report from the internet via FTP xx minutes after the hour" to some time two or three minutes in the future. For example, if the current time is 10:15, change the xx time to 18.

Also - and very important - make sure the "create a log file" checkbox at the bottom of this tab is indeed checked.

Now close the dialog with OK.

At 10:18 (to follow this example) in your Logs folder you will see two files: METAR.TXT which is the log file and xxxx.txt, where xxxx is your 4 letter station id. The Logs folder is within your HCA folder in your documents area.

Once it is all over - give it a few minutes - go open the metar.txt file with Notepad. It will be a log of the actions taken.

Here is an example for a station in Tacoma Washington (KTIW):

Code:
8/26/2008 9:58:00 AM Starting read for station: KTIW
8/26/2008 9:58:00 AM Internet open
8/26/2008 9:58:00 AM Session Receive Timeout is 3600 seconds
8/26/2008 9:58:00 AM Session Connect Timeout is 300 seconds
8/26/2008 9:58:00 AM Internet connect to weather.noaa.gov
8/26/2008 9:58:03 AM Service Receive Timeout is 3600 seconds
8/26/2008 9:58:03 AM Service Connect Timeout is 300 seconds
8/26/2008 9:58:03 AM FTP set current directory to data/observations/metar/stations
8/26/2008 9:58:08 AM FTP get file
8/26/2008 9:58:15 AM 2008/08/26 15:53
8/26/2008 9:58:15 AM KTIW 261553Z 19005KT 10SM BKN025 OVC033 17/13 A3001 RMK AO2 SLP159 T01670133
8/26/2008 9:58:15 AM Internet disconnect
8/26/2008 9:58:15 AM Internet close
This retrieval was very fast. Sometimes the FTP action can take quite a while. The NOAA servers can be swamped at times.

Finally, as you examine the weather data in the log, you will see observation times in what is know as Universal Coordinated Time, also called Zulu time. Converting to local time is sometimes confusing. These web pages will help you do the conversions.
DAYLIGHT SAVINGS TIME ZONE CONVERSIONS
STANDARD TIME ZONE CONVERSIONS
If you are having problems with internet retrieval, make sure that it is not something in your internet connection.

Third party weather programs

If you have a Davis Instruments weather station you can work with it in one of two ways:
  1. Have HCA talk directly to it using the serial port on station and read the weather data over that serial link.
  2. Have HCA read the output of another program. This other program talks to the weather station over a serial communications connection.
While method #1 sounds like the simplest, it has several limitations. The first is that while HCA is talking to the weather station, no other program can. There are a lots of things to do with weather data beyond what you use it for in your automation solution. HCA is not a weather program. So working in this way you may not get the most out of your weather station. The other problem is that, in the Davis case, there are some sensor data that HCA can't retrieve when directly connected. For example, the soil and leaf sensors, and the secondary temperature and humidity sensors.

If you use method #2, you will be able to use your weather station for, well, weather stuff. Also you will be able to retrieve all the sensor data from it.

What if you don't have a Davis Weather Station? In this case you can't use method #1, but you can use method #2. Let's say that in another way: If you have almost any weather station you can have HCA use weather data from it. What you must do is to have a program that talks to that kind of station, and to periodically produce an export file with the weather data.

There are three programs that HCA supports.

WeatherLink (http://www.davisnet.com/weather/products/software.asp)
This is the software that comes with the Davis Station. What WeatherLink can be configured to do, is to read a template HTML file periodically, substitute place holders with current data, and produce a resultant html file. HCA reads both the template and resultant file and extracts the weather data. Note: This feature is available in WeatherLink version 5.4 and that version works with all Davis stations not only the Vantage Pro.

This extraction of data from the resultant file is a difficult operation to perform. In some cases it is difficult to know where the data begins and ends. We recommend that you first check that HCA can read the data correctly. In the HCA installation program folder is a program called WTest.exe. That program asks for the path to your HTML template file and HTML resultant file and performs the extraction process. In this way you can test that HCA will be able to read the data correctly. If you have problems with this area, contact technical support for help.
Virtual weather station (http://www.ambientweather.com/Default.asp)
Weather Display (http://www.weather-display.com/)
These two programs produce a file that contains only the data. They also work well with lots of stations. We suggest that you look at both and use their trial versions to see which one works better for you. Instructions for how to configure them for periodic weather data export is in the HCA User Guide Appendix 10 which can be found within the Documentation section of the site.
Views: 9028
Reply With Quote
Reply

Bookmarks

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:14 AM.