ENV Envisioning Information Lecture 11 – Scientific Visualization Introduction Scalar 1D Data Ken Brodlie
ENV 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 earth Automobile web site - visualizing links
ENV Images, animation Visualization Reality Data ObservationSimulation Scientific Visualization – What is it?
ENV TIME (mins) OXYGEN (%) This table shows the observed oxygen levels in the flue gas, when coal undergoes combustion in a furnace A Simple Example
ENV Visualizing the Data - but is this what we want to see?
ENV Estimating behaviour between the data - but is this believable?
ENV Now it looks believable… but something is wrong
ENV At least this is credible..
ENV 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?
ENV 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
ENV 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
ENV Data EnrichMapRender Interpolate to create model Select a line graph as technique and create line segments from enriched data Draw line segments on display in suitable colour, line style and width Select Extract part of data we are interested in Back to the simple example
ENV 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
ENV Visual Programming - IRIS Explorer
ENV Visual programming allows easy experimentation which is what one needs in visualization Examples are: –IRIS Explorer –AVS –OpenDX (grown from IBM Visualization Data Explorer) Visual programming systems
ENV 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
ENV 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
ENV The underlying field can be regarded as a function of many variables: say F(x) where F and x are both vectors: F = (F 1, F 2,... F m ) x = (x 1, x 2,... x n ) The dimension is n The dependent variable can be scalar (m=1) or vector (m>1) General classification scheme
ENV This leads to a simple classification of data as: E n S/V So the simple example is of type: E 1 S Flow within a volume can be classed as: E 3 V 3 A Simple Notation
ENV Can you give suitable techniques for the following classes: E S 1 E S 2 E S 3 E V 3 3 Exercise
ENV Overview of Visualization Techniques Different techniques for different types of data
ENV Scalar 1D data: E S 1 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-based visualization….
ENV Scalar 2D Data: E S 2 Here is yesterday’s temperature over USA Can you use a 1D technique for this sort of data? Can you improve this visualization?
ENV Scalar 2D Data: E S 2 Here is a surface view of the tsunami… For movies, see: movie
ENV Scalar 3D Data: E S 3 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
ENV Vector 2D Data:E V2 2 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
ENV Vector 3D Data:E V3 3 This is flow in a volume Arrows become extremely cluttered Here we are tracing the path of a particle through the volume
ENV Visualization Techniques – Scalar 1D Data
ENV f x Given (x 1,f 1 ), (x 2,f 2 ), (x 3,f 3 ), (x 4,f 4 ) - estimate the value of f at other values of x - say, x*. Suppose x*= D Interpolation – The Problem
ENV f x Take f-value at x* as f-value of nearest data sample. So if x* = 1.75, then f estimated as Nearest Neighbour
ENV f x Join data points with straight lines- read off f-value corresponding to x*.. in the case that x*=1.75, then f estimated as Linear Interpolation
ENV f(x*) = (1-t*) f 1 + t* f 2 The functions j(t)=1-t and k(t)=t are basis functions. OR, saving a multiplication: f(x*) = f 1 + t* ( f 2 - f 1 ) Suppose x* lies between x 1 and x 2. Then apply the transformation: t = (x-x 1 )/(x 2 -x 1 ) 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 x1x1 x2x2 f1f1 f2f2 01 t* x* f*
ENV 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 (C 0 ) –Bounds : bounds fixed at data extremes Nearest Neighbour and Linear Interpolation
ENV Drawing a Smooth Curve Rather than straight line between points, we create a curve piece x1x1 x2x2 f1f1 f2f2 g1g1 g2g2 We estimate the slopes g 1 and g 2 at the data points, and construct curve which has these values and these slopes at end-points
ENV Slopes estimated as some average of the slopes of adjacent chords - eg to estimate slope at x 2 x1x1 x2x2 x3x3 g2g2 f2f2 f1f1 f3f3 g 2 usually arithmetic mean (ie average) of (f 2 -f 1 )/(x 2 -x 1 ) Slope Estimation
ENV x1x1 x2x2 f1f1 f2f2 g1g1 g2g2 f(x) = c 1 (x) * f 1 + c 2 (x) * f 2 + h*(d 1 (x) * g 1 - d 2 (x) * g 2 ) c i (x), d i (x) are cubic Hermite basis functions, h = x 2 – x 1. Once the slopes at x 1 and x 2 are known, this is sufficient to define a unique cubic polynomial in the interval [x 1,x 2 ] Piecewise Cubic Interpolation
ENV Cubic Hermite Basis Functions Here they are: Again set t = (x - x 1 )/(x 2 – x 1 ) c 1 (t) = 3(1-t) 2 - 2(1-t) 3 c 2 (t) = 3t 2 - 2t 3 d 1 (t) = (1-t) 2 - (1-t) 3 d 2 (t) = t 2 - t 3 Check the values at x = x 1, x 2 (ie t=0,1)
ENV Coal data - cubic interpolation
ENV More computation needed than with nearest neighbour or linear interpolation. Continuity: slope continuity (C 1 ) by construction - and cubic splines will give second derivative continuity (C 2 ) Bounds: bounds not controlled generally - eg if arithmetic mean used in slope estimation... Piecewise Cubic Interpolation
ENV However special choices for slope estimation do give control over shape If the harmonic mean is used 1/g 2 = 0.5 ( 1/ 1 + 1/ 2 ) then we find that f(x) lies within the bounds of the data Shape Control
ENV Coal data – keeping within the bounds of the data
ENV 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