![](media/image1.png){width="4.75in" height="4.375in"}

**THOR**

**Weather Scenario Server**

**Interface Design Document and**

**Message Catalog**

## 

Version 1.3

May, 2003

Prepared by

**Raytheon Technical Services Company**

For

**Human Information Processing Research Branch**

NASA Ames Research Center

Moffet Field, CA

**Table of Contents**

[Introduction 3](#introduction)

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

[Message Catalog 4](#message-catalog)

[Incoming Messages 4](#incoming-messages)

[Start Scenario Message 4](#start-scenario-message)

[Stop Scenario Message 5](#stop-scenario-message)

[Subscribe Message 5](#subscribe-message)

[Unsubscribe Message 6](#unsubscribe-message)

[Data Request Message 7](#data-request-message)

[System Time Request Message 8](#system-time-request-message)

[Load Scenario Message 8](#load-scenario-message)

[Outgoing Messages 9](#__RefHeading___Toc46215698)

[System Time Response Message 9](#system-time-response-message)

[Update Notice Message 10](#update-notice-message)

[Data Reply Message 10](#data-reply-message)

[Region Product Data Format 11](#region-product-data-format)

[Grid Data Format 12](#grid-data-format)

[Gridded Product Data Format 12](#gridded-product-data-format)

[Appendix A -- Summary of Operational Concept
13](#appendix-a-summary-of-operational-concept)

#  {#section-1 .unnumbered}

# Introduction

The Thor Weather Scenario Server is a server designed to provide weather
data to cockpit and out-the-window display simulations. It is named Thor
after the Norse god of thunder. The server runs as a Win32 application
and takes its start up parameters from an XML configuration file. It
receives its run-time controls and serves data through socket
connections, using the message formats described in this document. For
the operational concept description of this interface, see the *Weather
Models and Architecture* Power Point briefing, 17-May-2002.

The Thor server reads the weather scenario from a set of scenario files
in a defined directory hierarchy. The scenario is described in a
top-level XML scenario description file. Weather data can be obtained
from the Thor server by using the Data Request message described later,
or by directly reading the scenario files. The format of the scenario
files is described in a separate document.

# 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 includes in the file are listed
in Table 1.0. An example configuration file is shown in Figure 1. The
only tag for which there can be multiple entries is SCENARIO_FILE. Other
duplicate entries will overwrite the previous entry. When the server
first starts, it will load the scenario file in the first entry.

Table 1.0 -- Thor Configuration File Parameters

  ------------ ----------------- -------------- -------------------------------
  **Field      **XML Tag**       **Required**   **Field Description**
  Name**                                        

  Root         THOR_CONFIG       Y              The XML root for the
                                                configuration data. All other
                                                tags must be enclosed within
                                                this root tag.

  Scenario     SCENARIO_FILE     Y              The full path to a scenario
  File                                          descriptor file.

  Start Time   START_TIMESTEP    N              The time-step within the
  Step                                          scenario file at which the Thor
                                                server will start serving
                                                weather data. Default is time
                                                zero.

  Log File     LOG_FILE          N              The full path name to a file to
                                                be written as the server log.
                                                Default: "Thor.log".

  Use Log      USE_LOG_SERVER    N              A TRUE/FALSE flag that
  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 Server   LOG_SERVER_IP     N              Not used.
  IP                                            

  Log Server   LOG_SERVER_PORT   N              Not used.
  Port                                          

  Listen Port  LISTEN_PORT       Y              The server port at which the
                                                Thor server listens for
                                                connections.
  ------------ ----------------- -------------- -------------------------------

> \<?xml version=\"1.0\"?\>
>
> \<THOR_CONFIG\>
>
> \<SCENARIO_FILE\>c:\\dev\\wxserver\\Scenario.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\>
>
> \</THOR_CONFIG\>
>
> *Figure 1 -- Example ThorConfig.xml File.*

# Message Catalog

The Thor server complies with the HI Laboratory-standard CCI messaging
format. While the server itself is written in C++, the message format is
described in a language-neutral form, recognizing that some clients may
be written in other languages.

## Incoming Messages

### Start Scenario Message

  ---------- -------- ------------- ------------ --------------------------------
  **Byte**   **Msg    **Field**     **Data       **Description**
             Part**                 Type**       

  0-3        Header   Marker        unsigned     Bit pattern for start of
                                    long         message. Either 55a5aa5a hex for
                                                 Win or 5aaaa555 hex for Unix.
                                                 Helps identify whether bytes
                                                 need to be swapped

  4-7                 Msg Size      long         Total size in bytes of the
                                                 message

  8-11                Msg Type      long         Message type code: **17310**
                                                 dec.

  12-15               Source Id     Unsigned     Not Used
                                    long         

  16-19               Destination   Unsigned     Not Used
                      Id            long         

  20-23               Transaction   Unsigned     Not Used
                      Id            long         

  24-27               Ref Id        Unsigned     Not Used
                                    long         

  28-31               Misc. one     Unsigned     Not Used
                                    long         

  32-35               Year          Long         Part of Date/Time -- Not Used

  36-39               Month         Long         Part of Date/Time -- Not Used

  40-43               Day           Long         Part of Date/Time -- Not Used

  44-47               Time Type     Integer      Code for the meaning of next
                                                 field -- not used

  48-55               Time          Double Float System Time -- not used
  ---------- -------- ------------- ------------ --------------------------------

### Stop Scenario Message

  ---------- -------- ------------- ------------ --------------------------------
  **Byte**   **Msg    **Field**     **Data       **Description**
             Part**                 Type**       

  0-3        Header   Marker        unsigned     Bit pattern for start of
                                    long         message. Either 55a5aa5a hex for
                                                 Win or 5aaaa555 hex for Unix.
                                                 Helps identify whether bytes
                                                 need to be swapped

  4-7                 Msg Size      long         Total size in bytes of the
                                                 message

  8-11                Msg Type      long         Message type code: **17320**
                                                 dec.

  12-15               Source Id     Unsigned     Not Used
                                    long         

  16-19               Destination   Unsigned     Not Used
                      Id            long         

  20-23               Transaction   Unsigned     Not Used
                      Id            long         

  24-27               Ref Id        Unsigned     Not Used
                                    long         

  28-31               Misc. one     Unsigned     Not Used
                                    long         

  32-35               Year          Long         Part of Date/Time -- Not Used

  36-39               Month         Long         Part of Date/Time -- Not Used

  40-43               Day           Long         Part of Date/Time -- Not Used

  44-47               Time Type     Integer      Code for the meaning of next
                                                 field -- not used

  48-55               Time          Double Float System Time -- not used
  ---------- -------- ------------- ------------ --------------------------------

### Subscribe Message

  ---------- --------- --------------- ----------- -------------------------------
  **Byte**   **Msg     **Field**       **Data      **Description**
             Part**                    Type**      

  0-3        Header    Marker          unsigned    Bit pattern for start of
                                       long        message. Either 55a5aa5a hex
                                                   for Win or 5aaaa555 hex for
                                                   Unix. Helps identify whether
                                                   bytes need to be swapped

  4-7                  Msg Size        long        Total size in bytes of the
                                                   message

  8-11                 Msg Type        long        Message type code: **19500**
                                                   dec.

  12-15                Source Id       Unsigned    Not Used
                                       long        

  16-19                Destination Id  Unsigned    Not Used
                                       long        

  20-23                Transaction Id  Unsigned    Not Used
                                       long        

  24-27                Ref Id          Unsigned    Not Used
                                       long        

  28-31                Port Number     Unsigned    Subscribers Port to receive
                                       long        notifications

  32-35                Year            Long        Part of Date/Time -- Not Used

  36-39                Month           Long        Part of Date/Time -- Not Used

  40-43                Day             Long        Part of Date/Time -- Not Used

  44-47                Time Type       Integer     Code for the meaning of next
                                                   field -- not used

  48-55                Time            Double      System Time -- not used
                                       Float       

  56-59      Payload   Text Product    Unsigned    Bitmap identifying text
                       bit map         long        products to include

  60-63                Radar Prod. bit Unsigned    Bitmap identifying Radar
                       map             long        products to include

  64-67                Current Wx      Unsigned    Bitmap identifying current
                       Product bit map long        weather products to include

  68-71                Forecast Wx     Unsigned    Bitmap identifying forecast
                       Product bit map long        weather products to include

  72-75                Actual Wx       Unsigned    Bitmap identifying actual
                       Product bit map long        weather products to include

  76-79                Aux.Wx Product  Unsigned    Bitmap identifying auxiliary
                       bit map         long        weather products to include
  ---------- --------- --------------- ----------- -------------------------------

For the Weather product bit maps, Table 2.0 lists the codes have been
defined as of this draft of this document. The bit patterns can be
logically Or-ed together to include multiple products.

*Table 2.0 -- Product Bit Settings*

###  

### Unsubscribe Message

  ---------- -------- --------------- ----------- -------------------------------
  **Byte**   **Msg    **Field**       **Data      **Description**
             Part**                   Type**      

  0-3        Header   Marker          unsigned    Bit pattern for start of
                                      long        message. Either 55a5aa5a hex
                                                  for Win or 5aaaa555 hex for
                                                  Unix. Helps identify whether
                                                  bytes need to be swapped

  4-7                 Msg Size        Long        Total size in bytes of the
                                                  message

  8-11                Msg Type        Long        Message type code: **19510**
                                                  dec.

  12-15               Source Id       Unsigned    Not Used
                                      long        

  16-19               Destination Id  Unsigned    Not Used
                                      long        

  20-23               Transaction Id  Unsigned    Not Used
                                      long        

  24-27               Ref Id          Unsigned    Not Used
                                      long        

  28-31               Port Number     Unsigned    Subscribers Port -- needed for
                                      long        identification

  32-35               Year            Long        Part of Date/Time -- Not Used

  36-39               Month           Long        Part of Date/Time -- Not Used

  40-43               Day             Long        Part of Date/Time -- Not Used

  44-47               Time Type       Integer     Code for the meaning of next
                                                  field -- not used

  48-55               Time            Double      System Time -- not used
                                      Float       
  ---------- -------- --------------- ----------- -------------------------------

### Data Request Message

  ---------- --------- ------------- ----------- -------------------------------
  **Byte**   **Msg     **Field**     **Data      **Description**
             Part**                  Type**      

  0-3        Header    Marker        unsigned    Bit pattern for start of
                                     long        message. Either 55a5aa5a hex
                                                 for Win or 5aaaa555 hex for
                                                 Unix. Helps identify whether
                                                 bytes need to be swapped

  4-7                  Msg Size      Long        Total size in bytes of the
                                                 message

  8-11                 Msg Type      Long        Message type code: **19530**
                                                 dec.

  12-15                Source Id     Unsigned    Not Used
                                     long        

  16-19                Destination   Unsigned    Not Used
                       Id            long        

  20-23                Transaction   Unsigned    Not Used
                       Id            long        

  24-27                Ref Id        Unsigned    Not Used
                                     long        

  28-31                Misc. one     Unsigned    Not Used
                                     long        

  32-35                Year          Long        Part of Date/Time -- Not Used

  36-39                Month         Long        Part of Date/Time -- Not Used

  40-43                Day           Long        Part of Date/Time -- Not Used

  44-47                Time Type     Integer     Code for the meaning of next
                                                 field -- not used

  48-55                Time          Double      System Time -- not used
                                     Float       

  56-59      Payload   Text Product  Unsigned    Bitmap identifying text
                       bit map       long        products requested

  60-63                Radar Prod.   Unsigned    Bitmap identifying Radar
                       bit map       long        products requested

  64-67                Current Wx    Unsigned    Bitmap identifying current
                       Product bit   long        weather requested
                       map                       

  68-71                Forecast Wx   Unsigned    Bitmap identifying forecast
                       Product bit   long        weather products requested
                       map                       

  72-75                Actual Wx     Unsigned    Bitmap identifying actual
                       Product bit   long        weather products requested
                       map                       

  76-79                Aux.Wx        Unsigned    Bitmap identifying auxiliary
                       Product bit   long        weather products (see Table 2.0
                       map                       for bit map codes)

  80-87                Latitude      Double      Latitude of center of region of
                                     float       interest in degrees (-90.0 to
                                                 90.0N).

  88-95                Longitude     Double      Longitude of center of region
                                     float       of interest in degrees (-180 to
                                                 180E).

  96-103               Altitude      Double      Altitude of center of region of
                                     float       interest

  104-111              Radius        Double      Radius of region of interest in
                                     float       nautical miles. Data will be
                                                 clipped to approximately this
                                                 radius.
  ---------- --------- ------------- ----------- -------------------------------

### System Time Request Message

  ---------- -------- ------------- ----------- -------------------------------
  **Byte**   **Msg    **Field**     **Data      **Description**
             Part**                 Type**      

  0-3        Header   Marker        unsigned    Bit pattern for start of
                                    long        message. Either 55a5aa5a hex
                                                for Win or 5aaaa555 hex for
                                                Unix. Helps identify whether
                                                bytes need to be swapped

  4-7                 Msg Size      Long        Total size in bytes of the
                                                message

  8-11                Msg Type      Long        Message type code: **504** dec.

  12-15               Source Id     Unsigned    Not Used
                                    long        

  16-19               Destination   Unsigned    Not Used
                      Id            long        

  20-23               Transaction   Unsigned    Not Used
                      Id            long        

  24-27               Ref Id        Unsigned    Not Used
                                    long        

  28-31               Misc. one     Unsigned    Not Used
                                    long        

  32-35               Year          Long        Part of Date/Time -- Not Used

  36-39               Month         Long        Part of Date/Time -- Not Used

  40-43               Day           Long        Part of Date/Time -- Not Used

  44-47               Time Type     Integer     Code for the meaning of next
                                                field -- not used

  48-55               Time          Double      System Time -- not used
                                    Float       
  ---------- -------- ------------- ----------- -------------------------------

The *Load Scenario* message requests that the Thor server load a new
scenario file. The file name (including full path on the system hosting
Thor) is specified in an ASCII string as the payload of the message.
Upon receipt of the message, Thor will stop processing any existing
scenario, load the new file and go into the idle state. Any current
subscribers or connections will be maintained.

### Load Scenario Message

  ---------- -------- ------------- ----------- -------------------------------
  **Byte**   **Msg    **Field**     **Data      **Description**
             Part**                 Type**      

  0-3        Header   Marker        unsigned    Bit pattern for start of
                                    long        message. Either 55a5aa5a hex
                                                for Win or 5aaaa555 hex for
                                                Unix. Helps identify whether
                                                bytes need to be swapped

  4-7                 Msg Size      Long        Total size in bytes of the
                                                message

  8-11                Msg Type      Long        Message type code: **19515**
                                                dec.

  12-15               Source Id     Unsigned    Not Used
                                    long        

  16-19               Destination   Unsigned    Not Used
                      Id            long        

  20-23               Transaction   Unsigned    Not Used
                      Id            long        

  24-27               Ref Id        Unsigned    Not Used
                                    long        

  28-31               Misc. one     Unsigned    Not Used
                                    long        

  32-35               Year          Long        Part of Date/Time -- Not Used

  36-39               Month         Long        Part of Date/Time -- Not Used

  40-43               Day           Long        Part of Date/Time -- Not Used

  44-47               Time Type     Integer     Code for the meaning of next
                                                field -- not used

  48-55               Time          Double      System Time -- not used
                                    Float       

  56-59               String length integer     Length in bytes of next field.

  60-(60 +            Scenario File Character   The full path to the scenario
  Str. Len.)          Path                      file, on the system hosting
                                                Thor.
  ---------- -------- ------------- ----------- -------------------------------

[]{#__RefHeading___Toc46215698 .anchor}***Outgoing Messages***

The system Time Response message is sent in reply to a System Time
Request message. As a payload, it provides the current system time of
the system on which the Thor server is running.

### System Time Response Message

  ---------- -------- ------------- ----------- -------------------------------
  **Byte**   **Msg    **Field**     **Data      **Description**
             Part**                 Type**      

  0-3        Header   Marker        unsigned    Bit pattern for start of
                                    long        message. Either 55a5aa5a hex
                                                for Win or 5aaaa555 hex for
                                                Unix. Helps identify whether
                                                bytes need to be swapped

  4-7                 Msg Size      Long        Total size in bytes of the
                                                message

  8-11                Msg Type      Long        Message type code: **505** dec.

  12-15               Source Id     Unsigned    Not Used
                                    long        

  16-19               Destination   Unsigned    Not Used
                      Id            long        

  20-23               Transaction   Unsigned    Not Used
                      Id            long        

  24-27               Ref Id        Unsigned    Not Used
                                    long        

  28-31               Misc. one     Unsigned    Not Used
                                    long        

  32-35               Year          Long        Part of Date/Time

  36-39               Month         Long        Part of Date/Time

  40-43               Day           Long        Part of Date/Time

  44-47               Time Type     Integer     Code for the meaning of next
                                                field

  48-55               Time          Double      System Time
                                    Float       

  56-59               Year          Long        Part of Date/Time

  60-63               Month         Long        Part of Date/Time

  64-67               Day           Long        Part of Date/Time

  68-71               Time Type     Integer     Code for the meaning of next
                                                field

  72-79               Time          Double      System Time
                                    Float       
  ---------- -------- ------------- ----------- -------------------------------

The Update Notice message is sent to subscribers to indicate that the
next time step for a product is available. The message includes a bit
map which indicates which products are updated. If a single product is
referenced in the message, then the final field contains the time-step
number for that product. Otherwise, the final field is omitted. This
field is intended to be used by subscribers with a local cache, who
might use the time-step number as some kind of an index into the cache.

### Update Notice Message

+----+------+---------------+----------+------------------------------+
| ** | *    | **Field**     | **Data   | **Description**              |
| By | *Msg |               | Type**   |                              |
| te | Pa   |               |          |                              |
| ** | rt** |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 0  | He   | Marker        | unsigned | Bit pattern for start of     |
| -3 | ader |               | long     | message. Either 55a5aa5a hex |
|    |      |               |          | for Win or 5aaaa555 hex for  |
|    |      |               |          | Unix. Helps identify whether |
|    |      |               |          | bytes need to be swapped     |
+----+------+---------------+----------+------------------------------+
| 4  |      | Msg Size      | Long     | Total size in bytes of the   |
| -7 |      |               |          | message                      |
+----+------+---------------+----------+------------------------------+
| 8- |      | Msg Type      | Long     | Message type code: **19520** |
| 11 |      |               |          | dec.                         |
+----+------+---------------+----------+------------------------------+
| 1  |      | Source Id     | Unsigned | Not Used                     |
| 2- |      |               | long     |                              |
| 15 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 1  |      | Destination   | Unsigned | Not Used                     |
| 6- |      | Id            | long     |                              |
| 19 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 2  |      | Transaction   | Unsigned | Not Used                     |
| 0- |      | Id            | long     |                              |
| 23 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 2  |      | Ref Id        | Unsigned | Not Used                     |
| 4- |      |               | long     |                              |
| 27 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 2  |      | Misc. one     | Unsigned | Not Used                     |
| 8- |      |               | long     |                              |
| 31 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 3  |      | Year          | Long     | Current year                 |
| 2- |      |               |          |                              |
| 35 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 3  |      | Month         | Long     | Current month (1 -- 12)      |
| 6- |      |               |          |                              |
| 39 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 4  |      | Day           | Long     | Current day in month ( 1 --  |
| 0- |      |               |          | 31)                          |
| 43 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 4  |      | Time Type     | Integer  | Code for the meaning of next |
| 4- |      |               |          | field -- UTC                 |
| 47 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 4  |      | Time          | Double   | System Time                  |
| 8- |      |               | Float    |                              |
| 55 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 5  | Pay  | Text Product  | Unsigned | Bitmap identifying text      |
| 6- | load | bit map       | long     | products updated             |
| 59 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 6  |      | Radar Prod.   | Unsigned | Bitmap identifying Radar     |
| 0- |      | bit map       | long     | products updated             |
| 63 |      |               |          |                              |
+----+------+---------------+----------+------------------------------+
| 6  |      | Current Wx    | Unsigned | Bitmap identifying current   |
| 4- |      | Product bit   | long     | weather updated              |
| 67 |      | map           |          |                              |
+----+------+---------------+----------+------------------------------+
| 6  |      | Forecast Wx   | Unsigned | Bitmap identifying forecast  |
| 8- |      | Product bit   | long     | weather products updated     |
| 71 |      | map           |          |                              |
+----+------+---------------+----------+------------------------------+
| 7  |      | Actual Wx     | Unsigned | Bitmap identifying actual    |
| 2- |      | Product bit   | long     | weather products updated     |
| 75 |      | map           |          |                              |
+----+------+---------------+----------+------------------------------+
| 7  |      | Aux.Wx        | Unsigned | Bitmap identifying auxiliary |
| 6- |      | Product bit   | long     | products updated (see Table  |
| 79 |      | map           |          | 2.0 for bit map codes)       |
+----+------+---------------+----------+------------------------------+
| 8  |      | Time step     | Unsigned | Only for notices that        |
| 0- |      | number        | long     | specify a single product,    |
| 83 |      |               |          |                              |
|    |      |               |          | this field is the time-step  |
|    |      |               |          | counter for that product.    |
+----+------+---------------+----------+------------------------------+

The Data Reply Message can have different Message Type Codes, depending
on the type of data in the reply. If more than one weather products are
requested so that the reply contains multiple products, the Message Type
will designate a *General Reply*. Otherwise, the Message Type will
indicate the kind of data record for the single product in the reply:
Region, Grid Map, Gridded, or Text.

### Data Reply Message

+----+------+---------------+----------+-----------------------+---+---+---+
| ** | *    | **Field**     | **Data   | **Description**       |   |   |   |
| By | *Msg |               | Type**   |                       |   |   |   |
| te | Pa   |               |          |                       |   |   |   |
| ** | rt** |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 0  | He   | Marker        | unsigned | Bit pattern for start |   |   |   |
| -3 | ader |               | long     | of message. Either    |   |   |   |
|    |      |               |          | 55a5aa5a hex for Win  |   |   |   |
|    |      |               |          | or 5aaaa555 hex for   |   |   |   |
|    |      |               |          | Unix. Helps identify  |   |   |   |
|    |      |               |          | whether bytes need to |   |   |   |
|    |      |               |          | be swapped            |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 4  |      | Msg Size      | Long     | Total size in bytes   |   |   |   |
| -7 |      |               |          | of the message        |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 8- |      | Msg Type      | Long     | Message type code     |   |   |   |
| 11 |      |               |          | (decimal):            |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |  ------- ------------ |   |   |   |
|    |      |               |          |   19540   General     |   |   |   |
|    |      |               |          |           Reply       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |   19550   Region Data |   |   |   |
|    |      |               |          |           Reply       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |   19560   Grid Map    |   |   |   |
|    |      |               |          |           Reply       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |  19570   Gridded Data |   |   |   |
|    |      |               |          |           Reply       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |   19580   Text Data   |   |   |   |
|    |      |               |          |           Reply       |   |   |   |
|    |      |               |          |                       |   |   |   |
|    |      |               |          |  ------- ------------ |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 1  |      | Source Id     | Unsigned | Not Used              |   |   |   |
| 2- |      |               | long     |                       |   |   |   |
| 15 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 1  |      | Destination   | Unsigned | Not Used              |   |   |   |
| 6- |      | Id            | long     |                       |   |   |   |
| 19 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 2  |      | Transaction   | Unsigned | Not Used              |   |   |   |
| 0- |      | Id            | long     |                       |   |   |   |
| 23 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 2  |      | Ref Id        | Unsigned | Not Used              |   |   |   |
| 4- |      |               | long     |                       |   |   |   |
| 27 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 2  |      | Misc. one     | Unsigned | Not Used              |   |   |   |
| 8- |      |               | long     |                       |   |   |   |
| 31 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 3  |      | Year          | Long     | Current year          |   |   |   |
| 2- |      |               |          |                       |   |   |   |
| 35 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 3  |      | Month         | Long     | Current month (1 --   |   |   |   |
| 6- |      |               |          | 12)                   |   |   |   |
| 39 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 4  |      | Day           | Long     | Current day in month  |   |   |   |
| 0- |      |               |          | ( 1- 31)              |   |   |   |
| 43 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 4  |      | Time Type     | Integer  | Code for the meaning  |   |   |   |
| 4- |      |               |          | of next field         |   |   |   |
| 47 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 4  |      | Time          | Double   | System Time           |   |   |   |
| 8- |      |               | Float    |                       |   |   |   |
| 55 |      |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 5  | Pay  | Text Product  | Unsigned | Bitmap identifying    |   |   |   |
| 6- | load | bit map       | long     | text products         |   |   |   |
| 59 |      |               |          | included              |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 6  |      | Radar Prod.   | Unsigned | Bitmap identifying    |   |   |   |
| 0- |      | bit map       | long     | Radar products        |   |   |   |
| 63 |      |               |          | included              |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 6  |      | Current Wx    | Unsigned | Bitmap identifying    |   |   |   |
| 4- |      | Product bit   | long     | current weather       |   |   |   |
| 67 |      | map           |          | included              |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 6  |      | Forecast Wx   | Unsigned | Bitmap identifying    |   |   |   |
| 8- |      | Product bit   | long     | forecast weather      |   |   |   |
| 71 |      | map           |          | products included     |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 7  |      | Actual Wx     | Unsigned | Bitmap identifying    |   |   |   |
| 2- |      | Product bit   | long     | actual weather        |   |   |   |
| 75 |      | map           |          | products included     |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 7  |      | Aux.Wx        | Unsigned | Bitmap identifying    |   |   |   |
| 6- |      | Product bit   | long     | auxiliary products    |   |   |   |
| 79 |      | map           |          | included (see Table   |   |   |   |
|    |      |               |          | 2.0 for bit map       |   |   |   |
|    |      |               |          | codes)                |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+
| 8  | *    |               |          |                       |   |   |   |
| 0. | *One |               |          |                       |   |   |   |
| .. | or   |               |          |                       |   |   |   |
|    | more |               |          |                       |   |   |   |
|    | Pro  |               |          |                       |   |   |   |
|    | duct |               |          |                       |   |   |   |
|    | Data |               |          |                       |   |   |   |
|    | Sets |               |          |                       |   |   |   |
|    | as   |               |          |                       |   |   |   |
|    | D    |               |          |                       |   |   |   |
|    | escr |               |          |                       |   |   |   |
|    | ibed |               |          |                       |   |   |   |
|    | in   |               |          |                       |   |   |   |
|    | the  |               |          |                       |   |   |   |
|    | f    |               |          |                       |   |   |   |
|    | ollo |               |          |                       |   |   |   |
|    | wing |               |          |                       |   |   |   |
|    | Tabl |               |          |                       |   |   |   |
|    | es** |               |          |                       |   |   |   |
+----+------+---------------+----------+-----------------------+---+---+---+

The following tables describe the Product Data Set formats. The fields
in the data set are aligned on four byte boundaries. This may require
padding the character data with one or more null characters

### Region Product Data Format

  ----------- ------------- ------------ -------------------------------------
  **Field**                 **Data       **Description**
                            Type**       

  Product                   Int          0 = Text, 1 = Radar, 2 = Current, 3 =
  Type                                   Forecast, 4 = Actual.

  Product                   unsigned     Code for specific weather Product
  Code                      long         (*see Table 2.0*)

  Count                     Int          Number of regions to follow.

  Repeats     Value         Int          A context--specific value associated
  Count                                  with the region. Possibly level of
                                         intensity.

  Times       Altitude †    Double       The altitude at which this region is
                                         defined.

              Vertex Count  Int          Number of vertices (0, 1, or 3 or
                                         more) defining geo-spatial point or
                                         region affected by this product.

              Latitude - 1  Double       First vertex

              Longitude - 1 Double       First vertex

              ...                        

              Latitude -- N Double       Last vertex

              Longitude --  Double       Last Vertex
              N                          

              Text Length   Long         Length in bytes of annotation. Zero
                                         if no text.

              Text ‡        Character    Descriptive text associated with the
                                         region.
  ----------- ------------- ------------ -------------------------------------

† For Echo Tops, the value of the region is the altitude, in kilo-feet.
The Value field holds this value, and the Altitude field is always zero.

‡ For the Storm Model product only: the text region always begins with
the eight character storm id of the form: AAAAXXDD where AAAA is the
site Id, XX is the NEXRAD cell Id and DD is unique number for polygon
(with leading zero).

The Region Product Data Format is used for the non-gridded weather
products that can be represented by a region or a point: SIGMET, AIRMET,
METAR, NEXRAD, NEXRAD LOW, STORM MODEL, ECHO TOPS, CEILING, LIGHTNING,
ICING, TURBULENCE, PRECIPITATION and VISIBILITY.

### Grid Data Format

  ----------- ------------ ------------- -------------------------------------
  **Field**                **Data Type** **Description**

  Product                  Int           5 = Auxiliary.
  Type                                   

  Product                  unsigned long WIND_GRID (*see Table 2.0*)
  Code                                   

  Row Size                 Int           Number of points in a row.

  Row Count                Int           Number of Rows.

  Row 1       Latitude 1   Double        

              Longitude 1  Double        

              ...                        

              Latitude n   Double        

              Longitude n  Double        

  Row 2       Latitude 1   Double        

              Longitude 1  Double        

              ...                        

              Latitude n   Double        

              Longitude n  double        

  ...                                    

  Row n                                  
  ----------- ------------ ------------- -------------------------------------

The Grid Data Format is used to send a grid that defines the Lat-Lon
location of the points constituting the gridded weather products. The
grid is the same for all altitude levels and is provided in row-major
order.

### Gridded Product Data Format

  ----------- -------- --------- ------------ -------------------------------------
  **Field**                      **Data       **Description**
                                 Type**       

  Product                        Int          2 = Current, 3 = Forecast, 4 =
  Type                                        Actual.

  Product                        unsigned     Code for specific weather Product
  Code                           long         (*see Table 2.0*)

  Clipped                        Int          0 = grid is not clipped, 1 = clipping
  Flag                                        info follows.

  Optional,   NW Row             Int          Grid row number of NW corner of
                                              clipped area.

  used if     NW Col.            Int          Grid column number NW corner of
                                              clipped area.

  Clipped     Row                Long         Number of entries in each row.
              Length                          

  Flag is set Rows               Long         Number of rows in the clipped area.

  Altitude 1                     Double       The altitude at which the points are
                                              defined.

  Row 1                Value 1 ‡              A context--specific value associated
                                              with the point.

                       Value 2                

                       ...                    

                       Value n                

  Row 2                Value 1                

                       Value 2                

                       ...                    

                       Value n                

  ...                                         

  Row n                ...                    

  Altitude 2                     Double       

  ...                                         

  Altitude n                     Double       
  ----------- -------- --------- ------------ -------------------------------------

> ‡ Value could be a single value, or a structure containing one or more
> items, depending on the product.

The Gridded Product Data Format is used for the gridded weather products
that can be represented by a grid of points: WIND and TEMPERATURE. The
points are organized into altitude levels, and by rows of points that
correspond to the lat/lon positions in the matching WIND_GRID product.
In practice, the WIND_GRID would be sent to all clients and those
lat/lon positions would apply to all subsequent gridded products.

Table 2 -- Gridded Product Value Types

  ---------------- ------------------ ------------------------------------
  **Product**      **Value**          **Description**

  Temperature      float              Temperature in degrees Kelvin

  Wind             (float, float)     UV components of wind vector

                                      

                                      
  ---------------- ------------------ ------------------------------------

# Appendix A -- Summary of Operational Concept

When the server starts up, it is in a neutral state. It will read its
configuration file and then send a message to the ADRS, asking to be
notified when the scenario starts. In the neutral state, the server can
accept Subscription messages from clients wishing to be notified of
weather product updates.

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. 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 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. To change to a different weather scenario, the ThorConfig.xml
file must be edited and the server shutdown and restarted.