Extending%20WDSS-II - PowerPoint PPT Presentation

About This Presentation
Title:

Extending%20WDSS-II

Description:

Create a static introduceSelf() method that adds itself the factory with a name ... You can make algorithms read your new data format natively ... – PowerPoint PPT presentation

Number of Views:110
Avg rating:3.0/5.0
Slides: 11
Provided by: cimm
Learn more at: http://www.cimms.ou.edu
Category:

less

Transcript and Presenter's Notes

Title: Extending%20WDSS-II


1
Extending WDSS-II
C
  • Valliappa Lakshmanan
  • National Severe Storms Laboratory University of
    Oklahoma
  • lakshman_at_ou.edu

2
Meant to be extended
  • WDSS-II is meant to be extended
  • Few things are set in stone
  • We use factories every where
  • You can introduce your implementation objects
    into those factories
  • Plug in your own writers, readers, builders, data
    formats, etc.
  • Existing algorithms will transparently pick up
    your changes.

3
New algorithm
  • Adding a new algorithm or tool
  • Is the most common extension
  • Write a new executable that links to the WDSS-II
    libraries
  • Will automatically be pluggable into a WDSS-II
    deployment system
  • Can ingest data from an existing system
  • Can provide products instead of products already
    being used.
  • Use w2algcreator dont need to be a C expert
    to do this
  • You need to know C very well in order to extend
    the WDSS-II framework in any other way

4
Adding functionality to WDSS-II
  • Use the factories to extend WDSS-II
  • Make sure that your introduceSelf() function is
    called by Baselineinitialize()
  • For example, this is how gzip files are read
  • FactoryltReadergtintroduce(gz, new GzipReader()
    )
  • GzipReader implements the Reader interface

5
Available factories
  • These are some of the available factories in the
    infrastructure
  • Reader
  • To read from something other than file, gz, bz2
  • Writer
  • To write to something other than file, gz, bz2
  • IndexRecordNotifier
  • To notify to something other than LB (such as SQL
    data base or CORBA)
  • DataEncoder
  • To write formats other than netcdf,xml,awipsnc
  • Builder/Formatter
  • To read formats other than netcdf, xml, level-III
  • Factories at the algorithm level
  • FilterFactory (w2imgproc)
  • New Kernel filters for smoothing, etc.
  • VolumeCreatorFactory (w2merger)
  • New strategies for blending

6
Adding to factory
  • Write a class that implements the appropriate
    interface (Reader,Writer, etc)
  • Create a static introduceSelf() method that adds
    itself the factory with a name
  • Call this from a static initialize() method
    common to the shared library
  • Directly call this initialize() method from
    Baselineinitialize() to add directly to WDSS-II
  • Use a static initializer if not every body needs
    it or if you dont have access to the code of
    Baselineinitialize()
  • More on this later

7
Writing ingest programs
  • To read a new data format, write an ingest
    program
  • Use DataDirectoryManager
  • http//cimms.ou.edu/lakshman/WDSSII/software/doc/
    w2dox/html/classcode_1_1DataDirectoryManager.html
  • Create a DataHandler
  • Implement processData
  • Data will be handed to you in chunks
  • Use BOIStream if your data are binary
  • Does byteswapping
  • Use AsciiLineReader if your data are textual
  • Look at example ingest programs in w2algs/ftptonc
    and w2algs/ldm2netcdf

8
Writing native readers
  • You can make algorithms read your new data format
    natively
  • Ingest programs take the input data and convert
    it into netcdf/XML
  • The Level-III format is read in this manner
  • Use w2ext/w2nexrad as an example
  • Some what more complex choose whether you really
    want to do this.

9
ExtensionLoader
  • Use a static intializer if you can not modify
    Baselineinitialize()
  • Look at documentation of ExtensionLoader
  • Look at w2ext/w2nexrad for examples
  • Populate WDSS-II factories in this initializer
  • Package up all your classes into a shared library
  • Add library to environment variable
    W2_EXTENSION_LIBS at run-time

10
Using the documentation
  • When writing new algorithms
  • Consider if the functionality already exists
  • Can you link together existing tools to get your
    functionality?
  • Experiment, then use those algorithm classes to
    form your new algorithm (see the algorithm
    documentation)
  • Start with the data type documentation
  • LatLonGrid, etc.
  • Process your data
  • Use DataEncoderwriteData to write all your
    intermediate outputs
Write a Comment
User Comments (0)
About PowerShow.com