Environment Files

The environment file mechanism is a way of bundling together many preference assignments and passing them to a program as a block. Environment files are ASCII text files with a simple syntax for making assignments. Generally, each line of an environment file constitutes an assignment to one preference. The assignment syntax for environment files is listed in the following table.

Table 13: Assignment Syntax for Environment Files

Type Syntax Example
integer <attr_name>: <int_value> size: 345
double <attr_name>: <double_value> mean_anomaly: 214.6
string <attr_name>: <string_value> orb_name: statkeep
site_name: "QTH"
boolean <attr_name>: <boolean_value> verbose: OFF
verbose: TRUE

In environment files, any amount of white space can occur between the preference name, the colon separator, and the preference value. In fact, assignments can spread out onto multiple lines. Comments may also appear in the file, using the shell script standard of starting a comment with a pound-sign ("#" anywhere on a line with or without assignments).

An environment file excerpt with comments is shown in the following figure.

Figure 9: Environment File Example

orb_name:       low_earth
elem_type:      osc

sm_axis:        6700.0
eccen:          0.02
inclin:         30

start_date:     1989.01.01
start_time:     0.0.0.0
stop_date:      1989.01.01
stop_time:      12.0.0.0

time_step:      60.0

moon_effects:   on
sun_effects:    on
srp_effects:    off     # this is off for speed
drag_effects:   on

The syntax for assigning a sequence of values to list preferences using an environment file requires delimiters to separate individual values; the delimiter character is the comma (","). An example of a string list preference that is being assigned via an environment file is shown below; in this case the ef preference will be assigned three strings ("base_orb_defs", "low_earth_defs", and "options").

ef: base_orb_defs, low_earth_defs, options

Preference names that contain embedded spaces must be enclosed in quotes when used in an environment file:

"HLA Federate Name" : OPNET

Environment files can be created using a text editor. The file names must include a .ef file type suffix appended to them to be recognized as environment files:

polar.ef
equatorial.ef

To be accessible, environment files must be placed in one of the model directories referenced by the mod_dirs preference. The passing of an environment file to a program can only occur through the use of the flag -ef; the environment file type suffix should not be included in the following argument.

op_vuorb -ef polar

Note: A product-specific environment file (modeler.ef) is located in the <reldir>/sys/configs/global_prefs directory. Typically, you won't need to change this environment file.