localWxConfig.py - Local Server Database Configuration (Weather Definition)

December 30, 2011


Table of Contents

Overview
Adding Your Own localWxConfig.py File
Testing Your localWxConfig.py File
What can you control from your custom localWxConfig.py file?
Changing Visibilities
Changing Coverages and Probabilities
Changing Intensities
Changing Optional Attributes
Changing Weather Type Definition
 


Overview

The localWxConfig.py file is one of several configuration files for GFE. The localWxConfig file is optional, and is not provided with the install or release. It is added by the field site to override certain features of the GFE database configuration that are defined in the serverConfig.py file. You should NEVER change the original serverConfig.py since your changes will be overwritten with the next upgrade. See the server configuration overview for information on how to make changes that are supported to the server.

The localWxConfig.py file can be used to override the weather definitions in serverConfig.py. This document will describe what you can, and what you cannot override. If you need to override an element that is not supported by localConfig.py or localWxConfig.py, then refer to the server configuration overview for details.

Note: Changing weather definitions can cause problems when sending these grids to other sites via Intersite Coordination. If another site receives grids that do not contain valid Weather Definitions at that site, the grid will be rejected.


Adding Your Own localWxConfig.py File

If you want to make changes to the server database weather definitions, then you will want to add your own localWxConfig.py file. Refer to the server configuration overview file location section for details on where the localWxConfig.py file should be located.

The first lines of the localWxConfig.py must have the following format. Failure to do so will not let you refer to any of the definitions in serverConfig.py:

from serverConfig import *
import serverConfig

The syntax appearing in localWxConfig.py varies depending whether you are adding new definitions, or changing existing definitions. Typically when changing existing definitions you will need to prefix the serverConfig to the name of the variable. For example,

var = (a,b,c,d) refers to a local copy of this definition and doesn't override the definition in serverConfig.py

serverConfig.var = (a,b,c,d) refers to the variable in the serverConfig and overrides it.

The localWxConfig.py file is created through your favorite text editor.

Example localWxConfig.py file

Note that the format of localWxConfig is difficult, due to the fact that the weather definition in serverConfig.py is a composite of many different objects.  This makes it more difficult to override or redefine fields.


Testing Your Own localWxConfig.py File

The recommended way to test your localWxConfig.py file is to start EDEX while running a tail command on the /awips2/edex/logs/edex-request-date.log. If no exceptions result from the changes, you should be fine to proceed into GFE for further testing.


What can you control from your custom localWxConfig.py file?

The following table describes what can be done using a custom localWxConfig.py file. If the override capability is marked as "NO" and you still need the modification, you will need to review methods of modifying database configurations for alternative choices.
Item localWxConfig.py override Link to serverConfig info
Visibilities YES Possible Visibilities
Coverages and Probabilities YES Possible Coverages and Probabilities
Possible Intensities YES Possible Intensities
Optional Attributes YES Optional Attributes
Weather Type Definition YES Weather Type Definitions


Changing Visibilities

Visibilities are very easy to change.  Basically you redefine the set of visibilities and prefix the entry with serverConfig.  For example, the following line changes the set of possible visibilities to values without the default "SM":

serverConfig.visibilities = ['<NoVis>', '0', '1/4', '1/2', '3/4', '1', '11/2',
                '2', '21/2', '3', '4', '5', '6', 'P6']


Changing Coverages and Probabilities

If you are adding a new coverage or probability, the syntax is straight forward.  In order to use the new coverage or probability, you will need to also provide a new weather type definition.  Here is an example of adding a new coverage called "Sparse":

SPARSE = ('Sparse', 'Sparse')

Note there is not a serverConfig. in front of the command.  That is because you are not overridding an existing definition.

If you want to change an existing definition, the syntax is basically the same as above.  You will not need to put serverConfig. in front of it, but you will need to redefine all of the weather types completely.  Here is an example of modifying isolated coverage to use a different symbol:

ISOD = ('Isod', 'Isolated')

This statement by itself will not do anything.  You will need to use the new definition later on in the file.

In serverConfig.py, there are convenient groupings, such as COV, that group several coverages and probabilities together.  If you want to change the definition of those, or you want to change the definition of a coverage or probability inside of those, then you have to completely redefine the individual coverage (as shown above) and redefine the grouping.  In this case, we want to redefine the COV to contain SPARSE and our new definition of ISOD.

COV = [ISOD, SCT, NUM, WIDE, SPARSE]

Note that ISOD is referring to the localWxConfig's definition of ISOD, and not the server config's definition.  Also note that COV is a modified local copy of the server's COV definition.  To use these definitions, you will have to refer to them later in the file.


Changing Intensities

If you are adding a new intensity, the syntax is straight forward.  In order to use the new intensity, you will need to also provide a new weather type definition.  Here is an example of adding a new intensity called "Super Heavy":

SUPERHEAVY = ('+++', "Super Heavy")

Note there is not a serverConfig. in front of the command.  That is because you are not overridding an existing definition.

If you want to change an existing definition, the syntax is basically the same as above.  You will not need to put serverConfig. in front of it, but you will need to redefine all of the weather types completely.  Here is an example of modifying isolated coverage to use a different symbol:

INTEN_MOD = ('mod', 'Moderate')

This statement by itself will not do anything.  You will need to use the new definition later on in the file.

In serverConfig.py, there are convenient groupings, such as PCPINTEN, that group several intensities together.  If you want to change the definition of those, or you want to change the definition of a intensity inside of those, then you have to completely redefine the individual intensity (as shown above) and redefine the grouping.  In this case, we want to redefine the PCPINTEN to contain SUPERHEAVY and our new definition of INTEN_MOD.

PCPINTEN = [INTEN_VERYLIGHT, INTEN_LIGHT, INTEN_MOD, INTEN_HEAVY, SUPERHEAVY]

Note that INTEN_MOD is referring to the localWxConfig's definition of INTEN_MOD, and not the server config's definition, since serverConfig. was not placed in front of it.  Also note that PCPINTEN is a modified local copy of the server's PCPINTEN definition.  To use these definitions, you will have to refer to them later in the file.


Changing Optional Attributes

If you are adding a new optional attribute, the syntax is straight forward.  In order to use the new attribute, you will need to also provide a new weather type definition.  Here is an example of adding a new intensity called "Lousy":

LOUSY = ('Lsy', 'Lousy')

Note there is not a serverConfig. in front of the command.  That is because you are not overridding an existing definition.

If you want to change an existing definition, the syntax is basically the same as above.  You will not need to put serverConfig. in front of it, but you will need to redefine all of the weather types completely.  Here is an example of modifying Frequent Lightning to use a different symbol:

FQTLTG = ('FqLt', 'Frequent Lightning')

This statement by itself will not do anything.  You will need to use the new definition later on in the file.


Changing Weather Type Definition

This is the section where all of the type definitions come together.  Based on what you enter in this section, you can remove, change, or add new weather type definitions.  You will have to completely define all of the weather types you need for the GFE in this section.  Do not try to simply append or remove entries from the existing list.

The format of the entries are:
TypeSymbol = ('Symbol', 'Description', [coverages], [intensities], [optional attributes])

Remember to refer to symbols without serverConfig. in front of it to refer to the modified or added values in your localWxConfig file.  You can also refer to unchanged symbols from serverConfig in the same manner.  Normally you should not need to place serverConfig. in front of any entry.  The rule is if you are redefining a coverage/probability, intensity, optional attribute, or grouping of these, then you will use that symbol name in the weather type definition.

The next step is to define each weather type.  For example, we want to keep the <NoWx> definition. Since we have not made any modifications to the possible coverages, intensities, attributes from what was in serverConfig.py, we can simply refer to it with NOWX.  We also want to allow just RAIN and SNOW.  These will need to be redefined to use our FQTLTG, LOUSY, PCPINTEN, and modified COV values.  Here are the entries:

RAIN = ('R', 'Rain', COV, PCPINTEN, [FQTLTG])
SNOW = ('S', 'Snow', [WIDE, SPARSE], [INTEN_LIGHT, INTEN_HEAVY], [LOUSY, OVRPASS])

Then tie it all together with the types command. Note that the "types =" must be exactly that in order for serverConfig.py to pick up your definitions:

types = [NOWX, RAIN, SNOW]

The result of the statements identified in this file is shown in the following table:
 
Weather Type Coverages Intentities Attributes
No Weather <NoCov> <NoInten> none
Rain Modified definition of Isolated with 'Isod', existing serverConfig definition of WSCT, SCT, NUM, WIDE, and new definition of SPARSE. Existing serverConfig definition of INTEN_VERYLIGHT, INTEN_LIGHT, modified definition of moderate ('mod'), serverConfig definition of INTEN_HEAVY, and new definition of SUPERHEAVY. Modified attribute of FQTLTG.
Snow Existing serverConfig definition of WIDE, new definition of SPARSE. Existing serverConfig definition of INTEN_LIGHT and INTEN_HEAVY. New definiton of LOUSY, existing serverConfig definition of OVRPASS.

In addition, the set of visibilities will be changed to: ['<NoVis>', '0', '1/4', '1/2', '3/4', '1', '11/2', '2', '21/2', '3', '4', '5', '6', 'P6']




Back To Top
Back To TOC