Writing a WDSS-II Application using w2algcreator

Slides:



Advertisements
Similar presentations
Programming for Beginners
Advertisements

OpenVMS System Management A different perspective by Andy Park TrueBit b.v.
Introduction to a Programming Environment
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
Neural Network Tools. Neural Net Concepts The package provides a “standard” multi-layer perceptron –Composed of layers of neurons –All neurons in a layer.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Managing SX.e and TWL with MARC and Scripts Jeremiah Curtis
WDSS-II Training Module II Manipulating Data Sources.
Chapter One An Introduction to Programming and Visual Basic.
Managing SX.e and TWL with scripts and MARC 02/12/04 Jeremiah Curtis.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Chapter – 8 Software Tools.
THE EYESWEB PLATFORM - GDE The EyesWeb XMI multimodal platform GDE 5 March 2015.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Workshop 5 of 7 Welcome!. Today's Topics Review from Workshop 4 Modularity & subVIs Documentation File Input/Output Introduction.
Product Training Program
Progress Apama Fundamentals
Architecture Review 10/11/2004
Topic 2: Hardware and Software
Development Environment
Melissa Wagner & Jaime Patel
Essentials of UrbanCode Deploy v6.1 QQ147
CS 330 Class 7 Comments on Exam Programming plan for today:
How to link a test to a launcher (in this case a shell launcher)
CSCI-235 Micro-Computer Applications
Algorithms Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
An Introduction to Designing and Executing Workflows with Taverna
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Computer Programming I
A Guide to Unix Using Linux Fourth Edition
Arrays and files BIS1523 – Lecture 15.
Introduction to C Topics Compilation Using the gcc Compiler
RFPMonkey.com External Review
Intro to PHP & Variables
Engineering Innovation Center
ALEPH Version 22 Beginning Cataloging
Introduction to javadoc
Intro To Design 1 Elementary School Library: User Sub-System Class Diagrams Software Engineering CSCI-3321 Dr. Tom Hicks Computer Science Department.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Python I/O.
Oracle Sales Cloud Sales campaign
PROJECT MANAGEMENT Bill Biddle.
Introduction to Ansible
Exploring the Power of EPDM Tasks - Working with and Developing Tasks in EPDM By: Marc Young XLM Solutions
If selection construct
File I/O in C Lecture 7 Narrator: Lecture 7: File I/O in C.
Introduction Paul Flynn
If selection construct
Chapter One: An Introduction to Programming and Visual Basic
Agile testing for web API with Postman
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
Planning and Storyboarding a Web Site
Spreadsheets, Modelling & Databases
Introduction to javadoc
Inside a PMI Online Course
Part 1. Preparing for the exercises
Tonga Institute of Higher Education IT 141: Information Systems
In order to execute a search you can…
Tonga Institute of Higher Education IT 141: Information Systems
Running a Java Program using Blue Jay.
Advanced Searching Tips
Carthage ios 8 onwards Dependency manager that streamlines the process of integrating the libraries into the project.
Arrays.
Continuous Integration
Lab 8: GUI testing Software Testing LTAT
An Introduction to Designing and Executing Workflows with Taverna
Junit Tests.
Chapter 1: Creating a Program.
Presentation transcript:

Writing a WDSS-II Application using w2algcreator V Lakshmanan National Severe Storms Laboratory & University of Oklahoma lakshman@ou.edu 11/14/2018 http://www.wdssii.org/

WDSS-II – application development WDSS-II provides a easy environment to develop new applications or algorithms. Any algorithm developed in WDSS-II can be run either in archive mode or in real-time. provided that the algorithm is fast enough to run in real-time and the machine can handle it! 11/14/2018 http://www.wdssii.org/

WDSS-II for Applications What does WDSS-II provide your application? Easy ingest of data from multiple sensors Easy ways to write out and visualize intermediate and final outputs. A common framework for accessing data. The framework is written in C++. It’s best if you can write your code in C++ too. But you can call Fortran or C code from C++ 11/14/2018 http://www.wdssii.org/

Creating a new application WDSS-II has a tool to create a new application quickly. w2algcreator Need to create an input XML file specifying the inputs to your application. Will create C++ main and a template for your scientific code. Your then write the scientific code. 11/14/2018 http://www.wdssii.org/

How WDSS-II works WDSS-II applications connect to a source of data. Called an Index. Applications listen for new products in that Index. Decide whether or not to process that product. Create and process the data if needed. Write out outputs (in netcdf or XML). Notify an Index about the new products available. For other applications listening to that Index May be a different index from the source. 11/14/2018 http://www.wdssii.org/

WDSS-II Applications WDSS-II Applications are just executables. launched on the command line. In deployed systems through scripts. Inputs are specified on the command-line. w2vil –i xmllb:/data/realtime/radar/KTLX/code_index.lb \ -R ReflectivityQC \ -o /data/realtime/radar/KTLX/ \ -r 11/14/2018 http://www.wdssii.org/

Command-line options w2vil – algorithm executable name VerticalIntegratedLiquid – algorithm full name (used in source code) Input RadarIndex specified by –i option Input data type is specified by –R option Output directory is specified by –o option Real-time is specified by –r option The options –r, -l (the letter ell), -o are reserved so that the deployment scripts work correctly. w2vil –i xmllb:/data/realtime/radar/KTLX/code_index.lb \ -R ReflectivityQC \ -o /data/realtime/radar/KTLX/ \ -r 11/14/2018 http://www.wdssii.org/

Some conventions If you need to provide domain extents, use the following letters: t: “top” to specify the north-west-top corner b: “bottom” to specify the south-east-bottom corner s: to specify the grid spacing If you need to process only a certain sub-type, use colons as a separator: -R ReflectivityQC:00.50 -R ReflectivityMaximum:vol 11/14/2018 http://www.wdssii.org/

Creating a new application Need to create an XML file. Use your favorite text editor. Save it somewhere. A template is available as example_alg.xml – you can edit this if you want. What is the algorithm’s descriptive name? Used to generate class names in template. What is the executable name? What is the namespace that generated code should be in? Pick your group (casa) or name (tj) i.e. something that will distinguish your code from something someone else might create. <algorithmcreator name=“VerticalIntegratedLiquid exec=“w2vil” namespace=“w2polar”> </algorithmcreator> 11/14/2018 http://www.wdssii.org/

Inputs Next you need to specify inputs. Done within an “inputs” section. How many indexes do you need to connect to? Each index or group of indexes will get a new index tag. Give each index a name (RadarIndex, ModelIndex, etc.) so that a user can understand what needs to be provided to your algorithm. Supply a mnemonic option letter as well. The most important input index is by convention given the option letter i. Specify the history (in minutes) that needs to be maintained for each index (or group of indexes). Can be just 1 minute if you will never search backwards in your algorithm (only new data). 11/14/2018 http://www.wdssii.org/

Input Index specification <algorithmcreator …. > <inputs> <index history=“5”> <optionvalue name=“RadarIndexes” letter=“i” /> </index> <index … > …. </inputs> </algorithmcreator> 11/14/2018 http://www.wdssii.org/

Input Data specification The user may specify either just a single index or a bunch of index URLs. So each “index” tag actually corresponds to a group of indexes in general. For each index, specify the data that you will be listening to in that index. For each product listened to, specify: How you will refer to the product (e.g: dbz) The default name of the product (e.g: ReflectivityQC) This is the “official” name of the product that you can see on the display. A mnemonic letter for this input What type of data is it? WDSS-II data are usually one of these types: RadialSet LatLonGrid LatLonHeightGrid DataTable 11/14/2018 http://www.wdssii.org/

Input Data Specification <index history=“5”> <optionvalue …. /> <data type=“RadialSet”> <optionvalue name=“dbz” letter=“R” default=“ReflectivityQC” /> </data> <data … > … </index> 11/14/2018 http://www.wdssii.org/

Option The optionvalue tag: Has a letter, name and default The default tag is optional – if you leave it out the user has to specify a value on the command-line. If the default is “false”, then the option is a boolean option i.e. yes/no. 11/14/2018 http://www.wdssii.org/

Optional data To specify an optional index, specify that the default value is an empy string. E.g. you will use a model index if one is available, otherwise, you will run only on radar data. You need to specify a default name for all input data types otherwise we won’t know what to listen for. 11/14/2018 http://www.wdssii.org/

Other options Besides the input, do you need any other parameters specified for your algorithm? For example, maybe you need to know the radar name. For each such option: Specify the name of the option (e.g: RadarName) Specify a mnemonic (e.g: ‘S’ for sourceRadar, since –r and –R are both taken by realtime and Reflectivity respectively …) 11/14/2018 http://www.wdssii.org/

Other options <algorithmcreator …> <options> <optionvalue letter=“s” name=“sourceRadar” /> <optionvalue …/> </options> </algorithmcreator> 11/14/2018 http://www.wdssii.org/

Use the w2algcreator w2algcreator –i name-of-your-XML-file Now that you have the XML file: Run the w2algcreator program It will create a w2vil_main.cc and w2vil_VerticalIntegratedLiquid.h file in the output directory. Plug in the code for the two functions specified in the .h file: One function tells you the radar name, the output directory to write your outputs to and the LB to notify after you have written the outputs. The other function is called processdbz() Your scientific code goes in there. w2algcreator –i name-of-your-XML-file -o output-directory 11/14/2018 http://www.wdssii.org/

Final steps Fill in the scientific code. Compiling: Use the example_Makefile that is provided to compile and link against the WDSS-II libraries. Or put your source code into a subdirectory of the w2algs repository Need to create Makefile.am See w2algs/w2algcreator/README for details. 11/14/2018 http://www.wdssii.org/

The autogenerated code What does the autogenerated code do? It creates “listeners” to listen for the products your algorithm needs The user tells the algorithm the Index where those products may be found Also specifies that ReflectivityQC_smoothed should be used where your algorithm expects a reflectivity May tell your algorithm to provide heartbeat messages The code has fault handling If you lose connection to an Index on a remote machine, the algorithm will reconnect. If your algorithm hangs or starts to eat up the CPU, it’ll stop providing heartbeat messages, thus allowing an external monitoring program to kill it and restart it. A good idea to specify “initOnStart=true” for any product that should re-read if your algorithm is restarted. As soon as it receives notification of a product, it tells your algorithm class about it Then, you do your thing! 11/14/2018 http://www.wdssii.org/

On a timer W2algcreator is for data-driven applications Best to process data as it comes in So, design your application to be data-driven as much as possible. To do things on a timer Use a TimedEventHandler (see API documentation) Provide a listener that will be called every N milliseconds. 11/14/2018 http://www.wdssii.org/

Exercises The best way to learn is to write simple data-driven algorithms. The next module on data formats will help you accomplish these tasks. May need to get input data from some source first. These examples should get you started: Read in single-radar reflectivity data and write out an indexed scan with values below a user-defined threshold set to MissingData. Hint: PolarGrid is an indexed RadialSet User-defined implies you need a command-line parameter Use ProcessTimer to determine how long certain steps take. Read in both reflectivity and velocity data from the same radar and index the reflectivity data at the velocity azimuths. You will need to operate with RadialSet data Wait for matching Reflectivity and Velocity scans (use the elevation angle to check) Form a histogram of VIL values to satellite IR temperatures. Use DataConverter and/or DataRemapper A multi-source algorithm. Makes a difference only when running, not when writing the algorithm! 11/14/2018 http://www.wdssii.org/

Questions? Email me: lakshman@ou.edu More documentation (including a more up-to-date version of this document) is at: http://www.wdssii.org/ 11/14/2018 http://www.wdssii.org/