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

**THOR**

**Weather Scenario Server**

**File Format Description**

## 

Version 1.0

July 23, 2002

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)

[Scenario Contents 3](#scenario-contents)

[File Record Structures 3](#file-record-structures)

[Text Record Format 3](#text-record-format)

[Region Record Format 4](#region-record-format)

[Grid Record Format 4](#grid-record-format)

[Gridded Record Format 4](#gridded-record-format)

[Custom Format 5](#custom-format)

[Appendix A -- Example Scenario Descriptor File
6](#appendix-a-example-scenario-descriptor-file)

#  {#section-1 .unnumbered}

# Introduction

This document describes the format of the files containing the Weather
Scenario. The Weather Scenario contains the weather data served by the
Thor Scenario Server. The information in this document is provided to
allow other applications to read the scenario files directly, or in
concert with sequencing messages from the Thor server.

# Scenario Contents

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
simulated time. However, the second timestep for Pressure may correspond
to the seventh NEXRAD timestep.

Each weather product is contained in a separate data file, where each
data record contains one timestep, covering the Continental United
States (CONUS). Each Weather Scenario has a Scenario Descriptor File
(SDF), in XML format, which contains an entry for each weather product
in the scenario. The entry includes the path to the data file, and the
update rate of the product. Appendix A contains a listing of an example
SDF. Note that a scenario does not necessarily contain every defined
weather product, or all three streams (current, actual, forecast) for
the weather products that it does contain.

# File Record Structures

The basic types of data records and the product files that use them are
listed in Table 1. The weather product determines the record format used
in a file. The scenario SDF has an entry for each product that indicates
its record format. The various record formats are described in the
following sections.

> Table 1 -- Record Formats

  ------------------------- ---------------------------------------------
  **Record Format**         **Products Using Format**

  Text                      METAR

  Region                    AIRMET, SIGMET, NEXRAD, Ceiling, Icing,
                            Lightning, Precipitation, Turbulence,
                            Visibility, Pressure

  Grid                      Lat/Lon Grid

  Gridded                   Wind, Temperature

  Custom                    Out-The-window
  ------------------------- ---------------------------------------------

## Text Record Format

The only pure text-based product is the METAR (AIRMETs and SIGMETs can
have regions associated with them). Each record in a Text Record
Formatted (TRF) file begins with two long-words. The first contains the
timestep number (0 to the last step in the scenario), the second
contains the length in bytes of the data that follows in the record. The
data consists of ASCII characters. The basic file type is a stream file;
there is no end-of-record mark.

## Region Record Format

The Region Record Format (RRF) is used for products that can be
represented by a polygonal region in space (2-D, at a fixed altitude)
with an associated value. Examples are Pressure contours, Icing,
lightning and turbulence hazard areas, and NEXRAD precipitation areas.
Each record in a Region Record Formatted (RRF) file begins with two
long-words. The first contains the timestep number (0 to the last step
in the scenario), the second contains the length in bytes of the data
that follows in the record.

The record consists of one or more polygons with an associated value and
altitude level, and optionally, some associated text. The record layout
is show in the following table.

Table 2 -- Region Record Format

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

  Timestep                  unsigned    0 to the last step in the scenario
                            long        

  Record                    unsigned    Size of following data, in bytes
  Length                    long        

  Region                    int         Number of following Regions
  Count                                 

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

  Region      Altitude      Double      The altitude at which this region is
                                        defined.

  Count       Vertex Count  Int         Number of vertices (0, 1, or 3 or
  Times)                                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.
  ----------- ------------- ----------- -------------------------------------

## Grid Record Format

The Grid Record Format is used for products that can be represented by a
grid of points at a defined altitude level. Each point has an associated
value. Gridded products are in two parts. The first is a file containing
a grid of latitude and longitude values. This grid defines the points at
which the values for the weather product are defined. See Table 3.

## Gridded Record Format

The second part of the gridded product consists of a set of values that
map to the points in the grid. The idea is that the grid need be sent or
read only once. As the weather is updated, the values mapped to the grid
points may change, but the values of the grid itself will not. See
Tables 4 and 5.

Table 3 -- Grid Data Format

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

  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                                  
  ----------- ------------ ------------- -------------------------------------

Table 4 -- Gridded Product Data Format

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

  Timestep              unsigned long 0 to the last step in the scenario

  Record                unsigned long Size of following data, in bytes
  Length                              

  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.

*Table5* -- Gridded Product Value Types

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

  Temperature      Float              Temperature in degrees Kelvin

  Wind             (float, float)     UV components of wind vector
  ---------------- ------------------ ------------------------------------

## Custom Format

These formats are specific to the hopefully rare products that do not
conform to any of the standard record formats. (TBD).

# Appendix A -- Example Scenario Descriptor File

\<?xml version=\'1.0\'?\>

\<!\-- This is an example Scenario Description file. \--\>

\<SCENARIO_DESCRIPTION\>

\<SCENARIO_ID\>KGRK20132002\</SCENARIO_ID\>

\<!\-- The following parameters apply to every product in the scenario
\--\>

\<!\-- PLAY_RATE is the overall scenario playback rate. \--\>

\<PLAY_RATE\>1\</PLAY_RATE\>

\<!\-- The following section contains parameters for each product in
this scenario \--\>

\<PRODUCT\>

\<PRODUCT_NAME\>NEXRAD\</PRODUCT_NAME\>

\<UPDATE_DELAY\>3\</UPDATE_DELAY\> \<!\-- delay between updates in
seconds \--\>

\<!\--
\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\nexrad.dat\</FILE_PATH\>
\--\>

\<FILE_PATH\>c:\\dev\\wxserver\\untitled.ply\</FILE_PATH\>

\<FILE_TYPE\>REGION\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>AIRMET\</PRODUCT_NAME\>

\<UPDATE_DELAY\>21600\</UPDATE_DELAY\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\AIRMET.dat\</FILE_PATH\>

\<FILE_TYPE\>REGION\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>SIGMET\</PRODUCT_NAME\>

\<UPDATE_DELAY\>3600\</UPDATE_DELAY\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\SIGMET.dat\</FILE_PATH\>

\<FILE_TYPE\>REGION\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>METAR\</PRODUCT_NAME\>

\<UPDATE_DELAY\>3600\</UPDATE_DELAY\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\METAR.dat\</FILE_PATH\>

\<FILE_TYPE\>REGION\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>WINDS_GRID\</PRODUCT_NAME\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\winds_grid.dat\</FILE_PATH\>

\<FILE_TYPE\>GRID\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>WINDS_ACTUAL\</PRODUCT_NAME\>

\<UPDATE_DELAY\>3600\</UPDATE_DELAY\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\winds_actual.dat\</FILE_PATH\>

\<FILE_TYPE\>GRID\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>WINDS_CURRENT\</PRODUCT_NAME\>

\<UPDATE_DELAY\>3600\</UPDATE_DELAY\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\winds_current.dat\</FILE_PATH\>

\<FILE_TYPE\>GRID\</FILE_TYPE\>

\</PRODUCT\>

\<PRODUCT\>

\<PRODUCT_NAME\>WINDS_FORECAST\</PRODUCT_NAME\>

\<UPDATE_DELAY\>3600\</UPDATE_DELAY\>

\<FILE_PATH\>c:\\wx\\scenarios\\KGRK20132002\\winds_forecast.dat\</FILE_PATH\>

\<FILE_TYPE\>GRID\</FILE_TYPE\>

\</PRODUCT\>

\</SCENARIO_DESCRIPTION\>