Chapter 11 Above: Principal contraction rates calculated from GPS velocities. Visualized using MATLAB.

Slides:



Advertisements
Similar presentations
Physics: Principles with Applications, 6th edition
Advertisements

Chapter 3 – Web Design Tables & Page Layout
MATLAB – A Computational Methods By Rohit Khokher Department of Computer Science, Sharda University, Greater Noida, India MATLAB – A Computational Methods.
Yingcai Xiao Chapter 6 Fundamental Algorithms. Types of Visualization Transformation Types 1.Data (Attribute Transformation) 2.Topology (Topological Transformation)
Excel Tutorial 4: Analyzing and Charting Financial Data
Chapter 15 Above: GPS time series from southern California after removing several curve fits to the data.
® Microsoft Office 2010 Excel Tutorial 4: Enhancing a Workbook with Charts and Graphs.
Chapter 14 Landsat 7 image of the retreating Malaspina Glacier, Alaska.
© Fluent Inc. 5/10/2015N1 Fluids Review TRN Postprocessing and Visualization.
Introduction to Matlab:
Interpolation, color, & light. Outline Announcements –HW II--due today, 5PM –HW III on the web later today HW I: Issues Structured vs. Unstructured Meshes.
Optimizing Laser Scanner Locations using Viewshed Analysis MEA 592 Final Project November 20,2009 Jeff Smith.
Wes Marshall, P.E. University of Connecticut January 2007 CE 276 Site Design Chapter 2 – Interpolation & Slope.
Elizabeth North UMCES Horn Point Laboratory Using Surfer 8.0 UMCES HPL May 30, 2006.
Fall 2006AE6382 Design Computing1 Three Dimensional Plotting Learning Objectives –Understand the anatomy of a 3D plot –Basics of constructing plots in.
Chapter 1 Ways of Seeing. Ways of Seeing the Atmosphere The behavior of the atmosphere is very complex. Different ways of displaying the characteristics.
CSE351/ IT351 Modeling and Simulation
17 VECTOR CALCULUS.
Introduction to Volume Visualization Mengxia Zhu Fall 2007.
Image Morphing : Rendering and Image Processing Alexei Efros.
Image Morphing : Computational Photography Alexei Efros, CMU, Fall 2005 © Alexey Tikhonov.
[FX,FY,FZ,...] = GRADIENT(F,...) [FX,FY,FZ,…] is numerical gradient of matrix F Distance between grid points in X,Y,Z,… direction FX corresponds to dF/dx,
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
Image Morphing, Triangulation CSE399b, Spring 07 Computer Vision.
Mathematical Modeling. What is Mathematical Modeling? Mathematical model – an equation, graph, or algorithm that fits some real data set reasonably well.
ITUppsala universitet Data representation and fundamental algorithms Filip Malmberg
 1999 BG Mobasseri1 8/29/2015 MATLAB GRAPHICS - PART II ADVANCED PLOTTING June 4, ‘99.
Overview Dennis L. Johnson What is GIS? Geographic Information System Geographic implies of or pertaining to the surface of the earth Information implies.
Chapter 5. Loops are common in most programming languages Plus side: Are very fast (in other languages) & easy to understand Negative side: Require a.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
Review of Vector Analysis
CMPS 1371 Introduction to Computing for Engineers PLOTTING.
Plotting – 3-Dimensional. 3D Plots versus 2D Plots 3-dimensional plots, in contrast to 2-dimensional ones, has a third axis (often called the z-axis).
MATLAB Week 4 01 December Outline More plotting – A few other 3-D plotting functions – Basic volume visualization Creating functions Vectorized.
Recap Summary of Chapter 6 Interpolation Linear Interpolation.
MA/CS 3751 Fall 2002 Lecture 24. MA/CS 3752 ginput ginput is a Matlab function which takes one argument input: number of points to select in the image.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Microsoft ® Office Access ™ 2007 Training Datasheets I: Create a table by entering data ICT Staff Development presents:
MATLAB for Engineers, by Holly Moore. ISBN © 2007 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is.
Advanced GIS Using ESRI ArcGIS 9.3 3D Analyst part 2.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Outline Announcements –HW II due Friday –HW III option Interpolation Colormaps.
Introduction to MATLAB Session 5 Simopekka Vänskä, THL 2010.
2D Routines in 3D. Outline Announcements –HW II--due Friday. 5PM HW1 & Cookie Grids & Meshes Representing f(x,y) Lines & Surfaces in 3D Survey.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
MATLAB – PT1 The purpose of this workshop is to get you started and to have fun with MATLAB! Let’s talk a little and decide on what we will be covering.
Numerical Analysis 3D Plots. A numerical method is a technique for computing a numerical approximation of the solution to a mathematical problem.
Recap Chapter 5 “Plotting” Two Dimensional Plots Simple x-y Plots Titles, Labels and Grids Multiple Plots.
Recap Plots with More than one Line Plots of Complex Arrays Line, Color and Mark Style Axis Scaling and Annotating Plots Subplots Polar Plots Logarithmic.
Introduction to Linear Algebra Mark Goldman Emily Mackevicius.
Introduction to GIS. What is GIS? Geographic Information System Geographic implies of or pertaining to the surface of the earth Information implies knowledge.
Data Visualization Fall 2015.
Chapter 2 Describing Motion: Kinematics in One Dimension.
June 14, ‘99 COLORS IN MATLAB.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
Multimedia Programming 10: Image Morphing
More Matlab Graphics and GUI Graphics subplots some useful commands 3D graphics GUI GUI controls The callback property Other essential properties.
EEE 242 Computer Tools for Electrical Engineering
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function.
Chapter 2: Describing Motion in 1-D. Frame of Reference Whether or not you are moving depends on your point-of-view. From inside the box car, the woman.
Document that explains the chosen concept to the animator 1.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
CS112 Scientific Computation Department of Computer Science Wellesley College Kodak moments 3-D Visualization and Color.
Advanced Plotting Techniques Chapter 11 Above: Principal contraction rates calculated from GPS velocities. Visualized using MATLAB.
Reading and Writing Image Files
Lecture 25.
Ch3 Graphics Overview of Plotting Editing Plots
Two-Dimensional Plots
Presentation transcript:

Chapter 11 Above: Principal contraction rates calculated from GPS velocities. Visualized using MATLAB.

We have used MATLAB to visualize data a lot in this course, but we have only scratched the surface… Mainly used ‘plot’, ‘plot3’, ‘image’, and ‘imagesc’ This section will cover some of the more advanced types of visualizations that MATLAB can produce Vector plots Streamline plots Contour plots Visualizing 3D surfaces Making animations (if there is time) In general, if you can picture it, MATLAB can probably do it If not, visit MATLAB central, and it is likely that someone has written a script/function to do what you want

[x, y] = [2, 3] Plotting vectors is very useful in Earth sciences Wind velocities Stream flow velocities Surface velocities or displacements Glacier movements Ocean currents …and many more! Conventions: Spatial coordinates: [x, y, z] I.e. the location of the tail of the vector Vector magnitudes: [u, v, w] I.e. the [east, north, up] components of the vector 60° [u, v] = [2.50, 4.33] MATLAB typically needs to know: In 2D: x, y, u, v In 3D: x, y, z, u, v, w

MATLAB provides several built-in commands for plotting vectors I will only cover ‘quiver’ and ‘quiver3’ Keys to success: x, y, u, and v must all be the same dimensions Can accept vectors or matrices WARNING! Quiver automatically scales vectors so that they do not overlap The actual visualized vector length is not at the same scale as x/y axes

quiver has lots of options The plot shown here is silly Made only to demonstrate some options For list of all options >> doc quivergroup

‘quiver3’ works just like ‘quiver’ except that three locations [x,y,z], and three vector components [u,v,w] are required Uses same “quivergroup” properties

streamline: predicts & plots the path of a particle that starts within the data range Requires a vector field I.e. locations of many vectors and the vector magnitudes/directions Useful for tracking contaminants, and lots more Will not extrapolate Works with 2D or 3D data

stream2: calculates particle paths given a velocity field Requires x,y,u, and v Output is a cell. [x,y] vals are in columns in the cell For 3D paths, see stream3 Sometimes you only want the [x,y] path E.g. you may want to plot on a map projection

Recall that streamline does not extrapolate

MATLAB provides several built-in visualization functions to display 3D data 2D Plots of 3D Data: Contour Plots ‘contour’ Contour Filled Plots ‘contourf’ 3D Plots of 3D Data: 3D Surfaces ‘surf’ ‘trisurf’ Most of these functions require gridded data We will cover 2D/3D interpolation and gridding

Let’s contour this equation using MATLAB!

If your data is already regularly gridded in meshgrid format, contouring is easy… Are these both positive peaks, or negative, or a combination? Need to either: Label contours with text Draw contours using a colormap

contour can label contours C contains contour info h is the handle to the contour group Often the labels are at awkward intervals How can I specify which contours to plot?

For more information and settings read the documentation >> doc contour >> doc clabel Contour labeling is very flexible and customizable

If no color is specified, MATLAB uses the default colormap, jet, to color the contour lines Use colorbar to display the colorbar How can I specify the colormap and the colormap limits?

Color maps and ranges can be specified! How can make a color filled contour plot? Dr. Marshall’s favorite!

contourf makes color-filled contour plots Can specify the colormap and caxis range if needed

Color-filled contour plots are an excellent way to visualize 3D data in a 2D format If color is not an option, use colormap(gray)

Makes a rectangular mesh of 3D data Unless color is specified, mesh is colored by a colormap

Surface plots use solid colored quadrilaterals to make a 3D surface Num of elements depends on [x,y] spacing

All of the previously discussed, 3D data visualization commands require data on a regular grid What if your data is unevenly spaced or scattered? You must first grid the data (interpolate it) MATLAB provides a few really nice tools for this task I will only cover: griddata & scatteredinterpolant

When calling some gridding/interpolating functions in MATLAB, extrapolation is not performed by default What is extrapolation in 2D/3D? Any point that falls outside of the convex hull is typically considered to be extrapolated Convex hull: An outline of your data’s limits convhull: returns the indices of the input [x,y] values that are at the outer edges of the data range

griddata interpolates z-values from non-uniform (or uniform) data Requires: scattered [x,y,z] *(can also interpolate gridded [x,y,z] data) new grid data points [x,y] (from meshgrid)

griddata offers several interpolation methods Which is best? No straightforward answer Depends on your data and sampling If you don’t know, stick with linear (default)

interp2 / interp3: will also interpolate a 2D/3D dataset, but the scattered data must be monotonically increasing. I.e. the data must follow a constant and predictable direction Doesn’t do anything that griddata or scatteredInterpolant doesn’t already do While griddata works fine for most applications, it is not highly optimized So, if your data set is huge, consider using scatteredInterpolant scatteredInterpolant: Accepts [x, y, z] data and returns a function that can be used to interpolate/extrapolate the data at any user- specified value Advantages: Faster than griddata. More reliable interpolation algorithm Disadvantages: Requires a bit more coding than griddata. Will extrapolate by default. Only in MATLAB 2013a or newer

Interpolate the scattered planar data Warning!! scatteredInterpolant extrapolates by default!

Interpolate the scattered exponential data What interpolation options are there for scatteredInterpolant?

scatteredInterpolant has three interpolation methods See documentation for usage Also has two extrapolation methods Or you can turn extrapolation off Now that you know how to grid/interpolate scattered data you can make any of the 3D plots shown earlier!

What if you have scattered data that you do not want to interpolate? Typically, you will triangulate the data and make the data into a triangulated surface Determining the optimal triangulation is non-trivial, but MATLAB has a built-in function that calculates the optimal triangulation, delaunay Called a Delaunay triangulation

'FaceColor','interp'