Smart Script Class Library

The Smart Script Class has many library methods that are available to Smart Tools and Procedures. Complete documentation is within the class itself (viewable from the Edit Action Dialog Utilities Window) and has been duplicated here.

Contents

General Arguments
Grid Access Methods
Sounding Methods
Conversion Methods
Error Handling
Procedure Methods
Calling Smart Tools and Procedures
Creating On-the-Fly Grids
Utilities
Numeric Library Methods
Python Object Methods


General Arguments

The following arguments are used throughout the SmartScript Library methods.

self: When you call a method, use the "self" prefix (see examples below)

model: There are various ways to specify the database model from which you want the values:
   -- Simply "Fcst" or "Official" OR
   -- siteID_type_model_modeltime
     where the "type" is an empty string for Standard GFE data
     and is "D2D" for D2D data.
   Examples:
     BOU__NAM_Mar2912 :gets March 29 12Z NAM run created by GFE.
     BOU_D2D_ETA_Mar2912 :gets March 29 12Z original NAM run from D2D.
   If you omit the "modeltime", the most recent model run will
   be selected. For example:
     BOU__NAM : gets the most recent NAM run created by GFE.
     BOU_D2D_ETA : gets the most recent original ETA run from D2D.
   -- the result of soliciting a model from the user using the "model" or "D2D_model" type of VariableList entry. (See examples above.)
   -- you may also use a DatabaseID (see getDatabase, below)
   -- simple string with no special characters (this will be assumed to be a model created "on-the-fly"

element: The element name in quotes: e.g. "QPF", "rh", "tp"

level: The level in quotes: e.g. "SFC", "MB350", "BL030"

x, y: integer coordinates

timeRange: Must be a special time range object such as that passed in the argument list as GridTimeRange

mode: specifies how to handle the situation if multiple grids are found within the given time range:
   "TimeWtAverage": return time-weighted Average value
   "Average" : return Average value
   "Max" : return Max value
   "Min" : return Min value
   "Sum" : return Summed value
   "First" : return value from grid with earliest time range
   "List" : return list of values

noDataError: If 1, and there is no data, the Smart Tool will abort. Otherwise, return None. None is a special variable in Python which can be tested as follows:
   PoP = self.getValue("Fcst", "PoP", "SFC", x,y, GridTimeRange, noDataError=0)
   if PoP == None:
   print "No data found for PoP"

mostRecentModel: Applies only to model data. Will get the most recent model and ignore any times (if included) in the model argument. (Note that if a time is not included in the model argument, you will automatically get the most recent model no matter how this argument is set.)