Given by Byeongseob Ki, Scott KLasky at Rome Lab CIV Review, NAVO Miss. Tutorial on Sept 24-25 97. Foils prepared Sept 23 97
Outside Index
Summary of Material
Description of Java
|
Description of Scivis
|
Outside Index Summary of Material
Byeongseob Ki |
Scott Klasky |
Description of Java
|
Description of Scivis
|
Syracuse University (NPAC) |
University of Texas@Austin (Applied Research Labs, Relativity) |
Cornell University (Relativity, Astrophysics) |
NCSA (Cosmology) |
University of Pittsburgh |
Institute of Geography, FSU Jena |
Rutgers (CS) |
You? |
What is Java?
|
Java is interesting because
|
Java will dominate as Web will dominate and drive Java as best supported, most widely taught language
|
Scivis is a client-server data visualization and analysis system which takes full advantage of Java. |
The purpose of this system is provide researchers with a customizable data analysis system to aid their research. |
We also provide a collaborative framework, where the users can exchange data and their own personalized filters. |
Available via http://kopernik.npac.syr.edu:8888/scivis |
NOTE: Scivis is not Web-based. It's a visualization server (Java application).
|
A screen dump from a Scivis Session |
Sample Windows |
The Scivis Startup Window |
2d Point plots |
1d plots |
More Sample Windows |
2D Surface Plot |
Contour Plot |
Visualization-Server Model |
Data Structure |
Filter |
Collaboration |
Scivis is a visualization server. |
Simulations servers connect to Scivis with Pipes.
|
The simulation servers sends the data to the visualization server via a socket. |
The simulation server may be implemented in any language. We provide Java, C, C++, MPI, and Fortran90 APIs to connect to the server via function call. |
We also provide utilities to read many files types. |
Users can send the data to the server from any platform. |
Data from |
a file |
Data from |
fortran code |
Data from |
C code |
Piping |
data to |
server |
Server |
Via Socket |
Request recalculation |
Scivis can plot 1- and 2-dimensional data, vector data and isosurface data. Each data set is composed of several time data. |
Each data set has it's name to identify it from other data sets. The visualization window are also classified by unique names. The user has the capability of renaming each window and data set. |
Data can be written in either ASCII or Binary into a file and can be read in either format. |
Each time data of the data set is stored in classes TimeData1D, 2D, 3D, Vec according to its rank. |
Time Value |
x array |
f(x) array |
TimeData1D |
x and f(x) array are private class member. |
The data set is stored in class DataSet1D, 2D, 3D, Vec according to its rank. These classes have a vector to hold the time data. |
DataSet Name |
TimeData Vector |
TimeData1D |
DataSet1D |
When the server receives the data set from the simulation server, it creates visualization window called GFrame1D, 2D, 3D, Vec according to its rank. These are subclasses of abstract class GFrame. |
Frame Name |
DataSet Vector |
DataSet1D |
GFrame1D |
When Scivis receives data with a name that is already has, it appends this data, else it will create a new data set. |
If the simulation server wants to add new data to the data set, Scivis also check the data set name and time value.
|
A filter is an action which is performed on a data set(s) to create a new data set based on this action. |
Examples:
|
We choose to create the user defined filters because there too many types of filter that one may need. Users can easily add their own filters in the system. |
Since the data arrays in a time data are protected by private modifier and can be read by methods such as getxArr(), the user filters can only create new data set. |
In the future, we will add new features to able to overwrite the current data set. |
All user defined filters should be subclasses of abstract class Filter. |
All user defined filters must provide a public no-arg constructor, so that they can be automatically instantiated by a server. The normal programmatic instantiation process(Class.newInstance()) does not allow arguments to be passed to a constructor. See the details of Introspection and Reflection documents from http://www.sun.com |
The main thing to do is to implement a method performFilter() |
package sv.filters; |
import java.util.*; import java.awt.*; import sv.kernel.*; |
public class CAddXFilter extends Filter { |
public CAddXFilter()// output data set's dimension is 1 and 1 arg needs |
super(Filter.ONED, 1); label = "Enter the constant c: "; |
} |
public Object performFilter() { |
TimeData1D onetimedata; |
DataSet1D dataSet = (DataSet1D)sources.firstElement(); |
Vector timeDataVec = new Vector(); |
float[] xarr, yarr; |
int points; |
float c = args[0]; |
for (int i=0; i < dataSet.getnoOfTime(); i++) { |
onetimedata = dataSet.getTimeData(i); |
points = onetimedata.getnoOfPoints(); |
xarr = onetimedata.getxArr(); |
yarr = onetimedata.getyArr(); |
for (int j=0; j < points; j++) |
xarr[j] =xarr[j] + c; |
onetimedata = new TimeData1D(dataSet.getTimeArr[i], points, xarr, yarr); |
timeDataVec.addElement(onetimedata); |
} |
return new DataSet1D("x=x+c : " + dataSet.getTitle(), timeDataVec); |
} |
} |
Still developing and experimenting to find the best framework |
There are several possible methods to implement:
|
Porting existing collaborative system
|
Scivis is implemented by using direct socket programming. However, we are trying to implement two more versions using RMI and porting other collaboration system for research purpose.
|
It uses JDK1.1 delegation event model to handle AWT component event handling. JDK1.1 defines 9 interfaces for different types of listeners. Each listener interface defines methods that will be invoked when a specific event occurs. Collaboration is also handled by event listener when the event occurs. |
There are three layers in our collaboration model. Each layers deals with one specific aspect of the communication. Each of which can be implemented independently of the others. It makes easy to port to other collaboration systems. |
Application Layer |
Reconstruction Layer |
Network Layer |
Sending Data |
Receiving Data |
Network layer delivers byte streams by using socket. It looks up collaborator table to find the destination. It also manages collaborator table whenever other collaborator joins or leaves. |
Scivis can be easily ported to other collaboration system(e.g Tango-II) by changing reconstruction layer and removing network layer. |
EventObject communicates by using Java Serialization. |
Each filter over the data set is collaborative among collaborators. |
Users can share their filters with collaborators who do not have. Result data is sent if the connected server does not have it's filter. Otherwise just sends a filter name. |
The connection can be either master/master or master/slave mode. The actions of the master are reflected on all other collaborator's windows. The slave users are limited to simply observing the actions of the master. |
In the future, we will add stealth mode. |
Server E |
Server B |
Server A |
Server C |
Server D |
B |
E |
C |
D |
A |
connections |
Connection in master mode |
Connection in slave mode |
Observer/Observable Object Model |
Delegation Event Model |
Java Serialization |
Java Beans |
If the user select "Check All" mode, all visualization windows update their states according to an event. If the event(click buttons, choose menu item...) occurs, all of the windows would be updated to reflect this event. |
The Observer pattern has two participants, Observers and Observables and defines a one to many relationship between them. An Observerable object contains a list of its Observers. When the Observable's state changes it notifies its Observers so that they are updated automatically. This one-to-many relationship of objects is defined by the Observer design pattern. |
Java provides the java.util.Observable and java.util.Observer interface for implementing the Observer/Observable model. |
The Observable is the object of interest that provides information to a set of Observers. |
Our server is an Observable class that receives message from each visualization window. |
Each messages it receives is observed by all visualization windows. |
Server |
(Observable) |
Window 1 |
Window 3 |
Window 2 |
Event |
public class svserver extends Observable { |
.......... |
public void receiveMessage(EventMessage msg) { |
setChanged(); // sets a flag to indicate that an observable |
// change has occurred |
notifyObservers(msg); // notifies all observers |
} |
............. |
Code segment of class svserver(Observable) |
Code segment of class GFrame1D(observer) |
public class GFrame1D extends Frame |
implements Observer .... { |
.............. |
public void update(Observable obj, Object arg) { |
.............. |
} |
.............. |
The new event handling model:
|
Serialization converts Java objects into a byte stream, which can then be easily sent to collaborator or stored to a file. |
By making classes Serializable, we can simplify reconstruction and network layer implementations. |
JDK1.1 AWT events are Serializable. |
Since Serialization read/writes entire objects from the socket or file after converting them into a byte stream, system throughput suffers if the data size is large. So we only use it for AWT events. |
Java Beans offers a general framework for the development of reusable code libraries. |
Some GUI components of Scivis are written by Java Beans. We are trying to replace all GUI components to Java Beans. |
See the details in the Java Beans spec(http://splash.javasoft.com/beans/spec.html) |
SciVis can show next and previous time data, and animate over time. Also user can choose the animation speed. |
Each visualized plots can be outputted to postscript or gif files. |
Zooming and panning |
The user can customize the color by dragging the color graphs. Scivis supports RGB and HSB color models. The user can also store color maps to a file and read it later. |
Layered drawing tool |
Visualization windows can be organized by our window manager. |
Sending 1D Data (2D is similar) |
int java_ser_(char *name, double *time, double x[], double fx[], int *nx) |
int java_mser_(char *name, int *nt, double time[], double x[], double fx[], int nx[]) |
int java_bbser_(char *name, double *time, double bb[], int *nx, double fx[]) |
int java_bbmser_(char *name, int *nt,double time[], double bb[][4], int nx[], double fx[]) |
int java_pser_(char *name, double *time, double x[], double fx[], int *nx, int *p) |
Scivis consists of two parts:
|
To install Scivis:
|
sv_files should be located in your working directory. This file defines where the configuration files are located in. |
menu=accessory/config/sv_menu setting=accessory/config/setting |
Sv_menu file defines the user defined filters to be used in Scivis. |
begin 1d |
<menu> Merge |
<item> NAME="add", CLASS="MergeAdd", PACKAGE="filters" |
</menu> |
end |
Computational Steering (API's to aid computational steering) |
Collaboration
|
Optimization
|
Add more features
|