5    VSCRIPT: A Scripting Language Extension for VISTA

Introduction to Computer Scripting

Graphical User Interface's (GUI's) are an excellent way to introduce a new user to doing a task.  This helps to get the user initiated, but when doing complicated, conditional-based, repetitive tasks, GUI's make it extremely time-consuming and tedious.  Scripting has been created to solve these problems.

Scripting is the process of writing small scripts (1-2 pages long) which do a simple task.  It is not limited to the command line but can also manipulate or create graphical components such as plots.  Scripting automates tasks and makes them repeatable.  This makes the work done by an individual easily transferable to future persons who encounter similar tasks.  It also helps create a body of reusable code with more ease than traditional programming.

Furthermore, scripting is interactive, i.e. users can try out various commands by typing them line by line on the command interpreter or pasting an entire set of lines at the interpreter.  The interpreter then executes those lines and waits for further commands.  This is again of great use as one can experiment with various scenarios and then write those that worked into a script file for reuse.

Scripting could be used for:

  • a tool for model/data comparisons;
  • a tool for model/model incremental analysis;
  • a tool for checking model run sanity; and
  • a tool for automated data quality checking/flag setting with rules.

Introduction to VSCRIPT

VISTA (VISualization Tool and Analyzer) is a GUI that was developed by DWR.  VISTA was described in the July 1998 edition of this report.  The purpose of VISTA is to provide time-series data retrieval, management, manipulation and visualization.

VSCRIPT is a scripting language extension for VISTA. It allows a user to write simple scripts using VISTA's functionality.  VSCRIPT is now an integral part of VISTA’s distribution.

The underlying language of VSCRIPT is Python which is a mature and stable scripting language very close in syntax to the underlying language of VISTA (i.e. Java). VSCRIPT is an extension based on JPython (a Java version of Python that is available from http://www.jpython.org).  VISTA and VSCRIPT and their documentation are available from http://wwwdelmod.water.ca.gov/docs/dsm2/vista.

Python is well documented and has a large user community.  JPython taps into the power and libraries of two languages, Java and Python, to give the user flexibility and power.

Future Directions

  1. Documentation:
  2. There are a number of modules available in VISTA to manipulate and display data.  There will be VSCRIPT classes in the future for anyone wishing to learn to use this tool. DWR is planning to continually improve documentation of sample scripts and VISTA functionality.

  3. Library of scripts for common tasks:
  4. Users in the course of doing various studies repeat certain data processing tasks.  The aim of scripting is to make them automatically repeatable.  Furthermore, if the task is generally useful, it becomes useful enough to parameterize the script in terms of arguments required to do the task so that future users can customize the script when faced with similar tasks.  A scripting library for commonly used scripts will be documented and expanded in the future.


Author: Nicky Sandhu
Back to Delta Modeling Section 1999 Annual Report Table of Contents

Last revised: 2001-09-12

About Us Hydrology & Operations Section Delta Modeling Section Computer Assistance Section
Home Page Available Studies Computer Models Reports Home Page Available Studies Computer Models Reports

Disclaimer, Comments or Questions
Webmaster email to htdelmod@water.ca.gov