The localConfig.py file can be used to override many of the definitions in serverConfig.py, but not all of them. 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.
The localConfig.py file is not used to
override
the map background definitions, refer to the methods
of modifying map definitions to do this.
The first lines of the localConfig.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 localConfig.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 localConfig.py file can be created in the CAVE Localization perspective by expanding GFE Server->Server Config Files, right clicking on serverConfig.py and selecting Override...
The format of the entry in localConfig.py is identical to that described in the weather element section of serverConfig.py.
The following example defines a relative humidity element with the
following
characteristics:
Element Name | "RH", which defines "RH" at the SFC, this element name may also be written "RH_SFC". |
Data Type | SCALAR |
Units | % |
Descriptive Name | Relative Humidity |
Maximum Possible Value | 100.0 |
Minimum Possible Value | 0.0 |
Precision | 0 |
Time Constraints | TC1 (as defined in either serverConfig.py or localConfig.py) |
Rate-Dependent Parm | NO |
rh = ("RH", SCALAR, "%", "Relative Humidity", 100.0, 0.0, 0, NO)
Simply defining the new weather element has no affect. You need to add it to the Fcst/Official databases or a new database for that weather element to truly be created.
The format of the weather element line is different for WEATHER and
DISCRETE-type weather elements. In particular, DISCRETE type
elements
require a overlapping/non-overlapping flag, as well as the discrete key
definitions. WEATHER and DISCRETE-type elements do not allow
specification
of a maximum possible value, minimum possible value, precision, or
rate-dependent
parm. Here is an example entry for a new discrete element called
SevereWx, which has two possible values, YES and NO. It is
non-overlapping,
since you can't have both YES and NO at the same time. We want an
auxiliary data field with a maximum of 2 characters in length:
Element Name | "SevereWx" |
Data Type | DISCRETE |
Units | cat |
Descriptive Name | Severe Weather |
Time Constraints | TC1 (as defined in either serverConfig.py or localConfig.py) |
Overlapping | NO |
DiscreteKey | YES, NO |
AuxDataFieldSize |
2 |
severewxKeys = [('NO', 'no'), ('YES', 'yes')]
severewx = ("SevereWx", DISCRETE, "cat", "Severe
Weather", NO, severewxKeys, 2)
parms = [([rh], TC1)]
If you choose to add multiple parms using the same time constraint, then the second line needs to be modified to be in this format:
parms = [([parm1, parm2, parm3], tc1)]
If you choose to add multiple parms using different time constraints, then the second line needs to be modified to be in this format:
parms = [([parm1], tc1), ([parm2], tc2), ([parm3, parm4], tc3)]
Note: There can only be one "parms =" line in the localConfig.py
file. If you use more than one, then only the last one will be
used.
Standard Model | Python Object Name |
Fcst, Official, Restore | parms |
NAM80 | parmsNAM80 |
NAM40 |
parmsNAM40 |
NAM12 |
parmsNAM12 |
RUC80 | parmsRUC80 |
GFS80 |
parmsGFS80 |
GFS40 |
parmsGFS40 |
GFS190 |
parmsGFS190 |
GFS75 |
parmsGFS75 |
LAPS | parmsLAPS |
gfsLR | parmsgfsLR |
GWW | parmsGWW |
MSAS | parmsMSAS |
GLERL | parmsGLERL |
AKWAVE | parmsAKWAVE |
WNAWAVE | parmsWNAWAVE |
MOS | parmsMOS |
RFCQPF |
parmsRFCQPF |
HPCQPF | parmsHPCQPF |
HPCGuide | parmsHPCGuide |
HPCDelta | parmsHPCDelta |
TPCtcm | parmsTCM |
SAT |
parmsSAT |
ISC |
parmsISC |
NAM95 |
parmsNAM95 |
MOSGuide |
parmsMOSGuide |
OPCTAFBE |
parmsOPCWavE |
OPCTAFBSW |
parmsOPCWavSW |
OPCTAFBNW |
parmsOPCWavNW |
Keep in mind that adding a new element to one of the standard model databases does not cause that field to be automatically generated by the initialization routines. You will have to also write a smart initialization algorithm for that database. Refer to the Smart Initialization Configuration and User's Guide for more details.
Here is an example of adding the relative humidity weather element with a three-hour time constraint to the NAM12 database:
rh = ("RH", SCALAR, "%", "Relative Humidity",
100.0, 0.0, 0, NO)
parmsNAM12 = [([rh], TC3)]
serverConfig.Temp = ("T", SCALAR, "F",
"Surface
Temperature",
120.0,
-30.0, 0, NO)
The entry above changes the definition of temperature to range from -30 to +120 degrees. The minimum possible value was changed. This will affect all databases that use the "Temp" weather element.
You can modify the association between an existing weather element and its time constraints (parm groups) through localConfig.py. If you simply want to change the time constraints associated with an existing weather element, refer to Modifying Existing Parm Groups.
Here is an example of adding a Local211 projection, which is similar to the Grid211 except that the 'North is up' has been changed from 95 degrees west longitude to 116 degrees west longitude:
Local211 = ('Local211', LAMBERT_CONFORMAL,
(-133.459, 12.190), (-49.385,
57.290),
(-116.0, 25.0), 25.0, 25.0, (1,
1), (93, 65), 0.0, 0.0, 0.0)
If you do create your own projection, you should strive to name it differently from the standard projections provided with the system. In the above example we created a Local211 projection and named it 'Local211' in the first argument.
Adding a new projection does no good unless you use it in a new or modified site definition. Therefore if you add a new projection for your site, you also will want to update the site definition (grid size, location, and projection) information.
For example, changing Boise from Grid211 to the Local211 projection would require the following lines in localConfig.py.
from serverConfig import *
import serverConfig
Local211 = ('Local211', LAMBERT_CONFORMAL,
(-133.459, 12.190), (-49.385,
57.290),
(-116.0, 25.0), 25.0, 25.0, (1,
1), (93, 65), 0.0, 0.0, 0.0)
SITES['BOI'] = ([45, 45], (25.00, 34.00), (11.0, 11.0), 'MST7MDT',
Local211))
Note that when changing a projection, you will also be changing the AWIPS world coordinate systems as defined. This can result in a distorted map background.
The following example modifies a existing site's definition to the
following
characteristics:
Site Name | ABQ |
Grid Size | x=70, y=70 |
Grid Origin in AWIPS world coordinates | x=36.25, y=22.25 |
Grid Extent in AWIPS world coordinates | x=8.5 y=8.5 |
Time Zone | MST7MDT |
Projection | Grid211 |
Office Type |
wfo |
SITES['ABQ'] = ([70, 70], (36.25, 22.25), (8.5, 8.5), 'MST7MDT',
Grid211, 'wfo')
If your modified site is using a new or modified projection, then be
sure to define the new or modified projection BEFORE you redefine the
site's
characteristics.
approx resolution = projectionResolution * (extent / (grid size - 1))
Solving for your grid size results in the following equation; enter your desired resolution:
grid size = (projectionResolution * extent / desiredResolution) + 1
The resulting grid size defines the number of grid cells in each direction for the given resolution. For example, if you were on the Grid211 projection with an AWIPS world coordinate extent of 9.0, and would like a resolution of approximately 2.5 kilometers, the approximate grid size you would use would be:
grid size = 80 * 9.0 / 5.0 + 1
grid size = 145
Therefore an example entry would change from this:
SITES['AAA'] = ([145, 145], (23.00, 22.00), (9.0, 9.0), 'MST7MDT', Grid211, 'wfo')
to this:
SITES['AAA'] = ([289, 289], (23.00, 22.00), (9.0, 9.0), 'MST7MDT', Grid211, 'wfo')
You can get different resolutions in the x and y direction which is
generally not recommended. To avoid this, make sure that the
ratio
of extent and grid size are identical.
AWIPS Projection | Nominal Resolution (km) |
Grid211 | 80 |
Grid212 | 40 |
Grid214 | 47 |
Grid210 | 80 |
Grid208 | 80 |
Grid215 | 20 |
The following line adds a new time constraint with the name of TC8, that starts at 0200z, repeats every eight hours, and has a duration of four hours. The second line adds a new time constraint with the name of LT9 that starts at 900am local time, repeats every 24 hours, and has a duration of 3 hours:
TC8 = (2*HOUR, 8*HOUR, 4*HOUR)
LT9 = localTC(9*HOUR, 24*HOUR, 3*HOUR, 0)
Simply adding a new time constraint by itself provides no benefit, unless you also define new parm groupings and a database. Any new time constraints to be used with new weather elements need to be defined before the definition is used.
serverConfig.MaxTTC = localTC(5*HOUR, 24*HOUR, 15*HOUR, 0)
Modifying the TC6 time constraint to have grids every 6 hours, but with grid lengths of 2 hours (2 hour grid, 4 hour gap) is accomplished by:
serverConfig.TC6 = (0, 6 * HOUR,
3*HOUR)
Modifying an existing time constraint can have far-reaching effects. Every subsequent use of this time constraint in serverConfig.py (and localConfig.py) will use this new definition. This can affect all of the model time constraints for all of the models. Be sure you know what you are doing! It is much better to simply create a new tme constraint and use it.
If you were adding a new database with the following characterstics:
Model Name | Climo |
Format (always GRID) | GRID |
Optional Type, simply used to filter viewable databases by the GFE through gfe configuration file | "" |
Singleton | YES |
Official | NO |
Number of Versions | 1 |
Grid Purge Age | 48 hours |
then you would use the following syntax to define this database attribute:
Climo = ('Climo', GRID, '', YES, NO, 1, 48)
However, if you are modifying an already defined database, then be sure to prefix your entry with serverConfig. For example, to modify the NAM12 database to retain 4 versions, the entry in localConfig.py will be:
serverConfig.NAM12 = ('NAM12', GRID, '', NO, NO, 4, 0)
In this example, we have assumed to already add the definitions for the the following weather elements: NormalMax, NormalMin. We plan to use existing local time definitions for max and min temperature so we don't need to redefine or define new ones.
CLIMO_MODEL = [([NormalMax], MaxTTC), ([NormalMin], MinTTC)]
dbs = [(Climo, CLIMO_MODEL)]
If multiple local databases were required, the format of the entry would be:
dbs = [(dbattr1, dbParmGroup1), (dbattr2, dbParmGroup2)]
Modifying an existing parm group is accomplished by linking new or existing weather elements to new or existing time constraints. This is similar to the technique in Adding A New Weather Element.
To modify the existing parm group for the Fcst and Official databases, include a line similar to that below after all of the weather element definitions (and any new time constraint definitions). The line is in the standard parm grouping format, with the exception that the name of the parm group is "parm".This format consists of a list of new weather elements and their time constraint. The time constraint can be an existing one in the serverConfig.py, or a new one defined earlier in localConfig.py. Be sure that the name to the left of the entry is "parms".
parms = [([rh], TC1)]
If you choose to add multiple parms using the same time constraint, then the line needs to be modified to be in this format:
parms = [([parm1, parm2, parm3], tc1)]
If you choose to add multiple parms using different time constraints, then the second line needs to be modified to be in this format:
parms = [([parm1], tc1), ([parm2], tc2), ([parm3, parm4], tc3)]
For example, if you want the T, Td, Wind, Wx, and Sky parameters to all be 3 hours in length, with no gaps, you would use the existing TC3NG time constraint. If you wanted the MaxT and MinT parameters to be 18 hours in length instead of 12, then you would need to create two new time constraints. The lines that would be placed in localConfig.py would be:
MaxTTC18 = localTC(4*HOUR, 24*HOUR, 18*HOUR, 0)
MinTTC18 = localTC(16*HOUR, 24*HOUR, 18*HOUR, 0)
parms = [([T, Td, Wind, Wx, Sky], TC3NG), ([MaxT], MaxTTC18),
([MinT],
MinTTC18)]
Note: There can only be one "parms =" line in the localConfig.py file. If you use more than one, then only the last one will be used.
Likewise, you can modify existing parm groupings for the models through localConfig.py. Instead of the "parms =" statement, you need to use the correct statement for the model. Refer to the table under Adding a New Weather Element for the proper syntax for the parm groupings for the models.
For example, if you wanted to modify the RUC80 T (temperature) and Td (dew point) time constraint to TC1, then you would do the following.
parmsRUC80 = [([T,Td], TC1)]
serverConfig.D2DMODELS = [('directory1', 'model')]
This definition will completely override the one in serverConfig.py so you will probably want to include those original definitions.
Here is an example of adding an SREF model on projection SREF12:
serverConfig.D2DMODELS = [('SREF212', 'SREF')]
Note that overridding the complete D2DMODELS is not recommended, since you will miss baseline updates with each release. Instead, you should use the append feature to simply add a new entry without modifying existing entries as:
serverConfig.D2DDIRS.append(('CONUS212', 'NAM20'))
Note that GFE simply cannot see and intrepret every type of hdf5 file in existance. Even if the hdf5 files are D2D-displayable, there may be some missing information in the files that make GFE ignore the file. Refer to the EDEX hdf5 format requirements document for more details.
serverConfig.SATDATA = [('directory1', 'weather element name 1'), ('directory2', 'weather element names 2')]
This definition will completely override the one in serverConfig.py so you will probably want to include those original definitions.
Here is an example of redefining the complete list of SATDATA; this
technique is not the best, since you will miss updates to serverConfig
and is not recommended:
serverConfig.SATDATA =
[("NESDIS/GOES-13(N)/East CONUS/Imager Visible", "visibleWest"),
("NESDIS/GOES-13(N)/East CONUS/Imager 6.7-6.5 micron IR (WV)", "waterVaporEast")]
You can also use the append feature to simply add a new entry without modifying existing entries as:
serverConfig.SATDATA.append(("NESDIS/GOES-13(N)/East CONUS/Imager 3.9 micron IR", "ir39East"))
Note that GFE simply cannot see and intrepret every type of satellite hdf5 file in existance. Even if the satellite hdf5 files are D2D-displayable, there may be some missing information in the files that make GFE ignore the file. Refer to the EDEX satellite hdf5 format requirements document for more details.
serverConfig.D2DDBVERSIONS = {
"modelname" : numberOfVersions,
"modelname2": numberOfVersions2
}
For example, to override the number of available NAM12 versions, which is called NAM12 on the D2D, and to set the available versions to 3, the following syntax is used:
serverConfig.D2DDBVERSIONS = {
"NAM12" : 3
}
The above will completely overwrite all of the definitions of D2DDBVERSIONS in serverConfig.py, which may not be what you have intended. The preferred way to make a modification is by individual items. For example, in order to just affect the NAM12, you could do this:
serverConfig.D2DDBVERSIONS["NAM12"] = 3
serverConfig.INITMODULES = {
moduleName : ["d2dmodelname",
"d2dmodelname"],
modulename :
["d2dmodelname"]
}
An example is shown in the following example, where the NAM initialization (D2D modelname NAM12) is now going to be controlled by module name MyNAM.
serverConfig.INITMODULES = {
"NAM40" : ["NAM40", "NAM20"],
"RUC80" : ["RUC80"],
"GFS40" : ["GFS40"],
"MyNAM" : ["NAM12"],
"gfsLR" : ["gfsLR"]
}
There are alternate ways of adding an entry, modifying an entry, or
deleting an entry.
The method of completely redefining INITMODULES as shown above is not
recommended.
serverConfig.INITMODULES["newModuleName" = ["d2dmodel", "anotherd2dmodel"]
Example of adding a new initialization module for LAPS, which we assume that a user has created a LAPS.py and placed it into /awips2/edex/data/utility/edex_static/site/SITE_ID/smartinit:
serverConfig.INITMODULES["LAPS] = ["LAPS"]
serverConfig.INITMODULES["MyNAM"] = ["NAM12"]
del serverConfig.INITMODULES["NAM12"]
del serverConfig.INITMODULES[moduleName]
Example of deleting the RUC is:
del serverConfig.INITMODULES["RUC"]
serverConfig.INITSKIPS = {
modelname : [skiptime1,
skiptime2,
skiptime3],
modelname : [skiptime1,
skiptime2],
}
Note that unlike the INITMODULES, the key in this dictionary is the modelname, and not the module name. An example is shown in the following example, where the RUC80 initialization is skipped except for every 3 hours, and the NAM40/NAM20 run is skipped for the 00z run:
serverConfig.INITSKIPS = {
"NAM40" : [0],
"NAM20" : [0],
"RUC80" :
[1,2,4,5,7,8,10,11,13,14,16,17,19,20,22,23],
}
There are alternate ways of adding an entry, modifying an entry, or
deleting an entry which are similar to that described above in the
INITMODULES
section which should be used.
serverConfig.LOG_FILE_PURGE_AFTER = 6
serverConfig.ExtraWEPrecision.append('parmname')
serverConfig.ExtraWEPrecision.append(('parmname', extraPrec))
To redefine the entire list, use this format:
serverConfig.ExtraWEPrecision = ['parmname1', 'parmname2', 'parmname3', ...]
serverConfig.ExtraWEPrecision = [('parmname1', exPrec1), 'parmname2', ('parmname3', exPrec3), ...]
The forms of 'parmname' and ('parmname', extraPrecAmount) may be
contained
in the same statement.
To add a new model entry:
serverConfig.D2DAccumulativeElements["modelName"] = ["elem1", "elem2", "elem3"]
To remove an existing model entry:
del serverConfig.D2DAccumulativeElements["modelName"]
To modify an existing entry:
serverConfig.D2DAccumulativeElements["modelName"] = ["elem1", "elem2", "elem3"]
To redefine the entire dictionary:
serverConfig.D2DAccumulativeElements= {
"GFS40": ["tp", "cp"],
"NAM80": ["tp", "cp"],
"RUC80": ["tp", "cp"],
"NAM40": ["tp", "cp"],
"NAM20": ["tp", "cp"],
"MSAS": ["tp", "cp"],
"LAPS": ["pc"],
"HPCQPF": ["tpHPC"],
"HPCdelta": ["pop"],
"NAM12": ["tp", "cp"],
}