![](media/image1.png){width="4.749305555555556in"
height="4.374305555555556in"}**THOR**

**Weather Scenario Server**

**User's Guide**

Version 1.3.2

June, 2003

Prepared by

![](media/image2.png){width="4.146527777777778in"
height="0.2604166666666667in"}

For

**Human Information Processing Research Branch**

NASA Ames Research Center

Moffet Field, CA

**Table of Contents**

1 Introduction [3](#introduction)

2 Operational Concept [3](#operational-concept)

3 System Requirements [5](#system-requirements)

4 Installation Notes [5](#installation-notes)

4.1 Installing Xerces C++ XML Parser
[5](#installing-xerces-c-xml-parser)

4.2 Installing Thor [5](#installing-thor)

5 Start Up Configuration File [6](#start-up-configuration-file)

6 Thor System Panel [7](#thor-system-panel)

6.1 Scenario Control [7](#scenario-control)

6.2 Shutdown [9](#shutdown)

7 Web Administration Console [9](#web-administration-console)

8 Scenario File [13](#scenario-file)

# 

# 1 Introduction

The Thor Weather Scenario Server (named after Thor, the Norse god of
thunder) is a data server designed to provide weather data to flight
decks--with and without out-the-window- visual scenes, ground ATC, and
other application requiring access to time-varying, real-world weather.
Thor is one component of a complete weather data delivery architecture,
as shown in Figure 1-1. The data that Thor provides comes from *weather
scenarios* that are generated in a separate application. This document
describes the configuration and use of Thor only. A separate document,
the Thor Message Catalogue, describes the format of the messages that
Thor sends and receives. The Wx Scenario Generator and the byte-level
format of the scenario files are also described in separate documents.

![](media/image3.png){width="5.998611111111111in"
height="2.842361111111111in"}*Figure 1-1 -- Weather Delivery
Architecture*

# 2 Operational Concept

This section describes a concept of operation for the Thor server. Thor
is a single process that extracts weather data from a scenario file and
sends it in messages to clients (ADRS, CDTI) via a socket interface.
Thor uses a configuration file for startup parameters (such as the
scenario file name, its port number, etc.). It logs informational, debug
and error messages to a log file. Figure 1-2 illustrates the context in
which Thor operates.

When Thor starts up, it is in a neutral state. It will read a
configuration file that tells it (among other things) which scenario to
load, load the scenario, and then wait to be commanded to start the
scenario. In the neutral state, the server can accept a *subscription*
message from any client wishing to be notified of weather product
updates. A subscription message indicates to Thor that the client wants
to subscribe to weather updates; the message includes a bitmap
indicating the list of products for which the client wants to be
notified when there is an update.

![](media/image4.png){width="4.100694444444445in"
height="2.561111111111111in"}

*Figure 1-2 -- Thor Context Diagram*

The server will remain in a neutral state until it is transitioned to
the "Started" state. This transition is affected by receipt of a "Start
Scenario" message from the ADRS or a client. For stand-alone test
purposes, a pop-up menu at the server application dialog allows manual
transition to the Started state.

Once in the Started state, the Thor server will use an internal timer
and the update rates in the weather scenario file to determine when a
weather product should be updated. When a product needs to be updated,
the Thor server will send a Notification message to any clients that
have subscribed to update notifications for that product.

Upon receipt of an Update Notification message, a client may send the
Thor server a Data Request message to obtain the updated product. The
server will send the product data back over the socket connection upon
which the Data Request message was received. Alternatively, the client
may read the updated data directly from a local copy of the scenario
file; in this case, the Thor server is used solely as a sequencer.

The Thor server will continue to operate in this manner until it
receives a "Stop Scenario" message. Upon receipt of this message, the
server will halt its internal timer, reset the weather scenario back to
its beginning and return to a neutral state. All subscribers remain
intact, and the scenario can be started again with a "Start Scenario"
message.

Figure 1-3 illustrates the case where client gets an update message from
Thor and subsequently requests the weather data directly from the
server.

![](media/image5.wmf){width="5.935416666666667in"
height="2.1694444444444443in"}

*Figure1-3 -- Example Transaction*

# 3 System Requirements

The server runs as a Win32 application. It requires the following
resources:

-   *Installed MFC Library* -- Thor is dynamically linked and requires
    that the MFC library be installed on the host on which it runs.
    Alternatively, the MFC DLLs may be copied to the host machine (see
    installation notes).

-   *Xerces XML Parser* -- Thor uses the Xerces 1.7 XML parser for C++,
    and requires that the library be installed on the host on which it
    runs, and that the Xerces bin directory be added to the PATH
    environment variable.

-   *20 Mbytes of Disk Space* (Recommended) -- this is in addition to
    the space needed for the MFC and Xerces libraries. The server itself
    needs about 600K, however space must be provided for the scenario
    files, which can have vary in size and number (depending upon the
    number of Wx products in the scenario), and the log file (which can
    grow large, depending upon how long the server is run without
    shutdown and restart).

Thor has been tested on Windows 2000 and Windows XP.

# 4 Installation Notes

## 4.1 Installing Xerces C++ XML Parser

> Required: Disk with Xerces 1.7.0 Win32 C++ XML parser.

1.  Copy folder "xerces-c1_7_0-win32 to the c: drive on the target
    machine.

2.  From the Start button, open Settings-\>Control Panel-\>System.
    Select the "Advanced" tab and click the "Environment Variables"
    button. Under System Variables, locate and select "Path" and click
    edit. Add **c:\\xerces-c1_7_0-win32\\bin** to the path (entries
    should be separated by a semicolon. Click the "OK" buttons until all
    the dialog windows are closed.

## 4.2 Installing Thor

> Required:

-   Thor software.

-   MSVCRTD.DLL, MFC42D.DLL, MFCN42D.DLL, MSVCP60D.DLL.

-   Any Wx scenario data files.

1.  Copy the file Thor.exe to a folder on the drive (.e.g. c:\\thor).

2.  Copy the "thorConfig.xml" file to the same folder.

3.  Copy the DLLs into the same folder, or if another application may
    use them, into the Windows\\System32 folder (note: if Visual C++ is
    installed in the machine these DLLs will already be installed.

4.  Copy any Wx scenario files to the machine.

5.  Edit thorConfig to set the LOG_FILE path to where the log file
    should go.

6.  Edit or add the SCENARIO_FILE entries to point to the place to where
    the Wx scenario files were copied.

Thor may now be started by double-clicking on the Thor icon.

# 5 Start Up Configuration File

When the Thor server starts up, it reads start-up parameters from a file
named *thorConfig.xml* that must reside in the directory from which the
Thor executable is started. The fields included in the file are listed
in Table 5-1. An example configuration file is shown in Figure 5-1. The
only tag for which there can be multiple entries is SCENARIO_FILE. Any
other duplicate tags will overwrite the previous entry for that tag.
When the server first starts, it will load the scenario file in the
first entry as the default scenario.

*Table 5-1* -- Thor Configuration File Parameters

+-----------+----------------+-------+--------------------------------+
| > **Field | > **XML Tag**  | > **  | > **Field Description**        |
| > Name**  |                | Requi |                                |
|           |                | red** |                                |
+-----------+----------------+-------+--------------------------------+
| > Root    | > THOR_CONFIG  | > Y   | > The XML root for the         |
|           |                |       | > configuration data. All      |
|           |                |       | > other tags must be enclosed  |
|           |                |       | > within this root tag.        |
+-----------+----------------+-------+--------------------------------+
| >         | >              | > Y   | > The full path to a scenario  |
|  Scenario |  SCENARIO_FILE |       | > descriptor file. Multiple    |
| > File    |                |       | > scenarios can be provided.   |
|           |                |       | > They will appear in the      |
|           |                |       | > Admin console in the order   |
|           |                |       | > they are listed in the file. |
|           |                |       | > The first listed scenario is |
|           |                |       | > loaded at startup.           |
+-----------+----------------+-------+--------------------------------+
| > Start   | >              | > N   | > The time-step within the     |
| > Time    | START_TIMESTEP |       | > scenario file at which the   |
| > Step    |                |       | > Thor server will start       |
|           |                |       | > serving weather data.        |
|           |                |       | > Default is time zero.        |
+-----------+----------------+-------+--------------------------------+
| > Log     | > LOG_FILE     | > N   | > The full path name to a file |
| > File    |                |       | > to be written as the server  |
|           |                |       | > log. Default: "Thor.log".    |
+-----------+----------------+-------+--------------------------------+
| > Use Log | >              | > N   | > A TRUE/FALSE flag that       |
| > Server  | USE_LOG_SERVER |       | > indicates whether to write   |
|           |                |       | > to a local log file or to    |
|           |                |       | > send the log data to a       |
|           |                |       | > remote server. The           |
|           |                |       | > implementation of this       |
|           |                |       | > feature is TBD. Default is   |
|           |                |       | > False.                       |
+-----------+----------------+-------+--------------------------------+
| > Log     | >              | > N   | > Not used.                    |
| > Server  |  LOG_SERVER_IP |       |                                |
| > IP      |                |       |                                |
+-----------+----------------+-------+--------------------------------+
| > Log     | > L            | > N   | > Not used.                    |
| > Server  | OG_SERVER_PORT |       |                                |
| > Port    |                |       |                                |
+-----------+----------------+-------+--------------------------------+
| > Listen  | > LISTEN_PORT  | > Y   | > The server port at which the |
| > Port    |                |       | > Thor server listens for      |
|           |                |       | > connections.                 |
+-----------+----------------+-------+--------------------------------+
| > Admin   | > HTTP_PORT    | > N   | > Port to use for the Web      |
| > Port    |                |       | > Admin console. If not        |
|           |                |       | > provided, no console will be |
|           |                |       | > available.                   |
+-----------+----------------+-------+--------------------------------+
| > Admin   | >              | > N   | > If provided specifies the    |
| >         | ADMIN_PASSWORD |       | > password to use for the Web  |
|  password |                |       | > Admin console. Defaults to   |
|           |                |       | > "admin".                     |
+-----------+----------------+-------+--------------------------------+
| >         | > S            | > N   | > If set, when multiple        |
|  Separate | EPARATE_NOTIFY |       | > products are to be updated   |
| > not     |                |       | > at the same time, Thor will  |
| ification |                |       | > send a separate notification |
| > flag    |                |       | > message for each product.    |
|           |                |       | > Otherwise, one message is    |
|           |                |       | > sent with the bit in the     |
|           |                |       | > product bitmap set for each  |
|           |                |       | > product. Default is False.   |
+-----------+----------------+-------+--------------------------------+

> \<?xml version=\"1.0\"?\>
>
> \<THOR_CONFIG\>
>
> \<SCENARIO_FILE\>c:\\dev\\wxserver\\Scenario1.xml\</SCENARIO_FILE\>
>
> \<SCENARIO_FILE\>c:\\dev\\wxserver\\Scenario2.xml\</SCENARIO_FILE\>
>
> \<START_TIMESTEP\>10\</START_TIMESTEP\>
>
> \<LOG_FILE\>c:\\dev\\wxserver\\ScenarioServer.log\</LOG_FILE\>
>
> \<USE_LOG_SERVER\>FALSE\</USE_LOG_SERVER\>
>
> \<LISTEN_PORT\>4444\</LISTEN_PORT\>
>
> \<HTTP_PORT\>4441\</HTTP_PORT\>
>
> \<ADMIN_PASSWORD\>LONGHORN\</ADMIN_PASSWORD\>
>
> \</THOR_CONFIG\>
>
> *Figure 5-1 -- Example ThorConfig.xml File.*

# 6 Thor System Panel

When Thor is started on a host server (by double clicking the Thor icon)
a panel is displayed on the desktop as show in Figure 6-1. This panel
announces the Thor version and has a field which shows the server's
status. Upon start up, the server is in the *idle* state. This means
that the scenario is not started and no weather data will be served.
Users may send subscription messages to the server when it is in the
idle state.

## 6.1 Scenario Control

The server will load the default scenario upon start up. The scenario
may be started from the system panel by clicking on the "Menu" button to
open the control menu, and selecting "Start Scenario" (see Figure 6-2).
The scenario may be stopped in the same manner. The scenario may be
changed by selecting "Change Configuration" on the popup menu. This
selection brings up a sub-panel that has a drop list from which a new
scenario file may be selected. This list is populated from the scenarios
listed in the Thor Config XML file. For the changes to take effect, the
server must be warm started or restarted, as described in the next
paragraph.

![](media/image6.png){width="3.6909722222222223in"
height="2.917361111111111in"}

*Figure 6-1 Thor System Panel*

The control menu also has commands for restarting and warm starting the
server. During a warm start, the server reloads the scenario and returns
to idle state. All subscribers and active connections remain intact. In
a restart, the server drops all connections and clears out its
subscriber database. Only the Web Admin Console (see next section)
connections remain intact.

![](media/image7.wmf){width="3.325in" height="2.6284722222222223in"}

*Figure 6-2 Pop-up Menu*

## 6.2 Shutdown

The server is shutdown by selecting "Exit" from the control menu, or
clicking on the "X" (close box) in the upper right corner of the system
panel. A confirmation box will appear, asking you to verify that you
want to shutdown the server. If you click "yes" the server will be shut
down and the panel will disappear as the application exits. If you click
"no", the server state will remain unchanged.

# 7 Web Administration Console

The Thor server supports a web-based administration console that allows
a user on a remote computer to use a web browser to access most of the
Thor functions that can be accessed from the Thor system panel
(described in the previous section). This console has been tested only
with Internet Explorer 5.5 and above. To access the console, open the
browser and enter a URL consisting of [http://]() followed by the Thor
host name or IP, followed by ":" and the Thor HTTP port, as configured
in ThorConfig.xml (for example, to access Thor on port 4444 on a host at
128.100.100.11, you would use the URL: http://128.100.100.11:4444).The
Thor server login page should appear as shown in Figure 7-1. Once the
correct password is entered and the Login button is clicked, the Thor
server Admin Page should appear as show in Figure 7-2. The functions
available from this page are:

-   *View Information* -- View information on the current server
    parameter settings and state (scenario status, number of current
    subscribers).

-   *Server Control* -- Start or stop the scenario, restart or warm
    start the server.

-   *Change Parameters* -- Change some server parameters. The server
    must be restarted or warm started for the changes to take effect.

-   *View Server Log* -- View the contents of the Thor server log.

The View Information page is shown in Figure 7-3. It is updated
automatically every three seconds and provides:

a)  The server version number

b)  The currently loaded scenario file

c)  The current scenario status (running, not running)

d)  The port that the server is using to accept subscribers and requests
    for data

e)  The number of current subscribers

> ![](media/image8.png){width="4.365972222222222in"
> height="3.563888888888889in"}

*Figure 7-1 -- Thor Server Login Page*

![](media/image9.png){width="4.520833333333333in"
height="4.145138888888889in"}

*Figure 7-2 -- Thor Server Web Admin Page*

![](media/image10.png){width="4.710416666666666in"
height="3.796527777777778in"}

*Figure 7-3 -- Thor Server Information Page*

As a convenience, the scenario status is also displayed on the Server
Control Page, shown in Figure 7-4, which provides buttons to:

a)  Start the Scenario

b)  Stop the Scenario

c)  Restart the Server

d)  Warm Start the Server

![](media/image11.png){width="5.043055555555555in"
height="4.626388888888889in"}

*Figure 7-4 Server Control Page*

The Thor Server Configuration page, shown in Figure 7-5, shows the
current selections for Thor parameters, and allows them to be changed.
Any changes to this form will take effect only after the server is
restarted or warm started. The parameters that can be changed on this
form are:

1.  *Scenario Descriptor File* -- select one of the scenario files
    specified in the Thor Config file at start up.

2.  *Use Multiple Messages for Update Notices* -- when checked, the
    server will send a separate update message for each weather product,
    when two or more products are to be updated at one time. If not
    checked, then a single message is sent, having multiple bits in the
    payload bitmap set to indicate all the products to be updated. This
    setting allows the server to be tailored to the operational
    characteristics of the clients.

![](media/image12.png){width="4.709027777777778in"
height="4.323611111111111in"}

*Figure 7-5 Change Parameters Page*

The View Server Log Page displays a snapshot of the Thor log file. The
file contains informational, debug and error messages, and traces the
server's operation from startup through shutdown.

# 8 Scenario File

The Scenario file that Thor loads at startup (restart and also warm
start), tells the server the contents of, and how to serve the weather
scenario.

A Weather Scenario comprises a set of weather products (NEXRAD,
pressure, icing, winds, etc) sampled at discreet *timesteps*. The
timesteps in the scenario may vary with the weather product, based on
the update rates available from the meteorological source organization.
For example, NEXRAD may have an update rate of ten minutes, while
Pressure may have an update rate measured in hours. The first timestep
for both NEXRAD and Pressure will correspond to the same instant in
simulation time. However, the second timestep for Pressure may
correspond to the seventh NEXRAD timestep. The products may cover the
entire Continental United States (CONUS), or a region thereof, depending
on the clipping region set at the time the scenario was generated.

Each weather product is contained in a separate data file, where each
data record contains one timestep. The scenario file contains an entry
for each weather product that includes the path to the data file and the
update rate of the product. The format of the scenario file is given in
Appendix A of the *Thor Wx File Format V1.0* document. Note that a
scenario does not necessarily contain every weather product, or all
three streams (current, actual, forecast) for the weather products that
it does contain.