ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D...

42
ENV 2006 11.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie [email protected]
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    217
  • download

    1

Transcript of ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D...

Page 1: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.1

Envisioning Information

Lecture 11 – Scientific Visualization

Introduction

Scalar 1D Data

Ken [email protected]

Page 2: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.2

Data Visualization = Scientific Vis + Information Vis

• Scientific Visualization– Numerical data from

science, engineering and medicine

• Information Visualization– Numeric and non-numeric

data

Ozone layer around earthAutomobile web site- visualizing links

Page 3: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.3

Images, animation

Visualization

Reality

Data

Observation Simulation

Scientific Visualization – What is it?

Page 4: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.4

TIME (mins)

OXYGEN (%)

0 2 4 10 28 30 32

20.8 8.8 4.2 0.5 3.9 6.2 9.6

This table shows the observed oxygen levels inthe flue gas, when coal undergoes combustionin a furnace

A Simple Example

Page 5: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.5

Visualizing the Data - but is this what we want to see?

Page 6: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.6

Estimating behaviour between the data - but is this believable?

Page 7: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.7

Now it looks believable… but something is wrong

Page 8: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.8

At least this is credible..

Page 9: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.9

• It is not only the data that we wish to visualize - it is also the bits inbetween!

• The data are samples from some underlying ‘field’ which we wish to understand

• First step is to create from the data a ‘best’ estimate of the underlying field - we shall call this a MODEL

• This needs to be done with care and may need guidance from the scientist

• The process of fitting a continuous curve (or surface, or volume) through given data is known as INTERPOLATION

What Have We Learnt?

Page 10: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.10

• This process is sometimes called ‘data enrichment’ or ‘enhancement’

• If data is sparse, but accurate, we INTERPOLATE to get sufficient data to create a meaningful representation of our model

• If sparse, but in error, we may need to APPROXIMATE

Data Enrichment

Page 11: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.11

• Overall the Visualization Process can be divided into four logical operations:

– DATA SELECTION: choose the portion of data we want to analyse

– DATA ENRICHMENT: interpolating, or approximating raw data - effectively creating a model

– MAPPING: conversion of data into a geometric representation

– RENDERING: assigning visual properties to the geometrical objects (eg colour, texture) and creating an image

The Visualization Process

Page 12: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.12

Data

Enrich

Map

Render

Interpolate to create model

Select a line graph as techniqueand create line segments fromenriched data

Draw line segments on display insuitable colour, line style and width

Select Extract part of data we are interested in

Back to the simple example

Page 13: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.13

• This model has become the basis of a family of visualization software systems – developed from late 1980s

• Visualization seen as a pipeline of simple processes

eg contouring– read in data

– create contour lines

– draw contour lines

• Systems provide modules implementing these steps…• .. Plus a ‘visual programming’ environment to allow user to

connect modules together

Visualization Software Systems

Page 14: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.14

Visual Programming - IRIS Explorer

Page 15: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.15

• Visual programming allows easy experimentation which is what one needs in visualization

• Examples are:

– IRIS Explorerwww.nag.co.uk

– AVS www.avs.com

– OpenDX (grown from IBM Visualization Data Explorer)www.opendx.org

Visual programming systems

Page 16: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.16

• The mapping stage is where we decide which visualization technique to apply to our ‘enriched’ data

• There are a bewildering range of these techniques - how do we know which to choose?

• First step is to classify the data into sets and associate different techniques with different sets.

Classification of mapping techniques

Page 17: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.17

• The underlying field is a function F(x) – F represents the oxygen level and is the DEPENDENT variable

– x represents the time and is the INDEPENDENT variable

• It is a one dimensional scalar field because– the independent variable x is 1D

– the dependent variable F is a scalar value

Back to the simple example

Page 18: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.18

• The underlying field can be regarded as a function of many variables: say

F(x)where F and x are both vectors:

F = (F1, F2, ... Fm)x = (x1, x2, ... xn)

• The dimension is n

• The dependent variable can be scalar (m=1) or vector (m>1)

General classification scheme

Page 19: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.19

• This leads to a simple classification of data as:

EnS/V

• So the simple example is of type:

E1S

• Flow within a volume can be classed as:

E3V3

A Simple Notation

Page 20: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.20

• Can you give suitable techniques for the following classes:

• ES1

• ES2

• ES3

• EV33

Exercise

Page 21: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.21

Overview of Visualization Techniques

Different techniques for different types of data

Page 22: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.22

Scalar 1D data: ES1

• Scalar: 1 value

• 1D: value is measured in terms of 1 other variable

• The humble graph!

• Clear overlap here between SciVis and InfoVis…

A nice example of web-basedvisualization….

http://fx.sauder.ubc.ca/plot.html

http://fx.sauder.ubc.ca/plot.html

Page 23: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.23

Scalar 2D Data: ES2

• Here is yesterday’s temperature over USA

• Can you use a 1D technique for this sort of data?

• Can you improve this visualization?

http://weather.unisys.com/surface/

Page 24: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.24

Scalar 2D Data: ES2

• Here is a surface view of the tsunami…

• For movies, see:http://www.pmel.noaa.gov/tsunami/indo_1204.html

movie

Page 25: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.25

Scalar 3D Data: ES3

• As dimension increases, it becomes harder to visualize on a 2D surface

• Here we see a lobster within resin.. where the resin is represented as semi-transparent

• Technique known as volume rendering

Image from D. Bartz and M. Meissner

Page 26: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.26

Vector 2D Data:EV22

• This is a flow field in two dimensions

• Simple technique is to use arrows..

• What are the strengths and weaknesses of this approach?

• During the module, we will discover better techniques for this

Page 27: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.27

Vector 3D Data:EV33

• This is flow in a volume

• Arrows become extremely cluttered

• Here we are tracing the path of a particle through the volume

Page 28: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.28

Visualization Techniques –Scalar 1D Data

Page 29: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.29

f

x1 2 3 40

1

2

3

4

Given (x1,f1), (x2,f2), (x3,f3), (x4,f4) - estimate the value off at other values of x - say, x*. Suppose x*=1.75

1.75

1D Interpolation – The Problem

Page 30: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.30

f

x1 2 3 40

1

2

3

4

Take f-value at x* as f-value of nearest data sample.So if x* = 1.75, then f estimated as 3

1.75

Nearest Neighbour

Page 31: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.31

f

x1 2 3 40

1

2

3

4

Join data points with straight lines- read off f-value corresponding to x*.. in the case thatx*=1.75, then f estimated as 2.5

1.75

2.5

Linear Interpolation

Page 32: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.32

f(x*) = (1-t*) f1 + t* f2

The functions j(t)=1-t and k(t)=t are basis functions.

OR, saving a multiplication:f(x*) = f1 + t* ( f2 - f1 )

Suppose x* lies between x1 and x2. Then apply thetransformation:

t = (x-x1)/(x2-x1)so that t goes from 0 to 1. t*=(1.75-1)/(2-1)=0.75

f(1.75)=0.25*1+0.75*3 =2.5

f(1.75)=1+0.75*(3-1) =2.5

Linear Interpolation – Doing the Calculation

x1 x2

f1 f2

0 1t*

x*

f*

Page 33: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.33

• Nearest Neighbour– Very fast : no arithmetic involved

– Continuity : discontinuous value

– Bounds : bounds fixed at data extremes

• Linear Interpolation– Fast : one multiply, one divide

– Continuity : value only continuous, not slope (C0)

– Bounds : bounds fixed at data extremes

Nearest Neighbour and Linear Interpolation

Page 34: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.34

Drawing a Smooth Curve

• Rather than straight line between points, we create a curve piece

x1 x2

f1

f2

g1

g2

We estimate theslopes g1 and g2

at the data points,and construct curvewhich has these valuesand these slopes at end-points

Page 35: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.35

• Slopes estimated as some average of the slopes of adjacent chords - eg to estimate slope at x2

x1 x2 x3

g2

f2

f1

f3

g2 usuallyarithmetic mean(ie average) of

(f2-f1)/(x2-x1)

Slope Estimation

Page 36: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.36

x1 x2

f1

f2

g1

g2

f(x) = c1(x) * f1

+ c2(x) * f2

+ h*(d1(x) * g1

- d2(x) * g2)

ci(x), di(x) arecubic Hermitebasis functions,h = x2 – x1.

Once the slopes at x1 and x2 are known, thisis sufficient to define a unique cubic polynomialin the interval [x1,x2]

Piecewise Cubic Interpolation

Page 37: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.37

Cubic Hermite Basis Functions

Here they are:

Again set t = (x - x1)/(x2 – x1)

c1 (t) = 3(1-t)2 - 2(1-t)3

c2 (t) = 3t2 - 2t3

d1 (t) = (1-t)2 - (1-t)3

d2 (t) = t2 - t3Check the valuesat x = x1, x2 (ie t=0,1)

Page 38: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.38

Coal data - cubic interpolation

Page 39: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.39

• More computation needed than with nearest neighbour or linear interpolation.

• Continuity: slope continuity (C1) by construction - and cubic splines will give second derivative continuity (C2)

• Bounds: bounds not controlled generally - eg if arithmetic mean used in slope estimation...

Piecewise Cubic Interpolation

Page 40: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.40

• However special choices for slope estimation do give control over shape

• If the harmonic mean is used1/g2 = 0.5 ( 1/1 + 1/2)

then we find that f(x) lies within the bounds of the data

Shape Control

Page 41: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.41

Coal data – keeping within the bounds of the data

Page 42: ENV 200611.1 Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie kwb@comp.leeds.ac.uk.

ENV 2006 11.42

Rendering Line Graphs

• The final rendering step is straightforward

• We can assume that the underlying graphics system will be able to draw straight line segments

• Thus the linear interpolation case is trivial

• For curves, we do an approximation as sequence of small line segments