Sept. 24-27, 2002Smart Tools and Procedures1 Tracy Hansen.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Introduction to Macromedia Director 8.5 – Lingo
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
Manage Transfer Students. C3-TF Manage Transfer Students by School Student Registrar Description: –This function allows the School Student Registrar to;
Lab7: Introduction to Arduino
Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Tutorial 8: Developing an Excel Application
The Web Warrior Guide to Web Design Technologies
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Automating Tasks With Macros
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
JavaScript, Fourth Edition
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Use Watch folders to automatically add PDFs to Mendeley Desktop. When you place a document in a watched folder, it will be automatically added to Mendeley.
EdPlan Website: Default password: 2012txhouston Recovering Your Password 1. To re-activate a disabled.
A First Program Using C#
September 5, 2015 Office Setup. Lesson Overview: Office Setup  In this lesson we will cover:  Adding new offices to COM  Individual office setup 
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
Solutions Summit 2014 Discrepancy Processing & Resolution Terri Sullivan.
0 UMN 2011 ERP Terapan ABAP Introduction Session # 8.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
AQS Web Quick Reference Guide Changing Raw Data Values Using Maintenance 1. From Main Menu, click Maintenance, Sample Values, Raw Data 2. Enter monitor.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Introduction to SPSS Edward A. Greenberg, PhD
| | Tel: | | Computer Training & Personal Development Microsoft Office Publisher 2007 Expert.
CSC350: Learning Management Systems COMSATS Institute of Information Technology (Virtual Campus)
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Introduction to eziLink Training For the Ministry of Forests and Sustainable Resource Management.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Smart Initialization Mike Romberg. Sept , 2002Smart Initialization2 Lecture Smart Init: what, why, how? Configurability Structure of Smart Init.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
Exploring an Open Source Automation Framework Implementation.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Session Objectives • Login to PeopleSoft Test Framework(PTF)
Salt Suite User Guide (Copyright Salt ).
DireXions – Your Tool Box just got Bigger PxPlus Version Control System Using TortoiseSVN Presented by: Jane Raymond.
Press Esc to Exit ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in.
NCAR MDSS Functional Prototype Display System Preview – April 2002 Bill Mahoney National Center for Atmospheric Research Images shown are valid as of 15.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Intersite Coordination (ISC) Mark Mathewson. Sept 24-27, 2002Intersite Coordination2 Overview Motivation for ISC How ISC Works GFESuite ISC Capabilities.
Sept , 2002Text Product Infrastructure1 GFESuite Text Products GFESuite Text Products Tracy Hansen.
1 MIS309 Database Systems Introduction to Microsoft Access.
RPMS - EHR v1.1 Techie Class Really Powerful at Measuring Stuff.
Graphical Enablement In this presentation… –What is graphical enablement? –Introduction to newlook dialogs and tools used to graphical enable System i.
Chapter Three The UNIX Editors.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
PestPac Software. Leads The Leads Module allows you to track all of your pending sales for your company from the first contact to the close. By the end.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
Sept , 2002ifpIMAGE1 ifpIMAGE Deb Miller. Sept , 2002ifpIMAGE2 Agenda Introduction Configuration File Execution Command Line Options Gotchas.
Easy WP Guide V2.6 for WordPress 3.8. easywpguide.com Adding Tags within your Post Adding Tags whilst editing your Post, will automatically assign those.
1 EPIB 698C Lecture 1 Instructor: Raul Cruz-Cano
1 © 2004 Cisco Systems, Inc. All rights reserved. Session Number Presentation_ID Cisco Technical Support Seminar Using the Cisco Technical Support Website.
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
LINGO TUTORIAL.
BI Share Quick reference guide.
Administrator Training
Services Course 9/9/2018 3:37 PM Services Course Windows Live SkyDrive Participant Guide © 2008 Microsoft Corporation. All rights reserved.
Scripts & Functions Scripts and functions are contained in .m-files
Mu Editor – New User Cheat Sheet – CircuitPython Mode
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Mu Editor – New User Cheat Sheet – CircuitPython Mode
Selenium IDE Installation and Use.
Presentation transcript:

Sept , 2002Smart Tools and Procedures1 Tracy Hansen

Sept , 2002Smart Tools and Procedures2 Overview Part 1 Part 1 What are Smart Tools? What are Smart Tools? Executing Smart Tools Executing Smart Tools Creating Smart Tools Creating Smart Tools Part 2 Part 2 Creating Smart Tools (cont) Creating Smart Tools (cont) SmartScript Library Methods SmartScript Library Methods Part 3 Part 3 Procedures Procedures Utilities Utilities

Sept , 2002Smart Tools and Procedures3 What are Smart Tools? Meteorological Algorithms Numerical Python Smart Tool Numerical Models ObservationsTopography Forecast Grids "On-the-fly" Elements Modify User Input

Sept , 2002Smart Tools and Procedures4 Executing Smart Tools Make Weather Element Editable Make Weather Element Editable Set up Selection Time Range Set up Selection Time Range Set up Edit Area Set up Edit Area Execute Tool from Edit Action Dialog or Spatial Editor MB3 Popup Menu Execute Tool from Edit Action Dialog or Spatial Editor MB3 Popup Menu

Sept , 2002Smart Tools and Procedures5 Creating Smart Tools From Edit Action Dialog MB3 Popup: From Edit Action Dialog MB3 Popup: Info... Info... Cut, Copy, Paste Cut, Copy, Paste Modify... or View... Modify... or View... New... New... Rename... Rename... Delete... Delete...

Sept , 2002Smart Tools and Procedures6 ToolType = "numeric" from Numeric import * Creating Smart Tools WeatherElementEdited = "T" import SmartScript class Tool (SmartScript.SmartScript): def __init__(self, dbss): SmartScript.SmartScript__init__(se lf,dbss) def execute(self, T): T = T + 5 return T

Sept , 2002Smart Tools and Procedures7 Creating Smart Tools Tool Arguments Weather Elements Weather Elements T, Wx, variableElement, MaxT_SFC_BOU_Eta T, Wx, variableElement, MaxT_SFC_BOU_Eta Topography Topography Topo Topo MaxGrid, MinGrid, SumGrid MaxGrid, MinGrid, SumGrid T_MaxGrid, Td_SumGrid T_MaxGrid, Td_SumGrid GridTimeRange GridTimeRange GridInfo, GridHistory GridInfo, GridHistory Wx_GridInfo, T_GridHistory Wx_GridInfo, T_GridHistory

Sept , 2002Smart Tools and Procedures8 Creating Smart Tools Conditionals WeatherElementEdited = "HeatIndex" def execute(self, HeatIndex, T): def execute(self, HeatIndex, T): HeatIndex = where(less(T,70), T, HeatIndex = where(less(T,70), T, where(less(T,85), HeatIndex + 10, where(less(T,85), HeatIndex + 10, HeatIndex)) HeatIndex)) return HeatIndex return HeatIndex

Sept , 2002Smart Tools and Procedures9 Creating Smart Tools Variable Lists Allow for run-time user input VariableList = [ ("Edit Coverage or Uncertainty", "Coverage", "radio", ("Edit Coverage or Uncertainty", "Coverage", "radio", ["Coverage","Uncertainty"]), ["Coverage","Uncertainty"]), ("Thunder Y/N", "Y", "radio", ["Y","N"]), ("Thunder Y/N", "Y", "radio", ["Y","N"]), ]

Sept , 2002Smart Tools and Procedures10 Creating Smart Tools Variable Lists numeric, alphaNumeric numeric, alphaNumeric radio, check radio, check scale scale model, D2D_model model, D2D_model label label

Sept , 2002Smart Tools and Procedures11 Creating Smart Tools Variable Lists varDict argument to access user input def execute(self, varDict): coverageOrUncertainty = varDict["Edit Coverage or Uncertainty"] thunder = varDict["Thunder Y/N"] if coverageOrUncertainty == "Coverage": # assign coverage terms # assign coverage terms else: else: # assign uncertainty terms # assign uncertainty terms if thunder == "Y": if thunder == "Y": # assign thunder # assign thunder

Sept , 2002Smart Tools and Procedures12 SmartScript Library

Sept , 2002Smart Tools and Procedures13 SmartScript Library Grid Access getGrids self.getGrids Model = “Fcst” Element = “T” TimeRange Level = “SFC” Numeric Grid for “T” Mode = “TimeWtAverage”

Sept , 2002Smart Tools and Procedures14 SmartScript Library Model # Fcst or Official self.getGrids(“Fcst”, “T”, “SFC”, GridTimeRange) self.getGrids(“BOU__Eta_Oct0112”, “T”, “SFC”, GridTimeRange) GridTimeRange) self.getGrids(“BOU__Eta”, “T”, “SFC”, GridTimeRange) self.getGrids(“BOU_D2D_ETA”, “t”, “MB750”, GridTimeRange) GridTimeRange) # siteID_type_model_modeltime

Sept , 2002Smart Tools and Procedures15 SmartScript Library Model # Using Site ID for portability def execute(self, GridTimeRange, varDict): siteID = self.getSiteID() siteID = self.getSiteID() model = self.siteID + “__Eta” self.getGrids(model, “T”, “SFC”,GridTimeRange)

Sept , 2002Smart Tools and Procedures16 SmartScript Library Model # Using VariableList VariableList = [("Model:", "", "D2D_model")] def execute(self, GridTimeRange, varDict): D2Dmodel = varDict["Model:"] D2Dmodel = varDict["Model:"] self.getGrids(D2Dmodel, “T”, “SFC”,GridTimeRange)

Sept , 2002Smart Tools and Procedures17 SmartScript Library Numeric Soundings Geopotential height Cube: gh_c gh_c Temperature Cube: t_c t_c PressureLevels MB700MB750MB800MB850MB900MB950

Sept , 2002Smart Tools and Procedures18 SmartScript Library Numeric Sounding self.makeNumericSounding Model = “BOU_D2D_ETA” Element = “t” Numeric Cube for “gh” and Numeric Cube for “t” TimeRange Levels

Sept , 2002Smart Tools and Procedures19 SmartScript Library Numeric Soundings VariableList = [("Model:", "", "D2D_model")] def execute(self, GridTimeRange, Topo, varDict): D2Dmodel = varDict["Model:"] levels = ["MB900", "MB850", "MB800", "MB750", "MB700", "MB650", "MB600", "MB550”] "MB700", "MB650", "MB600", "MB550”] gh_c, t_c = self.makeNumericSounding( D2Dmodel, "t", levels, GridTimeRange) D2Dmodel, "t", levels, GridTimeRange) if gh_c is None: self.noData() self.noData()

Sept , 2002Smart Tools and Procedures20 SmartScript Library Numeric Soundings def execute(self, GridTimeRange, Topo, varDict): Topo_M = self.convertFtToM(Topo) T = self._empty for i in xrange(gh_c.shape[0]): # Go up the atmosphere notSet = equal(T, -200) aboveGround = greater(gh_c, Topo_M) readyToSet = logical_and(notSet, aboveGround) T = where(readyToSet, t_c[i], T) return self.convertKtoF(T)

Sept , 2002Smart Tools and Procedures21 SmartScript Library Conversion Methods convertMsecToKts convertMsecToKts convertKtoF, KtoF convertKtoF, KtoF convertFtoK, FtoK convertFtoK, FtoK convertFtToM convertFtToM UVtoMagDir and MagDirToUV UVtoMagDir and MagDirToUV

Sept , 2002Smart Tools and Procedures22 Trouble-shooting Ideas Run from terminal window to see Python error messages. Run from terminal window to see Python error messages. Use "print" statements. Use "print" statements. print "Made it to this point." print "myVariable=", myVariable print "value at 25, 25 is", T[25][25]

Sept , 2002Smart Tools and Procedures23 Smart Tool Repository (STR) Provides an easy to use interface between developers of STs and the users. Promotes sharing of STs so that others can benefit from work done and not duplicate work. Register tools when downloaded to received bug notification, version updates, and comments on the ST. Users can also submit bugs and comments to the developer. Upload a newly developed tool along with documentation and an installation guide. You can even post a ST idea that is in development without submitting the actual code.

Sept , 2002Smart Tools and Procedures24 Smart Tool Repository (STR) Downloading and Adding a Tool 1)Use the “Site Interface” and choose your region and WFO ID 2)Choose “Info on Tools” and go to the ST you wish to download 3)Right click on the “Download Software” and use “Save Link as”. Do the same for the Documentation and Install files if available. 4)Move the ST to a location where GFE is running and open the ST with an editor such as vi or nedit.

Sept , 2002Smart Tools and Procedures25 Smart Tool Repository (STR) Downloading and Adding a Tool (cont.) 5) Make the downloaded ST part of the GFE a)Use the new ifpServerText program to save the “flat file” into the GFESuite ifpServer. The program takes care of the metadata file needed. 6) Use the STR to register this tool to receive notices of bugs and updates.

Sept , 2002Smart Tools and Procedures26 Smart Tool Repository (STR) Downloading and Adding a Tool (cont.)

Sept , 2002Smart Tools and Procedures27 Executing Smart Tools Exercise Convective Scenario Convective Scenario Winter Winter Scenario

Sept , 2002Smart Tools and Procedures28 Creating Smart Tools Exercises Tool-1 Tool-1 Tool-2 Tool-2 Tool-3 Tool-3 SmartScript-1 : Accessing Grids Directly SmartScript-1 : Accessing Grids Directly SmartScript-2 : Accessing Variable Grids Directly SmartScript-2 : Accessing Variable Grids Directly SmartScript-3 : Making and Accessing Soundings SmartScript-3 : Making and Accessing Soundings SmartScript-4 : Making and Accessing Soundings SmartScript-4 : Making and Accessing Soundings

Sept , 2002Smart Tools and Procedures29 SmartScript Library Numeric Soundings Geopotential height Cube: gh_c gh_c Temperature Cube: t_c t_cPressureLevels MB700MB750MB800MB850MB900MB950

Sept , 2002Smart Tools and Procedures30 SmartScript Library InterpolateValues self.interpolateValues height (height1, value1) Interpolated value at height (height2, value2)

Sept , 2002Smart Tools and Procedures31 SmartScript Library InterpolateValues self.interpolateValues height (height1, value1) Interpolated value at height (height2, value2)

Sept , 2002Smart Tools and Procedures32 SmartScript Library Extrapolate self.extrapolate height (height1, value1) Extrapolated value at height (height2, value2)

Sept , 2002Smart Tools and Procedures33 Vector Weather Elements WeatherElementEdited = "Wind" import SmartScript class Tool (SmartScript.SmartScript): def __init__(self, dbss): def __init__(self, dbss): SmartScript.SmartScript__init__(self,dbss) SmartScript.SmartScript__init__(self,dbss) def execute(self, Wind): def execute(self, Wind): mag = Wind[0] mag = Wind[0] dir = Wind[1] dir = Wind[1] mag = mag + 5 mag = mag + 5 return (mag, dir) return (mag, dir)

Sept , 2002Smart Tools and Procedures34 Working with Weather Numeric Weather is a 2-tuple: wxValues -- Numeric Grid of bytes keys -- list of "ugly strings" where the the index of the ugly string corresponds to the byte value in the wxValues grid. corresponds to the byte value in the wxValues grid. Keys = ["Sct:RW:-: :", "Chc:T:-: :", "Chc:T:-: :", "Chc:SW:-: :" "Chc:SW:-: :" ] Then the wxValues grid is 0 where "Sct:RW:-: :" 1 where "Chc:T:-: :" 1 where "Chc:T:-: :" 2 where "Chc:SW:-: :" 2 where "Chc:SW:-: :"

Sept , 2002Smart Tools and Procedures35 Working with Weather Assigning Weather values: getIndex -- given a list of keys, returns the associated index associated index byteValue = self.getIndex("SChc:RW:-: :",keys) byteValue = self.getIndex("Chc:RW:-: :",keys) # Special case for "NoWx" byteValue = self.getIndex("",keys)

Sept , 2002Smart Tools and Procedures36 Working with Weather def execute(self, PoP, Wx): wxValues, keys = Wx wxValues, keys = Wx #See examples/smartTools/Convective_SmartTool.py # Creating Wx from PoP wxValues = \ where(less(PoP, 10), self.getIndex("",keys), where(less(PoP, 10), self.getIndex("",keys), where(less(PoP,20), self.getIndex("SChc:RW:-: :",keys), self.getIndex("SChc:RW:-: :",keys), self.getIndex("Chc:RW:-:<NoVis>:",keys))) return (wxValues, keys)

Sept , 2002Smart Tools and Procedures37 Working with Weather Querying Weather values: wxMask -- given a Wx tuple and a string expression, return 1 if there is a match return 1 if there is a match found = self.wxMask(Wx, "Iso:") found = self.wxMask(Wx, ":R:")

Sept , 2002Smart Tools and Procedures38 Working with Weather # See examples/smartTools/PoP_From_Wx.py # Creating PoP from Wx def execute(self, PoP,Wx): PoP = where(self.wxMask(Wx, "Iso:"), 10, PoP) PoP = where(self.wxMask(Wx, "Iso:"), 10, PoP) PoP = where(self.wxMask(Wx, "Sct:"), 20, PoP) PoP = where(self.wxMask(Wx, "Sct:"), 20, PoP) return PoP return PoP

Sept , 2002Smart Tools and Procedures39 SmartScript Library Edit Area Methods editArea = self.getEditArea(“Boulder”) areaMask = self.encodeEditArea(editArea) T = where(areaMask, T+10, T)

Sept , 2002Smart Tools and Procedures40 Smart Script Library Missing Data Mode Set from GFE-->Editing Modes Menu Set from GFE-->Editing Modes Menu When there is missing data: When there is missing data: Stop -- stop execution Stop -- stop execution Skip -- Skips the grid and reports it Skip -- Skips the grid and reports it Create -- If possible, creates a grid via interpolation. If in the Fcst database, the new grid can be saved. Create -- If possible, creates a grid via interpolation. If in the Fcst database, the new grid can be saved.

Sept , 2002Smart Tools and Procedures41 SmartScript Library "On-the-Fly" Elements "On-the-fly" Elements "On-the-fly" Elements ISC Discrepancies ISC Discrepancies Creating temporary weather elements Creating temporary weather elements self.createGrid(model, element, elementType, numericGrid, timeRange) numericGrid, timeRange)

Sept , 2002Smart Tools and Procedures42 SmartScript Library "On-the-Fly" Elements self.createGrid("Diff", "T_Diff", "Scalar", myGrid, GridTimeRange) myGrid, GridTimeRange) WeatherElementEdited = “None”

Sept , 2002Smart Tools and Procedures43 SmartScript Library ISC Data self.getComposite WEname GridTimeRange Primary Grid plus corresponding ISC data exactMatch Numeric mask indicating valid points

Sept , 2002Smart Tools and Procedures44 SmartScript Library Saving Objects self.saveObject(objectName, object, category self.saveObject(“MyGrid”, numericGrid, “DiscrepancyValueGrids”) “DiscrepancyValueGrids”) myGrid = self.getObject(“MyGrid”, “DiscrepancyValueGrids”) “DiscrepancyValueGrids”)

Sept , 2002Smart Tools and Procedures45 Smart Script Library Error Handling abort -- abort with user-supplied error message abort -- abort with user-supplied error message noData -- abort with a No Data error noData -- abort with a No Data error cancel -- abort with no error message cancel -- abort with no error message statusBarMsg -- sends message to the Status Bar statusBarMsg -- sends message to the Status Bar

Sept , 2002Smart Tools and Procedures46 Smart Tools ScreenList ScreenList = ["SCALAR","VECTOR"] ScreenList = ["Td","T","MaxT","MinT"]

Sept , 2002Smart Tools and Procedures47 Creating Smart Tools Reserved Methods execute execute preProcessTool, postProcessTool preProcessTool, postProcessTool Actions that need to be done once per tool Actions that need to be done once per tool class Tool (SmartScript.SmartScript): def __init__(self, dbss): def __init__(self, dbss): SmartScript.SmartScript.__init__(self, dbss) SmartScript.SmartScript.__init__(self, dbss) def preProcessTool(self, varDict): def preProcessTool(self, varDict): self._thunder = varDict["Thunder Y/N"] self._thunder = varDict["Thunder Y/N"] def execute(self, Wx): def execute(self, Wx): if self._thunder == "Y": if self._thunder == "Y": # assign thunder # assign thunder

Sept , 2002Smart Tools and Procedures48 Creating Smart Tools Creating Your Own Methods Name preceeded by underscore Name preceeded by underscore "self" used in call and in "def" argument list "self" used in call and in "def" argument list Class Tool (SmartScript.SmartScript): def __init__(self, dbss): def __init__(self, dbss): SmartScript.SmartScript.__init__(self, dbss) SmartScript.SmartScript.__init__(self, dbss) def execute(self, QPF, T): def execute(self, QPF, T): SnowRatio = self._getSnowRatio(T) SnowRatio = self._getSnowRatio(T) SnowAmt = QPF * SnowRatio SnowAmt = QPF * SnowRatio return SnowAmt return SnowAmt def _getSnowRatio(self, T): def _getSnowRatio(self, T): return where( less(T, 20), 18, return where( less(T, 20), 18, where( less(T, 21), 14, 10) where( less(T, 21), 14, 10)

Sept , 2002Smart Tools and Procedures49 SmartScript Library Coming Soon A library of meteorological functions Gradient Curl Dot product Cross product Advection Others

Sept , 2002Smart Tools and Procedures50 SmartScript Library Exercises SmartScript-5 : Making and Accessing Soundings SmartScript-5 : Making and Accessing Soundings SmartScript-6 : Creating Elements "On-the-Fly" SmartScript-6 : Creating Elements "On-the-Fly" SmartScript-7 : Working with Weather SmartScript-7 : Working with Weather SmartScript-8 : Working with Weather SmartScript-8 : Working with Weather

Sept , 2002Smart Tools and Procedures51 Procedures

Sept , 2002Smart Tools and Procedures52 SmartScript Library Procedure Commands copyCmd copyCmd createFromScratchCmd createFromScratchCmd assignValueCmd assignValueCmd zeroCmd zeroCmd interpolateCmd interpolateCmd timeShiftCmd timeShiftCmd splitCmd, fragmentCmd, deleteCmd splitCmd, fragmentCmd, deleteCmd

Sept , 2002Smart Tools and Procedures53 SmartScript Library Procedure Commands copyCmd self.copyCmd Element list = [“T”, “Wind”,”Wx”] timeRange databaseID Copies Elements from database to Fcst for grids overlapping the given timeRange.

Sept , 2002Smart Tools and Procedures54 SmartScript Library Time Ranges # Active timeRange in GFE: def execute(self, editArea, timeRange) # Get Selection Time Range todayRange = self.getTimeRange(“Today”) # Create Time Range with startHour, endHour todayRange = self.createTimeRange(6, 18, “LT”)

Sept , 2002Smart Tools and Procedures55 SmartScript Library Databases # Find database -- databaseName, version databaseID databaseID databaseID = self.findDatabase(“Eta”, 0) databaseID = self.findDatabase(“D2D_ETA”, -1)

Sept , 2002Smart Tools and Procedures56 SmartScript Library Databases # Get database -- result of VariableList databaseID databaseID VariableList = [("Model:", "", "D2D_model")] def execute(self, varDict): D2Dmodel = varDict["Model:"] D2Dmodel = varDict["Model:"] databaseID = self.getDatabase(D2Dmodel)

Sept , 2002Smart Tools and Procedures57 SmartScript Library Procedure Commands createFromScratchCmd self.createFromScratchCmd Element list = [“T”, “Wind”,”Wx”] timeRange repeat = 3 Creates Element grids every three hours with a one-hour duration in the given time range. duration = 1

Sept , 2002Smart Tools and Procedures58 SmartScript Library Procedure Commands assignValueCmd self.assignValueCmd Element list = [“T”, “Td”] timeRange value Assigns the given value to Element grids overlapping the given time range.

Sept , 2002Smart Tools and Procedures59 SmartScript Library Procedure Commands zeroCmd self.zeroCmd Element list = [“T”, “Wind”, “Wx”] timeRange Assigns minimum possible value to scalar and vector Element grids an “ ” to “Wx” grids overlapping the given time range.

Sept , 2002Smart Tools and Procedures60 SmartScript Library Procedure Commands interpolateCmd self.interpolateCmd Element list = [“T”, “Wind”,”Wx”] timeRange interval = 3 Interpolates Element grids “by gaps” every three hours with a one- hour duration. Command completes “synchronously” before going on to next command in the Procedure. duration = 1 interpState=“SYNC” interpMode = “GAPS”

Sept , 2002Smart Tools and Procedures61 SmartScript Library Procedure Commands interpolateCmd self.interpolateCmd Element list = [“T”, “Wind”,”Wx”] timeRange interval = 0 Interpolates Element grids based “on edited” data to the interval and duration of the minimum time constraints. Command executes “asynchronously.” duration = 0 interpState=“ASYNC” interpMode = “ON_EDITED”

Sept , 2002Smart Tools and Procedures62 SmartScript Library Procedure Commands timeShiftCmd self.timeShiftCmd Element list = [“T”, “Wind”,”Wx”] timeRange copyOnly=1 Copies Element grids overlapping the given timeRange 24 hours in the future shiftAmount=24

Sept , 2002Smart Tools and Procedures63 SmartScript Library Procedure Commands splitCmd self.splitCmd Element list = [“T”, “Wind”,”Wx”] timeRange Splits any grid that falls on the start time or end time of the given time range.

Sept , 2002Smart Tools and Procedures64 SmartScript Library Procedure Commands fragmentCmd self.fragmentCmd Element list = [“T”, “Wind”,”Wx”] timeRange Fragments any grids that overlap the time range.

Sept , 2002Smart Tools and Procedures65 SmartScript Library Procedure Commands deleteCmd self.deleteCmd Element list = [“T”, “Wind”,”Wx”] timeRange Deletes any Element grids that overlap the given timeRange.

Sept , 2002Smart Tools and Procedures66 # Creating a Time Range model = varDict["Model"] databaseID = self.getDatabase(model) timeRange_0_60 = self.createTimeRange( 0, 60, "DatabaseID", databaseID) 0, 60, "DatabaseID", databaseID) SmartScript Library Procedure Commands # Copy from model elements = [“T”, “Wind”, “Wx”] self.copyCmd(elements, databaseID, timeRange_0_60)

Sept , 2002Smart Tools and Procedures67 # Find most recent Eta model databaseID = self.findDatabase("Eta", version=0) SmartScript Library Procedure Commands # Copy grids self.copyCmd( [ "T", "Td", "Wind"], databaseID, timeRange_0_60) [ "T", "Td", "Wind"], databaseID, timeRange_0_60)

Sept , 2002Smart Tools and Procedures68 SmartScript Library Procedure Commands callSmartTool self.callSmartTool toolName elementName varDict Execute the given tool editing the element over editArea and timeRange. Use varDict for user-input variables. If possible, create missing data. missingDataMode=“Create” timeRange editArea

Sept , 2002Smart Tools and Procedures69 # Create Grids self.createFromScratchCmd( "MixHgt", timeRange_0_60, repeat=6, duration=1) "MixHgt", timeRange_0_60, repeat=6, duration=1) SmartScript Library Procedure Commands # Get edit area toolEditArea = self.getEditArea("Boulder") # Call Smart Tool self.callSmartTool("MixHgt_Init", "MixHgt", toolEditArea, timeRange_0_60) toolEditArea, timeRange_0_60)

Sept , 2002Smart Tools and Procedures70 Procedures callSmartTool and VariableLists Smart Tool, "MyTool": VariableList = [("Threshold", 10, "numeric") ] def execute(self, varDict): threshold = varDict["Threshold"] threshold = varDict["Threshold"]

Sept , 2002Smart Tools and Procedures71 Procedures callSmartTool and VariableLists Procedure: VariableList = [ ("Model", "", "model"), ("Model", "", "model"), ("Threshold", 10, "numeric") ] ("Threshold", 10, "numeric") ] def execute(self, varDict): def execute(self, varDict): # This call will pass varDict which has variables for # This call will pass varDict which has variables for # both the Procedure and the Smart Tool # both the Procedure and the Smart Tool self.callSmartTool( self.callSmartTool( "MyTool", "T", editArea, timeRange, varDict) "MyTool", "T", editArea, timeRange, varDict)

Sept , 2002Smart Tools and Procedures72 SmartScript Library Procedure Commands getGridCellSwath getGridCellSwath saveEditArea saveEditArea setActiveElement setActiveElement cacheElements, uncacheElements cacheElements, uncacheElements

Sept , 2002Smart Tools and Procedures73 SmartScript Library Procedure commands commands Smart Tool commands getEditArea makeNumericSounding getGrids getGrids createFromScratch extrapolate interpolateCmd callSmartTool createTimeRange

Sept , 2002Smart Tools and Procedures74 Background Procedures runProcedurecommand runProcedure command -n procedure name./runProcedure -u userID -c config file [-a edit area name] [-t time range]

Sept , 2002Smart Tools and Procedures75 Background Procedures./runProcedure -n Proc1 -u ifpUser -c gfeConfig -a CO_Boulder -t Tonight

Sept , 2002Smart Tools and Procedures76 Utilities Allows for sharing of common methods among Smart Tools and Procedures

Sept , 2002Smart Tools and Procedures77 SmartScript Library Progress Dialog import MyDialog def execute(self, editArea, timeRange) # Display dialog dialog = MyDialog.MyDialog( None, “Status”, “ Loading Grids”) None, “Status”, “ Loading Grids”) # Do stuff # Close dialog dialog.top().destroy()

Sept , 2002Smart Tools and Procedures78 Procedures and Utilities Exercises Procedure-1 Procedure-1 Procedure-2 Procedure-2 Procedure-3 Procedure-3 Utility-1 Utility-1