# Awips Graphical Climate Program Version 1.0 Language: Perl/tk and C-shell

## 1. INTRODUCTION 

The AWIPS climate program is an automated program that maintains records
of Highs, Lows and Precipitation for up to seven user defined stations.
Daily records, normals, monthly data and yearly data are displayed in a
graphical and numeric format and is automatically updated on a daily
basis by ingesting the current LCD products stored in the Informix
database. The graphical format allows for quick access to any month and
year in an easy to read color coded display. In addition to the
graphical display numeric data is also available in a variety of formats
through the use of pull down menus, or by placing the mouse cursor on
the desired graph trace. Records are automatically updated by comparing
the F6/LCD data with existing records for a particular month. This
eliminates the need to manually update daily, monthly, or yearly
records. An editor is also available for the climate records if manual
intervention becomes necessary due to ingest of bad data or data that
needs to be corrected at a later date. Options are also available for
creating internet HTML tables for monthly records, for generating
graphic images for the internet, for printing out a hard copy of the
color graphics, and for printing out records in various formats. Program
size is also small, thus allowing for faster program

operation and to limit the demand on X-resources.

## 2. METHODOLOGY AND SOFTWARE STRUCTURE 

The main feature of this program is a color coded month graph of
critical climatological information and an archiving of monthly
climatological information. Climatological data can also be accessed
through pull down menus which display data in a numeric format for
viewing, printing, and for internet display. An \"SQL\" script using the
AWIPS \"dbaccess\" function is used to create the initial records
database and can be customized according to user needs.

The graphical portion of the program displays a full month\'s worth of
data (Figure 1). Across the bottom of the graph are numbers ranging from
1-31, indicating the day of the month. On the left side of the graph is
a sliding scale in increments of 5 degrees based on monthly temperature
ranges, which will vary from month to month. On the right side of the
graph is a \"green\" liquid precipitation scale in increments of .25
inches. Also on the right side is a \"blue\" snowfall scale in
increments of an inch. The current month, year, and climate reporting
station is displayed at the top of the graph. In addition there are four
radio buttons near the upper left corner of the graphical display. These
buttons correspond to the stations available in the user selected
database. Clicking on these buttons will switch between stations and the
selected station will display a green radio button light. At the bottom
of the graphical display is a numeric temperature and precipitation
summary and a color key for the graph traces.

### Monthly Records Plot:

The top red line on the graph displays the daily max temperature
records. Placing the mouse cursor over the appropriate red circle will
display the max temperature record and data of record across the bottom
of the graph.

The solid orange line displays the daily mean high temperatures.

The orange line with solid circles displays the daily high temperatures.

The blue solid line displays the daily mean minimum temperatures.

The purple line with solid circles displays the minimum temperature
record. Placing the mouse cursor over the appropriate purple circle will
display the min temperature record and the date of the record across the
bottom of the graph.

The blue rectangles represent the daily snowfall (\"T\" for trace
events). Placing the mouse cursor over the appropriate blue rectangle
displays the daily snowfall across the bottom

of the graph.

The green rectangles represent the daily rainfall (\"T\" for trace
events). Placing the mouse cursor over the appropriate green rectangle
displays the daily rainfall across the bottom of the graph.

### Temperatures and Precipitation Data:

Below the monthly graph display is a numeric temperature and
precipitation data summary for the appropriate month (Figure 1). This
display includes the monthly averages, totals and normals for
temperature, precipitation, heating degree days, and cooling degree
days.

### 

### Graph Key:

Below the temperature and precipitation data summary is a graph key
which defines the color coding and symbols used in the graphical
display. This feature will aid in the interpretation of the climate
graph for images placed on the internet.

### Pull Down Menus:

Several pull down menus are displayed above the graphics plots and allow
the user to select various climatologic display and editing features.
Menu selections include: Program Setup, Display Data, Precipitation
Record Thresholds, Temperature Record Thresholds, Edit/Print F6,
Update/Print Records

### Setup Menu:

The Setup must be run before using the climate program or when adding or
changing station data. The Setup Menu allows the user to enter the data
path of all database files and to enter the names of up to seven
stations (Figure 7). The station names should be in the three letter
format and can be lower or upper case (e.g. DTW or dtw). These stations
should also be in the AWIPS LCD database (e.g. DTWLCDMMM should be in
the Informix database). The full path to the climate database files
should also be entered in the setup GUI in the following format (e.g.
home/localapps/climo).

Default setup files are created during the initial database load
process. Thus the setup procedure may not be necessary if the user is
satisfied with the climate stations retrieved from the AWIPS climate
database.

There is also an "Edit Scale Range" option available under the Setup
menu. This will allow the user to customize the temperature scale that
appears on the right hand side of the monthly graphs. A minimum
temperature threshold, to the nearest 5 degrees, will have to be entered
for each month and for each station. The scale range is set at 110
degrees. For example, if the user enters -25 for January, then the scale
will range from -25 to 85 for the station selected.

### 

### 

### Display Data Menu:

The sections under this menu option include:

1\. Sunrise/Sunset- displays the sunrise/sunset table for the current
year.

2\. Create Postscript Image - produces a Postscript image of the graph
in the display window. This image can be converted into a \"PNG\" format
using the \"Convert\" program in AWIPS.

3\. Print Graph- produces a color printout of the graph in the display
window.

### Precipitation and Temperature Menus:

The selections under these menu options will retrive significant
rainfall and temperature records based on user selectable thresholds
(Figure 6). For example, days when high temperature records exceed 100
degrees can be displayed. The data can be sorted chronologically,
ascending numerically, or descending numerically. Also the data can be
sorted based on values greater than or less than the user selectable
thresholds.

### Edit/Print F6 Data Menu:

The selections under this menu option include:

1\. Print Current F6 - produces a printout of the F6 for the month
displayed in the graphics window.

2\. Edit Current F6 - produces an editor window for editing F6 files
and/or other files as needed (Figure 4). The editor has an entry window
of the F6 file name, which is labeled at the top of the \"Display
Current F6\" window. Enter this file name then click on the load button.
The F6 will appear in the window and can be edited as necessary. There
is also a prompt at the bottom of the window if yearly totals are
affected by your edits. When all editing is completed click the save
button.

3\. Display Current F6 - produces a display of the F6/LCD for the month
displayed in the graphics window (Figure 5). The AWIPS database file
name is labeled at the top of this window. You will need the name of
this file for the editor.

4\. Create A New F6 -- allows the user to enter F6 data that is not in
the AWIPS database. This function can be used to build a complete
historical data base if desired.

5\. Send Clipboard to WEB - produces an html product and transmits it to
the WEB. This product contains addtional temperature departure, rainfall
departure, cooling and heating degree day departures, snow departure,
and yearly total information. It is modeled after the old clipboard
records kept here at DTW. Available on request/future release.

6\. Rerun Program - if updates to the database have been made then this
procedure will ingest it into the program and recalculate departure
information etc. as necessary. Available on request/future release.

### Update/Print Records Menu:

The selections under this menu option include:

1\. Update Monthly Summaries - this option is not activated with this
version of the program.

2\. View/Print Current Month - produces a display of the current
month\'s records (Figure 2). The records table includes the day of the
month, normal max temperatures, normal minimum temperatures, daily
average temperatures, record high temperatures and date set, lowest
record high temperatures and date set, highest record minimum
temperatures and date set, lowest minimum temperature records and date
set, the high and low daily average records and date set, and the
greatest precipitation for the date and year of occurrence. At the end
of the display is a monthly records summary.

At the top of the menu there are four buttons: Print Record, Create
HTML, Update Record, and Exit. The print option prints the table
displayed in the window. The create HTML option creates an HTML table
for the internet. The file created is in the following format:
records_CCC_MMM_inc,htm. (e.g. records_DTW_Oct_inc.htm). The HTML table
created is 530 pixels wide and thus can be displayed in the NWS
\"corporate image\" web frame. The Update Record option will load the
Update Record Window.

The Update Record Window will display any records set for the current
month, or the month in the graphic window (Figure 3). To update the
database with these new records select the \"Write To Database\" option.
the new records will be displayed in the display window and in the
graphics window once they are refreshed/reloaded.

If you desire to exit the current update process without writing to the
database select the \"Terminate Edit Session\" option.

3\. Update Top 20 Lists - this runs an auxillary program that maintains
a top 20 list for monthly, seasonal and yearly records. This program
also maintains records by decade and transmits all records to the WEB as
desired.

## 

## 3. DATA FILE STRUCTURE AND DATABASE MAINTENANCE 

There are two program files that drive the Climate Program. The main
display program \"climo.pl\" is about 85k in size. The second program
file. \"daily.csh\" retreives the LCDs from the AWIPS informix database
and is about 2k in size. The \"daily.csh\" program/script can be placed
in the AWIPS cron table so that data is automatically updated each day.
Here at DTX we find the best time to run this is around 6 AM, allowing
plenty of time for the LCDs to be updated in the informix database.

There are several files that must be generated in order for the program
to display the climate information for user selected sites. These files
can be created in part by using the SQL database program available on
AWIPS. The daily records files for each site (XXXday.dat) can be created
from the \"hmdb@ONLINE\" database using the \"day_climate_norm\" table.
The monthly records files can be created using the \"mon_climate_norm\"
table. The Station.dat file created by the climate program setup
function contains station and directory information for the database.

### Creating the database:

1\. Create the directory for the database files to be stored in (e.g.
/home/localapps/climo).

2\. Load the following files into the database directory: climo.pl
daily.csh, getdb.csh, cliform.pl, cites2.dat, Station.dat

3\. Log on to DS1 as awipsusr, navigate to your climate directory, and
type \"getdb.csh\" at the command prompt. The database flat files will
be created and formatted for the climate sites available in the
database. This will consist of 2 files for each site. A daily records
file (XXXday.dat) and a monthly records file (monsum.XXX). A station
information file (Station.dat) and climate site information file
(cites2.dat) will also be created. In addition the database for each
site will be populated with 12 months of LCD data that resides in the
AWIPS database. This will result in the availability of a daily
graphical display for each climate site for the last 12 months.

5\. The default directory in \"daily.csh\" will have to be changed to
your database directory. Edit line 19 \"set dir = \"/home/smith/test\"
to reflect you database directory. Place \"daily.csh\" in the AWIPS cron
table or you will have to run this daily to update you records.

6\. The climate program \"climo.pl\" can be run at this point. Auxiliary
data files can be added as necessary, such as the sunrise/sunset tables.

7\. Edit the file "cities.dat" . The information in this file will be
placed as a header in the graphics window (figure 10). There should be
an entry for each climate site in listed in the file "cites2.dat".

### Program Files:

climo.pl 150K Main executable program

daily.csh 2.9K Script that retrieves daily LCD data

getdb.csh 1.4K Script that builds initial database

cliform.pl 7.0K Program that formats initial database

### Data Files:

cites2.dat 0.1K Database station information

Station.dat 0.1K Database directory and station info

cities.dat 0.1K Header info for graph window

XXXday.dat 178K Daily records file (1 for each station)

monsum.XXX 1.6K Monthly records file (1 for each station)

ddyyyy.XXX Variable Daily station LCD data (1 for each station/month)

newrec.dat Variable Temporary file to hold new data record

scale.XXX Variable One temperature scale file for

each climate station

### Auxiliary Files:

sun.XXX 5K Sunrise/sunset info(user created or imported)

## 

## 4. CAUTIONS AND ADDITIONAL INFORMATION 

An auxiliary verion of the program has been created that automatically
produces \"PNG\" images on a daily basis and transmits the information
to the web server. This is available upon request.

Currently all the climatological data is placed into one directory. as
the climatological archives get larger a multiple directory structure
will have to be developed. Future plans include one directory for each
station and a sub directory for each month of the year.

For DTX oly: To manually create the PNG graphics for the web\...as
awipsusr go to the /home/smith/test directory. At the command line type
\"createPNG.csh MMM YYYY\", where MMM is the month (Oct) and YYYY is the
year.

To manually send HTMLs to the web type \"SendHTML.csh\" at the command
line. This will send the HTMLs then delete them form the directory. No
cleanup is necessary.

**Figure 1.**

![](media/image1.jpeg){width="5.99375in" height="5.804861111111111in"}

**Figure 2.**

![](media/image2.jpeg){width="5.990972222222222in"
height="5.590277777777778in"}

**Figure 3.**

![](media/image3.jpeg){width="5.990972222222222in"
height="5.590277777777778in"}

**Figure 4.**

![](media/image4.jpeg){width="5.998611111111111in"
height="6.1930555555555555in"}

**Figure 5.**

![](media/image5.jpeg){width="5.998611111111111in"
height="5.471527777777778in"}

**Figure 6.**

![](media/image6.jpeg){width="4.750694444444444in"
height="7.503472222222222in"}

**Figure 7.**

![](media/image7.jpeg){width="4.25in" height="5.21875in"}

**Figure 8.**

cites2.dat example:

10020:DTW:Detroit_Michigan

00000:DTX:White_Lake_Michigan

11180:FNT:Flint_Michigan

14210:MBS:Saginaw_Michigan

**Figure 9.**

Station.dat example:

home/smith/test,DTW,DTX,FNT,MBS

**Figure 10.**

cities.dat example:

DTW Detroit Michigan

DTX White Lake Michigan

FNT Flint Michigan

MBS Saginaw Michigan

Greg Smith WSFO DTX