Module 9: Introduction to Scientific Visualization

This URL is http://www.stewart.cs.sdsu.edu/cs205/module9/index.html

Earlier this semester, I asked you to explore some of the graphics capabilities of MATLAB by using my demonstrations (within a MATLAB window, please type)

graph205

    Related materials
  1. 2 D Graphics
  2. Section 2.5 Examples from text
  3. 3 D Graphics
  4. MathWorks Search for Sphere
  5. Solids MATLAB knows how to draw
  6. Pie Charts, Histograms and Pareto Charts
  7. Online MATLAB Graphics Doc (you'll need your own user name)
  8. Local copy of Getting Started with Graphics
  9. Contour + Gradient plots from 3D data to 2D
  10. more to come - for Wednesday
The availability of high speed computers such as the Cray T90, Intel Paragon and Cray T3E at the San Diego Supercomputer Center allow computations to be performed at the gigaFLOP rate, i.e. 1 billion FLoating point OPerations per second. This can result in petabytes of data to be examined, i.e. 10^15 bytes of data that must be stored and incrementally moved into computer memory for examination and processing.

In the early days of computing, scientists might be able to get by examining pages of data. A rough computation using

10 numbers/row (line printer page that's 132 colums wide)
40 rows/page (with heading and such)
50 pages
----------------
20,000 numbers

Each number uses a word of storage, therefore on a computer such as the Cray with its 64 bit (8 Byte) wordsize, these 50 pages corresponds to roughly

200,000 Bytes

[since 1 word = 8 Bytes, this adds another order of magnitude, roughly]

Recall the exercise we did on the board in Lab on Monday:

1 byte = 8 bits 
1 MATLAB Character uses 2 bytes
1 word = ______ bits (32 on Rohan)
_____ MATLAB characters = 1 word (2 on Rohan)

Even this old fashioned way of examining data resulted in a person having to "digest" (interpret?) 1/5 MB of data. [Watch out when people start abbreviating quantities, MB = MegaBytes; Mb = MegaBits; and since 1 byte = 8 bits, there's another rough order of magnitude.]

With the overwhelming amount of data that can be generated by computed model or measured with fine precision instruments, graphics became a necessary mechanism to represent large data sets.

Graphics can be displayed on a computer terminal or on a hard copy device.

On a computer terminal, the resolution possible is measured in "pixel"s. Typical resolutions are 800 by 600 pixels and much high resolutions are possible on the more expensive devices (1280 by 1024, say). Each pixel can be either on or off for a monochrone monitor; or display a color which can range from 256 colors [requiring 8 bits (2^8=256) to present the color code for each pixel] to 1,6777,216 colors [requiring 24 bits (2^24) to represent the color code of each pixel].

Hard copy devices, such as pen plotters, also are concerned with resolution. A pen plotter can only "connect the dots", but it can do this with an assortment of "pens". If you were to look at the very lowest level of control of a pen plotter, you'll see that there is only a small set of commands:

Pen Up
Pen Down
Move from (x,y) to (u,v)
Pick up Pen
Return Pen

In both cases, producing a graph is a "discrete process". The pen plotter only has a finite number of possible colored pens available. A computer terminal can only display a finite number of colors. If the scientists generates MANY points, then connecting the dots will produce a smooth curve. Producing (and storing) this large amount of data may be prohibitively expensive. If each data point is the result of running an experiment in the lab then obtaining the data is likely to be costly. If each data point is the result of a computer model, then the cost of the computer time as well as the computer storage storage must be considered.

Producing a simple, 2 dimensional plot involves:

  1. generating data so that "connecting the dots" is appealing to the eye (appealing is subjective!)
  2. choosing monochrone or color (some colors don't standout)
  3. producing labels to annotate the data (a "busy" plot does not easily enable understanding)

When only a sample of data is available, then numerical techniques such as Section 2.2 XY Plots can be used to produce enough intermediate data to make a smooth plot. This is a topic that is pursued in other courses, Math 541 Introduction to Numerical Computing would be a good place to learn the details. For the purposes of this course, we fill focus on producing the plots within MATLAB and not with some of the details of how they are produced. Our text also presents an introduction to Interpolation and Curve Fitting in Chapter 6, but we will use this only as another example of Data and Graphs to represent this data.

Scientific Visualization goes beyond graphics in the sense that "visual queues" such as color and texture are used to quickly transmit a meaning to the viewer from a plot. This becomes critical when generating 3D graphics since there is typically a lot of information to be portrayed on a finite surface. A simple example would be when displaying data corresponding to temperatures. A "color palette" is used to associate a particular data value with a color to be displayed on the screen. Red would naturally correspond to "hot" or high temperatures and blue would naturally correspond to "cold" or low temperatures. All values in between would be represented as a smooth transition from red to blue. This color would then be used to "light" the pixel corresponding to the coordinates of the data point.

Both the computer terminal and a pen plotter are 2D and therefore represent a "projection" or a "slice" of the 3D object. Working dynamically at a computer monitor would allow the user to rotate the object to gain a better understanding of the structure, but this requires a lot of computing power.

We will focus first on 2D graphics, which is the basic building block.

On to 2D graphics please