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
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.
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.
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.
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 |
serverConfig.visibilities = ['<NoVis>', '0', '1/4', '1/2',
'3/4',
'1', '11/2',
'2', '21/2', '3', '4', '5', '6', 'P6']
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.
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.
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.
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']