153 lines
4.2 KiB
HTML
153 lines
4.2 KiB
HTML
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR"
|
|
content="Mozilla/4.78 [en] (X11; U; Linux 2.4.18-27.7.xsmp i686) [Netscape]">
|
|
<title>Smart Script Class Documentation</title>
|
|
</head>
|
|
<body bgcolor="#ffffff">
|
|
<h1>
|
|
Smart Script Class Library</h1>
|
|
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.
|
|
|
|
<h3>Contents</h3>
|
|
<a href="#Args">General Arguments</a>
|
|
<br>
|
|
<a href="SmartScriptClassGridAccess.html">Grid Access Methods</a>
|
|
<br>
|
|
|
|
<a href="SmartScriptClassSounding.html">Sounding Methods</a>
|
|
<br>
|
|
|
|
<a href="SmartScriptClassConversion.html">Conversion Methods</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassErrorHandling.html">Error Handling</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassProcedure.html">Procedure Methods</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassCalls.html">Calling Smart Tools and Procedures</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassOnTheFly.html">Creating On-the-Fly Grids</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassUtilities.html">Utilities</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassNumerics.html">Numeric Library Methods</a>
|
|
|
|
<br>
|
|
<a href="SmartScriptClassPythonObjectMethods.html">Python Object Methods</a>
|
|
<br>
|
|
<hr width="100%">
|
|
<br>
|
|
<h3><a name="Args"></a>General Arguments</h3>
|
|
The following arguments are used throughout the SmartScript Library
|
|
methods.
|
|
<p>self: When you call a method, use the "self" prefix (see examples
|
|
below)
|
|
</p>
|
|
<p>model: There are various ways to specify the database model from
|
|
which
|
|
you want the values:
|
|
<br>
|
|
-- Simply "Fcst" or "Official" OR
|
|
<br>
|
|
-- siteID_type_model_modeltime
|
|
<br>
|
|
where the "type" is an empty string for
|
|
Standard
|
|
GFE data
|
|
<br>
|
|
and is "D2D" for D2D data.
|
|
<br>
|
|
Examples:
|
|
<br>
|
|
BOU__NAM_Mar2912 :gets March 29 12Z NAM run
|
|
created by GFE.
|
|
<br>
|
|
BOU_D2D_ETA_Mar2912 :gets March 29 12Z
|
|
original
|
|
NAM run from D2D.
|
|
<br>
|
|
If you omit the "modeltime", the most recent model run
|
|
will
|
|
<br>
|
|
be selected. For example:
|
|
<br>
|
|
BOU__NAM : gets the most recent NAM run
|
|
created
|
|
by GFE.
|
|
<br>
|
|
BOU_D2D_ETA : gets the most recent original
|
|
ETA run from D2D.
|
|
<br>
|
|
-- the result of soliciting a model from the user using
|
|
the "model" or "D2D_model" type of VariableList entry. (See examples
|
|
above.)
|
|
<br>
|
|
-- you may also use a DatabaseID (see getDatabase, below)
|
|
<br>
|
|
-- simple string with no special characters (this will
|
|
be assumed to be a model created "on-the-fly"
|
|
</p>
|
|
<p>element: The element name in quotes: e.g. "QPF", "rh", "tp"
|
|
</p>
|
|
<p>level: The level in quotes: e.g. "SFC", "MB350", "BL030"
|
|
</p>
|
|
<p>x, y: integer coordinates
|
|
</p>
|
|
<p>timeRange: Must be a special time range object such as that passed
|
|
in
|
|
the argument list as GridTimeRange
|
|
</p>
|
|
<p>mode: specifies how to handle the situation if multiple grids are
|
|
found
|
|
within the given time range:
|
|
<br>
|
|
"TimeWtAverage": return time-weighted Average value
|
|
<br>
|
|
"Average" : return Average value
|
|
<br>
|
|
"Max" : return Max value
|
|
<br>
|
|
"Min" : return Min value
|
|
<br>
|
|
"Sum" : return Summed value
|
|
<br>
|
|
"First" : return value from grid with earliest time range
|
|
<br>
|
|
"List" : return list of values
|
|
</p>
|
|
<p>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:
|
|
<br>
|
|
PoP = self.getValue("Fcst", "PoP", "SFC", x,y,
|
|
GridTimeRange,
|
|
noDataError=0)
|
|
<br>
|
|
if PoP == None:
|
|
<br>
|
|
print "No data found for PoP"
|
|
</p>
|
|
<p>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.)
|
|
<br>
|
|
</p>
|
|
</body>
|
|
</html>
|