GFE/ifpIMAGE Configuration File
Product Generation Scripts

Product generation scripts are defined in this portion of the configuration file. These entries define the contents of the product generation menu that is available from the Products pull-down menu.   This area can be used for much more than the product generation programs.  It is basically a list of menu entry items and scripts to be executed.  There is a set of "known" keywords which are replaced by their appropriate value.  For example, {host} is replaced with the server host name.

It is expected that sites will override the product generation scripts using a local gfe configuration override.  Refer to the gfe configuration guide for details on how to override the gfe configuration file.  The standard supplied gfe configuration file contains examples of product generation, and sites will normally want to define entries specific to their site.

 
 
GFE Configuration Item
Applicable to GFE
Applicable to ifpIMAGE
Notes
Format YES NO
Automatic Variables YES NO
Dialogs YES NO
Named Variables YES NO
Radio and Check Button Variables YES NO
Edit Areas and Groups YES NO
Multiple Command Line Scripts YES NO
Examples YES NO
Product Generation Group Ordering YES NO


Format

Each script entry is a text string of the form: "<entry name>: " + "<command line script> & " where: <Entry Name> will appear in the Product Generation menu, <command line script> is the command line that will be submitted when the script is chosen.
 

Automatic Variables

The following variables can be used in scripts and the GFE will fill in the appropriate information before executing the script:
  • {host} - the database server hostname or IP address
  • {port} - the database server RPC port number
  • {site} - the site identifier, e.g., BOU
  • {productDB} - product database.  This is the official database if it exists. Otherwise it is the mutable (Fcst) database.
  • {SEstart} - start of the spatial editor time.  Note all times are in the format of yyyymmdd_hhmm.
  • {SEend} - always {SEstart} plus 1 second.
  • {SelectedStart} - start of the selected time range
  • {SelectedEnd} - end of the selected time range
  • {time} - current local time in the format of yyyymmdd_hhmm
  • {ztime} - current zulu time in the format of yyyymmdd_hhmm
  • {module: <module name>} - the correct path of the module will be substituted in the command line.  The module must have a .py extension.
  • {home} - is replaced with the top-level GFESuite directory path. It is important to use this variable rather than hard-coding values. The scripts may be run either locally or remotely, and the directory structure may differ.
  • {prddir} - is replaced with the GFESuite directory path to the products directory. It is important to use this variable rather than hard-coding values. The scripts may be run either locally or remotely, and the directory structure may differ.
  • Dialogs

    If the following variables are used in a script, a dialog will appear for the user to make selections from a simple GUI before the script is executed:
  • {parmsMutable} - list of weather elements in the Forecast database is displayed for selection
  • {parms} - list of weather elements is displayed for selection
  • {refsets} - list of named edit areas is displayed for selection
  • {maps} - list of known map identifiers is displayed for selection
  • {databases} - list of known databases is displayed for selection
  • {output file} - allows user to enter an output filename
  • {output directory} - allows user to enter an output directory name
  • {startTime} - allows the user to enter a starting time
  • {endTime} - allows the user to enter an ending time
  • Named Variables

    To have the user prompted for a named variable, use the following in your script:
    {entry: <name of variable>: <default value>}
    For example, to have the user prompted for "width" use:  {entry: width: 350} in your script.
     

    Radio and Check Button Variables

    To have the user prompted for a list of radiobutton variables, use:

    {entryButtons: <name of variable>: <list of values separated by commas>}
    {entryButtons: ReportType: GeneralGIF,CustomizedGIF}

    To have the user prompted for a list of checkbutton variables, use:

    {entryChecks: <name of variable>: <list of values separated by commas>}
    {entryChecks: EditAreas: Area1,Area2,Area3}
     

    Edit Areas and Groups

    If the name of the entryButtons or entryChecks is "EditAreas", the system will accept edit area OR edit area group names. The system will check for groups and will automatically expand them to the appropriate areas.

    {entryChecks: EditAreas: Group1,Group2,Area1,Area2,Area3}
    {entryButtons: EditAreas: Group1,Group2,Area1}
     

    Multiple Command Line Scripts

    Scripts with Multiple Command Lines are allowed. To string multiple command lines together, use the following format for your command line script:

    "csh -c (<command line 1>; <command line 2>; <command line 3>) &"


    Examples

    The following section is an excerpt from the gfe configuration file showing various combinations of product generation scripts.  Product Generation Scripts are executed via the Product Generation menu on the GFE. Please define TextProducts through the DefineTextProducts dialog (Product Generation Menu) within the GFE.

    Scripts = [
        "Png Images...:" +
        "ifpIMAGE -c {entry:ConfigFile:gfeConfig} -o " + GFESUITE_IMAGE + " &",

    ## to view the various ifpIMAGE option switches

        "Send Images to Website:" +
        "<your command line goes here to run your script",

        "General Ascii Grids...: " + "ifpAG -h {host} -r {port} -o " +
         GFESUITE_AG+ "/{time}.ag -d {productDB} &",

        "Customized Ascii Grids...:" +
        "ifpAG -h {host} -r {port} -o " + GFESUITE_AG + "/{time}.cag -d
        {productDB} " +
        "-p {parmsMutable} -s {SelectedStart} -e {SelectedEnd} & ",

        "Customized Grib...: " +
        "runIFPGrib -d {productDB} -o " + GFESUITE_GRIB +
        "/{entry: OutputFile: out.grib} " +
        "-w {parmsMutable} -s {SelectedStart} -e {SelectedEnd} & "]
     
     

    Product Generation Group Ordering

    To provide an order for the products generated , list an order preference in the list variable 'ProductList'.  Any products not listed in 'ProductList', will be listed at the bottom of the Product Generation menu in alphabetical order.

    ProductList = ["Png Images", "Ascii Grids", "YourProducts"]


    Back To TOC