Creating On-the-Fly Grids


createGrid
deleteGrid
highlightGrids
makeHeadlineGrid

createGrid

    def createGrid(self, model, element, elementType, numericGrid, timeRange,
                   descriptiveName=None, timeConstraints=None,
                   precision=None, minAllowedValue=None,
                   maxAllowedValue=None, units=None, rateParm=0,
                   discreteKeys=None, discreteOverlap=None,
                   discreteAuxDataLength=None, defaultColorTable=None):
                                                                               
                                                                               
        # Creates a grid for the given model and element.
        # If the model and element do not already exist, creates them on-the-fly       
        # The descriptiveName, timeConstraints, precision, minAllowedValue,
        # maxAllowedValue, units, rateParm, discreteKeys, discreteOverlap,
        # and discreteAuxDataLength only need to be specified for the first grid being created.  These
        # values are ignored for subsequent calls to createGrid() for
        # the same weather element.

        # For new parms, the defaultColorTable is the one to be used for
        # display. If not specified and not in the gfe configuration file,
        # a DEFAULT color table will be used.

        # DISCRETE elements require a definition for discreteKeys and
        # discreteOverlap. For DISCRETE, the precision, minAllowedValue,
        # maxAllowedValue, and rateParm are ignored.
                                                                                                                                 
        # Note that this works for numeric grids only.
        # The arguments exampleModel, exampleElement, and exampleLevel can be
        # supplied so that the new element will have the same characteristics
        # (units, precision, etc.) as the example element.
        #
        # model -- If you are creating an "on-the-fly" element (i.e. not
        #          in the server), this should be a simple string with
        #          with no special characters.  The site ID and other
        #          information will be added for you.
        #          If you are creating a grid for a model that exists
        #          in the server, follow the guidelines for the model
        #          argument described for the "getValue" command.
        # element -- This should be a simple string with no special
        #          characters.
        # elementType -- "SCALAR", "VECTOR", "WEATHER", or "DISCRETE"
        # numericGrid -- a numpy grid
        # timeRange -- valid time range for the grid.  You may want
        #          to use the "createTimeRange" command
        #
        # The descriptiveName, timeConstraints, precision, minAllowedValue,
        # precision, minAllowedValue, maxAllowedValue, and units can be
        # used to define the GridParmInfo needed. Note that timeConstraints
        # is not the Java version, but a (startSec, repeatSec, durSec).
        #
        # Example:
        #    self.createGrid("ISCDisc", WEname+"Disc", "SCALAR", maxDisc,
        #                   GridTimeRange, descriptiveName=WEname+"Disc")
        #

 

deleteGrid

def deleteGrid(self, model, element, level, timeRange):
      # Deletes any grids for the given model and element
      # completely contained in the given timeRange.
      # If the model and element do not exist or if there are no existing grids,
      # no action is taken.

highlightGrids

def highlightGrids(self, model, element, level, timeRange, color, on=1):
      # Highlight the grids in the given time range using designated
      # color. If "on" is 0, turn off the highlight.

makeHeadlineGrid

    def makeHeadlineGrid(self, headlineTable, fcstGrid, headlineGrid = None):
        # This method defines a headline grid based on the specified data.
        # The headlineTable parameter must be a list of tuples each containing
        # the threshold for each headline category and headline label
        # Example:
        #     headlineTable =[(15.0, 'SmCrftHSADV'),
        #                     (21.0, 'SmCrftADV'),
        #                     (34.0, 'GaleWRN'),
        #                     (47.0, 'StormWRN'),
        #                     (67.0, 'HurcnFrcWindWRN'),
        #                     ]
        # "fsctGrid" is the grid that defines what headline category should
        # be assigned. "headlineGrid" is the grid you wish to combine with
        # the calculated grid.  This forces a combine even if the GFE is not
        # in combine mode.  Omitting "headlineGrid" will cause the calculated
        # grid to replace whatever is in the GFE, no matter what the GFE's
        # combine mode. Note that a side effect of omitting the headline grid
        # is that the GFE will end up in replace mode after the tool completes.