Enter a ZIP code to get a forecast:
Setup Location

WRN Logo

Resource: decode_hour

Resource decode_hour
Command Line -dh=hour[:min][-pre+post]
Environment Variable wxpdecode
Default Value The same hour as original file

The decode programs need to know the hour to decode to eliminate data which is too far from the requested time.  By default, the decoder uses the specified time form either the filename or current resources.  Sometimes this is not the time requested for decoding.  A good example of this is upper air data.   In some cases, upper air data for a particular hour is located in 3 to 4 hourly files (11,12,13 and 14Z).  To decode this range, the following can be used "uacvt -cu=la -ho=-212 -nh=-3" but this will use 14Z as the decode hour and of course this will decode little.  The decode_hour resource solves this problem, disconnecting the decode hour from the other resources.   The correct way to decode this data is:

   uacvt -cu=la -ho=-212 -nh=-3 -dh=-12

The "-12" on the decode hour specifies to use the nearest 12 hourly file.  If the number is positive, it would only decode 12Z data and not 00Z data.

Also with upper air and synoptic data, there needs to be a way of including data from surrounding hours.  By default, if 12Z synoptic data is decoded, smcvt will only decode 12Z reports.  The problem is that some places like Australia report at off hours such as 11 and 23Z and thus these reports would not be included. 

Decode Time Ranges

The decode_hour resource allows the user to specify the time range in minutes where data is valid. This varies from decoder to decoder. For surface data, this will be -15 to +10 minutes. For upper air data, this will be -2 to +2 hours. With the pre and post parameters, the exact range before and after the decode time can be set.   Any data outside this range will be decoded but not saved to the output file.   The syntax for the decode hour and range is:


where hour and min can be replaced with "cu" for current data based on the filename or current resource (not based on clock time).  In addition, the hour can be replaced with "cu-hour".  The pre and post values are in minutes around the decode time.  For example, to change the METAR decode time to 20 minutes after the hour with a range of +/- 10 minutes:

   sacvt -cu=la -dh=cu:20-10+10

If the previous hours data needs to be converted but using 3 hourly files including the current and the previous two:

   sacvt -cu=la -dh=cu-1 -nh=-2

If the current time is 19Z, this would decode the 17, 18 and 19Z file to decode the 18Z data.

For further information about WXP, email technical-support@weather.unisys.com
Last updated by Dan Vietor on July 30, 1998