93 |
93 |
94 |
94 |
95 |
95 |
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
97 % Title page |
97 % Title page |
98 \title[]{3D data Visualization} |
98 \title[3D Plotting]{3D data Visualization} |
99 |
99 |
100 \author[FOSSEE] {FOSSEE} |
100 \author[FOSSEE] {FOSSEE} |
101 |
101 |
102 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
102 \institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} |
103 \date[] {1, November 2009\\Day 2, Session 3} |
103 \date[] {1 November, 2009\\Day 2, Session 5} |
104 |
104 |
105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
106 |
106 |
107 %\pgfdeclareimage[height=0.75cm]{iitblogo}{iitblogo} |
107 %\pgfdeclareimage[height=0.75cm]{iitblogo}{iitblogo} |
108 %\logo{\pgfuseimage{iitblogo}} |
108 %\logo{\pgfuseimage{iitblogo}} |
277 \column{0.5\textwidth} |
277 \column{0.5\textwidth} |
278 \pgfimage[width=2in]{MEDIA/m2/mlab/points3d_ex} |
278 \pgfimage[width=2in]{MEDIA/m2/mlab/points3d_ex} |
279 \end{columns} |
279 \end{columns} |
280 |
280 |
281 \begin{lstlisting} |
281 \begin{lstlisting} |
282 In []: from numpy import * |
|
283 In []: t = linspace(0, 2*pi, 50) |
282 In []: t = linspace(0, 2*pi, 50) |
284 In []: u = cos(t) * pi |
283 In []: u = cos(t) * pi |
285 in []: x, y, z = sin(u), cos(u), sin(t) |
284 In []: x, y, z = sin(u), cos(u), sin(t) |
286 \end{lstlisting} |
285 \end{lstlisting} |
287 \emphbar{\PythonCode{In []: mlab.points3d(x, y, z)}} |
286 \emphbar{\PythonCode{In []: mlab.points3d(x, y, z)}} |
288 \end{frame} |
287 \end{frame} |
289 |
288 |
290 \begin{frame} |
289 \begin{frame} |
317 \alert{Assumes the points are rectilinear} |
316 \alert{Assumes the points are rectilinear} |
318 |
317 |
319 \end{frame} |
318 \end{frame} |
320 |
319 |
321 \begin{frame}[fragile] |
320 \begin{frame}[fragile] |
|
321 \frametitle{mgrid} |
|
322 \begin{lstlisting} |
|
323 In []: mgrid[0:3,0:3] |
|
324 Out[]: |
|
325 array([[[0, 0, 0], |
|
326 [1, 1, 1], |
|
327 [2, 2, 2]], |
|
328 |
|
329 [[0, 1, 2], |
|
330 [0, 1, 2], |
|
331 [0, 1, 2]]]) |
|
332 |
|
333 In []: mgrid[-1:1:5j] |
|
334 Out[]: array([-1., -0.5, 0., 0.5, 1.]) |
|
335 \end{lstlisting} |
|
336 \end{frame} |
|
337 |
|
338 \begin{frame}[fragile] |
|
339 \frametitle{Example} |
|
340 \begin{lstlisting} |
|
341 In []: x, y = mgrid[-1:1:5j, -1:1:5j] |
|
342 In []: z = x*x + y*y |
|
343 |
|
344 In []: z |
|
345 Out[]: |
|
346 array([[ 2. , 1.25, 1. , 1.25, 2. ], |
|
347 [ 1.25, 0.5 , 0.25, 0.5 , 1.25], |
|
348 [ 1. , 0.25, 0. , 0.25, 1. ], |
|
349 [ 1.25, 0.5 , 0.25, 0.5 , 1.25], |
|
350 [ 2. , 1.25, 1. , 1.25, 2. ]]) |
|
351 \end{lstlisting} |
|
352 \end{frame} |
|
353 |
|
354 \begin{frame}[fragile] |
322 \myemph{\Large 2D data: \texttt{mlab.mesh}} |
355 \myemph{\Large 2D data: \texttt{mlab.mesh}} |
323 \vspace*{0.25in} |
356 \vspace*{0.25in} |
324 |
357 |
325 \emphbar{\PythonCode{In []: mlab.mesh(x, y, z)}} |
358 \emphbar{\PythonCode{In []: mlab.mesh(x, y, z)}} |
326 |
359 |
327 \alert{Points needn't be regular} |
360 \alert{Points needn't be regular} |
328 |
361 |
329 \vspace*{0.25in} |
362 \vspace*{0.25in} |
330 \begin{lstlisting} |
363 \begin{lstlisting} |
331 In []: phi, theta = numpy.mgrid[0:pi:20j, |
364 In []: phi, theta = mgrid[0:pi:20j, |
332 ... 0:2*pi:20j] |
365 ... 0:2*pi:20j] |
333 In []: x = sin(phi)*cos(theta) |
366 In []: x = sin(phi)*cos(theta) |
334 In []: y = sin(phi)*sin(theta) |
367 In []: y = sin(phi)*sin(theta) |
335 In []: z = cos(phi) |
368 In []: z = cos(phi) |
336 In []: mlab.mesh(x, y, z, |
369 In []: mlab.mesh(x, y, z, |
347 \myemph{\Large 3D data} |
380 \myemph{\Large 3D data} |
348 \column{0.5\textwidth} |
381 \column{0.5\textwidth} |
349 \pgfimage[width=1.5in]{MEDIA/m2/mlab/contour3d}\\ |
382 \pgfimage[width=1.5in]{MEDIA/m2/mlab/contour3d}\\ |
350 \end{columns} |
383 \end{columns} |
351 \begin{lstlisting} |
384 \begin{lstlisting} |
352 In []: x, y, z = ogrid[-5:5:64j, |
385 In []: x, y, z = mgrid[-5:5:64j, |
353 ... -5:5:64j, |
386 ... -5:5:64j, |
354 ... -5:5:64j] |
387 ... -5:5:64j] |
355 In []: mlab.contour3d(x*x*0.5 + y*y + |
388 In []: mlab.contour3d(x*x*0.5 + y*y + |
356 z*z*2) |
389 z*z*2) |
357 \end{lstlisting} |
390 \end{lstlisting} |