Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to OpenDX Jon Johansson Academic Information and Communication Technologies November 20, 2006 Jon Johansson Academic Information and Communication.

Similar presentations


Presentation on theme: "Introduction to OpenDX Jon Johansson Academic Information and Communication Technologies November 20, 2006 Jon Johansson Academic Information and Communication."— Presentation transcript:

1 Introduction to OpenDX Jon Johansson Academic Information and Communication Technologies November 20, 2006 Jon Johansson Academic Information and Communication Technologies November 20, 2006

2 Viz Packages OpenDX, VTK are AVS use a pipelined, component-based architecture a user can quickly assemble modular software components into a “finished application.” these systems are flexible in the sense that components can be combined in a multitude of ways, thereby allowing an application developer to accomplish a wide variety of visualization tasks they are extensible as they offer the means for developers to add new components to the system, thereby extending the system’s functionality OpenDX, VTK are AVS use a pipelined, component-based architecture a user can quickly assemble modular software components into a “finished application.” these systems are flexible in the sense that components can be combined in a multitude of ways, thereby allowing an application developer to accomplish a wide variety of visualization tasks they are extensible as they offer the means for developers to add new components to the system, thereby extending the system’s functionality

3 OpenDX information on OpenDX can be found at –http://www.opendx.org/http://www.opendx.org/ this site has the latest version of dx for download IBM has a site with older information –http://www.research.ibm.com/dx/http://www.research.ibm.com/dx/ information on OpenDX can be found at –http://www.opendx.org/http://www.opendx.org/ this site has the latest version of dx for download IBM has a site with older information –http://www.research.ibm.com/dx/http://www.research.ibm.com/dx/

4 OpenDX 1991, IBM Research introduced as Visualization Data Explorer (dx) May 24 1999, IBM made Visualization Data Explorer (dx) open source as IBM Open Visualization Data Explorer (OpenDX) the last commercial version of dx was 3.1.4B OpenDX is now at 3.4.2 1991, IBM Research introduced as Visualization Data Explorer (dx) May 24 1999, IBM made Visualization Data Explorer (dx) open source as IBM Open Visualization Data Explorer (OpenDX) the last commercial version of dx was 3.1.4B OpenDX is now at 3.4.2

5 OpenDX OpenDX provides a full set of tools for manipulating, transforming, processing, realizing, rendering and animating data allows for visualization and analysis methods based on points, lines, areas, volumes, images or geometric primitives in any combination OpenDX provides a full set of tools for manipulating, transforming, processing, realizing, rendering and animating data allows for visualization and analysis methods based on points, lines, areas, volumes, images or geometric primitives in any combination

6 OpenDX Architecture dx uses a client-server execution model the client process is the graphics user interface: –it always runs on a workstation the server process does all of the computation: –it may reside on the same, or a different machine dx uses a client-server execution model the client process is the graphics user interface: –it always runs on a workstation the server process does all of the computation: –it may reside on the same, or a different machine

7 OpenDX Architecture

8 Starting OpenDX to start the dx process: –on a Linux/Unix machine, type dx –on Windows click an OpenDX icon Start Menu -> OpenDX -> DX this will bring up the OpenDX Startup Window to start the dx process: –on a Linux/Unix machine, type dx –on Windows click an OpenDX icon Start Menu -> OpenDX -> DX this will bring up the OpenDX Startup Window

9 OpenDX Interface from the startup window we can: –import data through a wizard –run previously written visual programs –create or edit visual programs –run the OpenDX tutorial –run sample programs process “startupui” from the startup window we can: –import data through a wizard –run previously written visual programs –create or edit visual programs –run the OpenDX tutorial –run sample programs process “startupui”

10 OpenDX Data Import OpenDX import module will read the following data formats: –DX – Data Explorer native format –CDF (Common Data Format) from the National Space Science Data Center a self-describing data abstraction for the storage and manipulation of multidimensional data in a discipline-independent fashion. http://nssdc.gsfc.nasa.gov/cdf/cdf_home.html –NetCDF (network Common Data Format) from the Unidata Program Center in Boulder, Colorado an interface for array-oriented data access and a library that provides an implementation of the interface http://www.unidata.ucar.edu/packages/netcdf/ OpenDX import module will read the following data formats: –DX – Data Explorer native format –CDF (Common Data Format) from the National Space Science Data Center a self-describing data abstraction for the storage and manipulation of multidimensional data in a discipline-independent fashion. http://nssdc.gsfc.nasa.gov/cdf/cdf_home.html –NetCDF (network Common Data Format) from the Unidata Program Center in Boulder, Colorado an interface for array-oriented data access and a library that provides an implementation of the interface http://www.unidata.ucar.edu/packages/netcdf/

11 OpenDX Data Import OpenDX import module will read the following data formats: –HDF – Hierarchical Data Format (HDF version 4.1 only for Windows) from the National Center for Supercomputing Applications software and file formats for scientific data management http://hdf.ncsa.uiuc.edu/ –Image – TIFF, MIFF, GIF, RGB, R+G+B, YUV –Spreadsheet typically non-spatial data, for example: OpenDX import module will read the following data formats: –HDF – Hierarchical Data Format (HDF version 4.1 only for Windows) from the National Center for Supercomputing Applications software and file formats for scientific data management http://hdf.ncsa.uiuc.edu/ –Image – TIFF, MIFF, GIF, RGB, R+G+B, YUV –Spreadsheet typically non-spatial data, for example: DateHalibutSablefish 31-Mar-012.42.24 30-Apr-012.212.07 31-May-012.052

12 OpenDX Data Import OpenDX import module will read the following data formats: –General describe the data file with a “general array header file” which can describe a wide variety of formats for data use the Data Prompter tool started by the Import Data button to describe your data and create the header file OpenDX import module will read the following data formats: –General describe the data file with a “general array header file” which can describe a wide variety of formats for data use the Data Prompter tool started by the Import Data button to describe your data and create the header file

13 OpenDX Data Import the Data Prompter describe your data to OpenDX the Data Prompter with create a “.general” file which describes your data file the import module reads the general file the Data Prompter describe your data to OpenDX the Data Prompter with create a “.general” file which describes your data file the import module reads the general file

14 OpenDX Data Import

15 the “.general” file is ascii text it contains keyword statements that describe important aspects of the data file –pathname to file –grid structure –data type –format –more … the “.general” file is ascii text it contains keyword statements that describe important aspects of the data file –pathname to file –grid structure –data type –format –more …

16 OpenDX Data Import a data file might consist of ascii values, each line containing 4 values … -8.50000000 14.72243186 48.00000000 326.96078431 -8.50000000 14.72243186 49.00000000 326.96078431 -8.50000000 14.72243186 50.00000000 326.96078431 -9.50627936 14.09363873 -50.00000000 365.66830060 -9.50627936 14.09363873 -49.00000000 365.66830060 -9.50627936 14.09363873 -48.00000000 365.66830060 … it’s important know how the file was written: row major: for( i = 0; i < nx; i++){ for( j = 0; j < ny; j++){ for( k = 0; k < nz; k++){ fprintf( outfh, "%12.8f %12.8f %12.8f %12.8f \n", x, y, z, V ); } row major is defined by the last index varying the fastest a data file might consist of ascii values, each line containing 4 values … -8.50000000 14.72243186 48.00000000 326.96078431 -8.50000000 14.72243186 49.00000000 326.96078431 -8.50000000 14.72243186 50.00000000 326.96078431 -9.50627936 14.09363873 -50.00000000 365.66830060 -9.50627936 14.09363873 -49.00000000 365.66830060 -9.50627936 14.09363873 -48.00000000 365.66830060 … it’s important know how the file was written: row major: for( i = 0; i < nx; i++){ for( j = 0; j < ny; j++){ for( k = 0; k < nz; k++){ fprintf( outfh, "%12.8f %12.8f %12.8f %12.8f \n", x, y, z, V ); } row major is defined by the last index varying the fastest

17 OpenDX Data Import We have a data set that has regular spacings in the x, y and z directions We don’t need to read the coordinates for each point from a file The general header file to read in this data is: file =./pot_cart.dat grid = 101 x 101 x 101 format = ascii interleaving = field majority = row header = lines 0 field = potential structure = scalar type = float dependency = positions positions = regular, regular, regular, -50.0, 1.0, -50.0, 1.0, -50.0, 1.0 end We have a data set that has regular spacings in the x, y and z directions We don’t need to read the coordinates for each point from a file The general header file to read in this data is: file =./pot_cart.dat grid = 101 x 101 x 101 format = ascii interleaving = field majority = row header = lines 0 field = potential structure = scalar type = float dependency = positions positions = regular, regular, regular, -50.0, 1.0, -50.0, 1.0, -50.0, 1.0 end

18 OpenDX Data Import DX supports many techniques for generating renderable geometry from data. For scalar data these include: –color and opacity mapping –contours and isosurfaces –histograms –two-dimensional and three-dimensional plotting –surface deformation, etc For vector data –arrow plots –streamlines, streaklines, etc DX supports many techniques for generating renderable geometry from data. For scalar data these include: –color and opacity mapping –contours and isosurfaces –histograms –two-dimensional and three-dimensional plotting –surface deformation, etc For vector data –arrow plots –streamlines, streaklines, etc

19 OpenDX Data Import Visualizations can be annotated with: –ribbons –tubes –axes –glyphs –text –display of data locations, meshes and boundaries Data interactions are also supported: –probing –picking –arbitrary surface and volume sampling –arbitrary cutting/mapping planes Visualizations can be annotated with: –ribbons –tubes –axes –glyphs –text –display of data locations, meshes and boundaries Data interactions are also supported: –probing –picking –arbitrary surface and volume sampling –arbitrary cutting/mapping planes

20 OpenDX Visual Program Editor Click on “New Visual Program …” in the Startup Window starts the VPE create “Visual Programs” by connecting modules connections represent data flow Click on “New Visual Program …” in the Startup Window starts the VPE create “Visual Programs” by connecting modules connections represent data flow

21 OpenDX Visual Program Editor

22 to move a module from the palette on the left to the canvas on the right of the VPE: –click on the module to highlight it –move the cursor to the canvas – the cursor becomes a right-angle to show where the upper left corner of the module will be –left-click to place the module to move a module from the palette on the left to the canvas on the right of the VPE: –click on the module to highlight it –move the cursor to the canvas – the cursor becomes a right-angle to show where the upper left corner of the module will be –left-click to place the module

23 OpenDX Visual Program Editor

24 input ports are at the top of the module output ports are at the bottom some modules have no input or no output ports double click on a module to see the interface for the module input ports are at the top of the module output ports are at the bottom some modules have no input or no output ports double click on a module to see the interface for the module

25 OpenDX Visual Program Editor the Import module reads data from a file three inputs (from left to right): –file name –the variable to read from the file (depends on the data format) –data format (select general) one output –the data (as a field) the Import module reads data from a file three inputs (from left to right): –file name –the variable to read from the file (depends on the data format) –data format (select general) one output –the data (as a field)

26 OpenDX Visual Program Editor the interface to the Import module allows you to set values

27 Data Import A big hurdle in using any visualization system can be getting the data into the package Once your data is in the package the data can be manipulated using the tools built into the package The form of the data is frequently dictated by the form of the geometry in the problem –E.g. Spherically symmetric problem results in spherical-polar coords in the data set A big hurdle in using any visualization system can be getting the data into the package Once your data is in the package the data can be manipulated using the tools built into the package The form of the data is frequently dictated by the form of the geometry in the problem –E.g. Spherically symmetric problem results in spherical-polar coords in the data set

28 Data Import Each visualization package has defined a set of data types upon which the algorithms depend to function A well chosen data structure can permit the development powerful algorithms A poorly chosen data structure can hinder the performance of the package Each visualization package has defined a set of data types upon which the algorithms depend to function A well chosen data structure can permit the development powerful algorithms A poorly chosen data structure can hinder the performance of the package

29 Data Import Data sets come at many scales and in many formats: –Computer simulations of cellular processes –Electro-magnetic fields around the Earth and through the Solar system –Nuclear interactions –Crystal formation –Scans of human bodies: CT, MRI, PET need a taxonomy for data Data sets come at many scales and in many formats: –Computer simulations of cellular processes –Electro-magnetic fields around the Earth and through the Solar system –Nuclear interactions –Crystal formation –Scans of human bodies: CT, MRI, PET need a taxonomy for data

30 Data Sets – Uniform Mesh represents data organized in a regular array only need to enter the min and max values of the axes: (x 0, y 0 ) and (x max, y max ) can describe the data file with another text file having a “fld” extension represents data organized in a regular array only need to enter the min and max values of the axes: (x 0, y 0 ) and (x max, y max ) can describe the data file with another text file having a “fld” extension

31 Data Sets – Rectilinear Mesh represents data organized on orthogonal axes, but the spacing between data points may be irregular need to provide lists of the x and y coords and the grid is constructed represents data organized on orthogonal axes, but the spacing between data points may be irregular need to provide lists of the x and y coords and the grid is constructed

32 Data Sets – Irregular Mesh less symmetry than uniform or rectilinear meshes provide the coordinates of all the points in the mesh the connectivity can be inferred less symmetry than uniform or rectilinear meshes provide the coordinates of all the points in the mesh the connectivity can be inferred

33 Data Sets – Structured Mesh the meshes above are all classified as “Structured” the points can be characterized by dimensions along some axes the grid below is 7x3 – that’s enough to infer the connectivity the meshes above are all classified as “Structured” the points can be characterized by dimensions along some axes the grid below is 7x3 – that’s enough to infer the connectivity

34 Data Sets – Unstructured Mesh represents data points that aren’t organized in a regular pattern must provide all coordinates for points as well as explicit connection information data and its description in a file with the extension “inp” this is referred to as “Unstructured Cell Data” the 12 points below can be connected in many ways, for example: 5 triangles and 4 quads 1 triangle and 6 quads 13 triangles represents data points that aren’t organized in a regular pattern must provide all coordinates for points as well as explicit connection information data and its description in a file with the extension “inp” this is referred to as “Unstructured Cell Data” the 12 points below can be connected in many ways, for example: 5 triangles and 4 quads 1 triangle and 6 quads 13 triangles

35 Data Sets – Scattered Points only concerned with the points in space – not with the connections read the points in as a list – connections are implied P 0 → P 1 → … → P n-1 points in 3D have 1D connections use either.fld or.inp – the.fld is probably easier only concerned with the points in space – not with the connections read the points in as a list – connections are implied P 0 → P 1 → … → P n-1 points in 3D have 1D connections use either.fld or.inp – the.fld is probably easier

36 Data Sets – Important Parameters nspace – number of spatial coordinates per node: (x, y, z) nspace = 3 ndim – number of grid dimensions (also called the computational dimension). This is the space of the connections. For scattered points ndim = 1. dims – an array of grid dimensions {n x, n y, n z } nspace – number of spatial coordinates per node: (x, y, z) nspace = 3 ndim – number of grid dimensions (also called the computational dimension). This is the space of the connections. For scattered points ndim = 1. dims – an array of grid dimensions {n x, n y, n z }

37 OpenDX Data Model Fields are the fundamental objects in the Data Explorer data model. A field represents a mapping from some domain to some data space. The domain of the mapping is specified by a set of positions and (generally) a set of connections that allow interpolation of data values for points between positions. Fields are the fundamental objects in the Data Explorer data model. A field represents a mapping from some domain to some data space. The domain of the mapping is specified by a set of positions and (generally) a set of connections that allow interpolation of data values for points between positions.

38 OpenDX Data Model Positions represent what can be thought of as (and often really are) locations in space; the data are the values associated with the space of the positions. The mapping at all points in a domain (not just those specified by the given positions) is represented implicitly by specifying that the data are dependent on (located at) the sample points or on the connections between points. Positions represent what can be thought of as (and often really are) locations in space; the data are the values associated with the space of the positions. The mapping at all points in a domain (not just those specified by the given positions) is represented implicitly by specifying that the data are dependent on (located at) the sample points or on the connections between points.

39 OpenDX Data Model the positions and data are said to be components of a field, and every field must contain at least a "positions" component and a "data" component. Fields may also contain other components (e.g., "connections"). An OpenDX field consists of data and the additional components needed to describe that data so that OpenDX can process it. the positions and data are said to be components of a field, and every field must contain at least a "positions" component and a "data" component. Fields may also contain other components (e.g., "connections"). An OpenDX field consists of data and the additional components needed to describe that data so that OpenDX can process it.

40 OpenDX Data Import If your data is basically a number of arrays you can use the General Array Importer To import data through the General Array Importer, you must be able to answer the following questions: If your data is basically a number of arrays you can use the General Array Importer To import data through the General Array Importer, you must be able to answer the following questions:

41 OpenDX Data Import What are the independent and dependent variables? –Scalar field and positions? –independent variable constitute the "positions" component of a data field What is the dimensionality of the positions and data components ? –1-D 2-D 3-D … What are the independent and dependent variables? –Scalar field and positions? –independent variable constitute the "positions" component of a data field What is the dimensionality of the positions and data components ? –1-D 2-D 3-D …

42 OpenDX Data Import How is the independent variable (the set of positions) to be described? –regular grid (which can be completely described by an origin and a set of deltas) –an explicit list (which may or may not be part of the data file)? –E.g. data measurements might be on a grid of 1-degree increments in latitude and 5-degree increments in longitude How is the independent variable (the set of positions) to be described? –regular grid (which can be completely described by an origin and a set of deltas) –an explicit list (which may or may not be part of the data file)? –E.g. data measurements might be on a grid of 1-degree increments in latitude and 5-degree increments in longitude

43 OpenDX Data Types How are the positions connected to one another? –Are they connected? For example, a regular grid of positions might be connected by a regular grid of connections (lines, quads, or cubes). The connections specify how data values should be interpolated between positions. Positions that are explicitly specified (i.e., not regular) can also be connected by a regular grid of connections (e.g., if the grid is deformed, or warped) How are the positions connected to one another? –Are they connected? For example, a regular grid of positions might be connected by a regular grid of connections (lines, quads, or cubes). The connections specify how data values should be interpolated between positions. Positions that are explicitly specified (i.e., not regular) can also be connected by a regular grid of connections (e.g., if the grid is deformed, or warped)

44 OpenDX Data Types

45 top row represent surfaces bottom row represent volumes the three types of grid are (left to right) –irregular (irregular positions, irregular connections), –deformed regular (irregular positions, regular connections) –regular (regular positions, regular connections), top row represent surfaces bottom row represent volumes the three types of grid are (left to right) –irregular (irregular positions, irregular connections), –deformed regular (irregular positions, regular connections) –regular (regular positions, regular connections),

46 OpenDX Data Import What is the format of the stored data values –ASCII or binary? –floating point, integer, signed or unsigned byte, etc.? What is the order of the data items with respect to the grid? –column major (first index varies fastest) –row major (last index varies fastest) What is the format of the stored data values –ASCII or binary? –floating point, integer, signed or unsigned byte, etc.? What is the order of the data items with respect to the grid? –column major (first index varies fastest) –row major (last index varies fastest)

47 OpenDX Data Import Are the data dependent on "positions" or on "connections"? –i.e. are the data values associated one-to-one with positions or with the connections between positions? Data associated with connections are often referred to as "cell-centered" Are the data dependent on "positions" or on "connections"? –i.e. are the data values associated one-to-one with positions or with the connections between positions? Data associated with connections are often referred to as "cell-centered"

48 OpenDX Data Import What kind of embedded text (comments, etc.) in the data file must be "skipped" when the data values are read –# of lines of header? –# of bytes of header? What kind of embedded text (comments, etc.) in the data file must be "skipped" when the data values are read –# of lines of header? –# of bytes of header?

49 Importing Data to OpenDX A field can be specified by an ascii header file which describes the data in your data file Data file BField_10x10x10_.5.dat A field can be specified by an ascii header file which describes the data in your data file Data file BField_10x10x10_.5.dat ! ! Magnetic field due to a coil with: ! rCoil = 4.000000e+006 m ! ICoil = 1.500000e+009 A ! rEarth = 6.371000e+006 m ! ! Grid parameters: ! xMin = -10.000000 RexMax = 10.000000 Redx = 0.500000 Renx = 41 ! yMin = -10.000000 ReyMax = 10.000000 Redy = 0.500000 Reny = 41 ! zMin = -10.000000 RezMax = 10.000000 Redz = 0.500000 Renz = 41 ! ! The data are in the order: ! xyzBxByBz ! ! x, y, z are measured in Earth radii ! Bx, By, Bz have units of microTesla (10^-6 T). ! -10.000000-10.000000-10.000000-5.614274e-003 -5.614274e-003 -8.609813e-006 -9.500000-10.000000-10.000000-5.792536e-003 -6.097407e-003 -2.076287e-004 -9.000000-10.000000-10.000000-5.950169e-003 -6.611299e-003 -4.290995e-004 -8.500000-10.000000-10.000000-6.081721e-003 -7.154966e-003 -6.732067e-004 ! ! Magnetic field due to a coil with: ! rCoil = 4.000000e+006 m ! ICoil = 1.500000e+009 A ! rEarth = 6.371000e+006 m ! ! Grid parameters: ! xMin = -10.000000 RexMax = 10.000000 Redx = 0.500000 Renx = 41 ! yMin = -10.000000 ReyMax = 10.000000 Redy = 0.500000 Reny = 41 ! zMin = -10.000000 RezMax = 10.000000 Redz = 0.500000 Renz = 41 ! ! The data are in the order: ! xyzBxByBz ! ! x, y, z are measured in Earth radii ! Bx, By, Bz have units of microTesla (10^-6 T). ! -10.000000-10.000000-10.000000-5.614274e-003 -5.614274e-003 -8.609813e-006 -9.500000-10.000000-10.000000-5.792536e-003 -6.097407e-003 -2.076287e-004 -9.000000-10.000000-10.000000-5.950169e-003 -6.611299e-003 -4.290995e-004 -8.500000-10.000000-10.000000-6.081721e-003 -7.154966e-003 -6.732067e-004

50 Importing Data to OpenDX file = C:/Courses/DataSets/BField/BField_10x10x10_.5_B_col.dat grid = 41 x 41 x 41 format = ascii interleaving = field majority = column header = lines 18 field = density structure = 3-vector type = float dependency = positions positions = regular, regular, regular, -10.0, 0.5, -10.0, 0.5, -10.0, 0.5 end file = C:/Courses/DataSets/BField/BField_10x10x10_.5_B_col.dat grid = 41 x 41 x 41 format = ascii interleaving = field majority = column header = lines 18 field = density structure = 3-vector type = float dependency = positions positions = regular, regular, regular, -10.0, 0.5, -10.0, 0.5, -10.0, 0.5 end

51 Importing Data to OpenDX For a list of header file keywords see: –OpenDX QuickStart Guide 5.3, Page 85, and –OpenDX User’s Guide – Appendix B header – indicates how many # lines at the top of the file to skip before reading the data majority – row or column positions – gives the origin and delta for each axis of the grid. interleaving – indicates how several data sets are interleaved. layout – describes how the data are formatted. –layout = skip1, width1, skip2, width2, … skip – # of bytes to skip before reading the data value width – # of bytes to read for the data value For a list of header file keywords see: –OpenDX QuickStart Guide 5.3, Page 85, and –OpenDX User’s Guide – Appendix B header – indicates how many # lines at the top of the file to skip before reading the data majority – row or column positions – gives the origin and delta for each axis of the grid. interleaving – indicates how several data sets are interleaved. layout – describes how the data are formatted. –layout = skip1, width1, skip2, width2, … skip – # of bytes to skip before reading the data value width – # of bytes to read for the data value

52 OpenDX Visual Program Editor create a program by dragging from the output port of one module to the input of another module the data types for the ports must be compatible to form the connection the connection is represented as a line create a program by dragging from the output port of one module to the input of another module the data types for the ports must be compatible to form the connection the connection is represented as a line

53 OpenDX Visual Program Editor create a simple program –read in a data file –create colors for the data –render the data get a sample data set from –http://sciviz.aict.ualberta.cahttp://sciviz.aict.ualberta.ca –Bumps.dat –Bumps.general create a simple program –read in a data file –create colors for the data –render the data get a sample data set from –http://sciviz.aict.ualberta.cahttp://sciviz.aict.ualberta.ca –Bumps.dat –Bumps.general

54 OpenDX Visual Program Editor the data set is 2d get a “flat” image the data set is 2d get a “flat” image

55 OpenDX Visual Program Editor try the RubberSheet module set the Scale parameter to 5 try the RubberSheet module set the Scale parameter to 5

56 Our Data Set Consider the electric potential due to a dielectric cylinder introduced into a constant electric field E 0 the parameters I used are: –E 0 = 50 V/m –dielectric constant = 5 –R cyl = 10 m –-50 m ≤ x, y, z ≤ 50 m Consider the electric potential due to a dielectric cylinder introduced into a constant electric field E 0 the parameters I used are: –E 0 = 50 V/m –dielectric constant = 5 –R cyl = 10 m –-50 m ≤ x, y, z ≤ 50 m

57 Our Data Set

58 OpenDX Data Import a data file might consist of ascii values, each line containing 4 values … -8.50000000 14.72243186 48.00000000 326.96078431 -8.50000000 14.72243186 49.00000000 326.96078431 -8.50000000 14.72243186 50.00000000 326.96078431 -9.50627936 14.09363873 -50.00000000 365.66830060 -9.50627936 14.09363873 -49.00000000 365.66830060 -9.50627936 14.09363873 -48.00000000 365.66830060 … it’s important know how the file was written: row major: for( i = 0; i < nx; i++){ for( j = 0; j < ny; j++){ for( k = 0; k < nz; k++){ fprintf( outfh, "%12.8f %12.8f %12.8f %12.8f \n", x, y, z, V ); } row major is defined by the last index varying the fastest a data file might consist of ascii values, each line containing 4 values … -8.50000000 14.72243186 48.00000000 326.96078431 -8.50000000 14.72243186 49.00000000 326.96078431 -8.50000000 14.72243186 50.00000000 326.96078431 -9.50627936 14.09363873 -50.00000000 365.66830060 -9.50627936 14.09363873 -49.00000000 365.66830060 -9.50627936 14.09363873 -48.00000000 365.66830060 … it’s important know how the file was written: row major: for( i = 0; i < nx; i++){ for( j = 0; j < ny; j++){ for( k = 0; k < nz; k++){ fprintf( outfh, "%12.8f %12.8f %12.8f %12.8f \n", x, y, z, V ); } row major is defined by the last index varying the fastest

59 OpenDX Data Import We have a data set that has regular spacings in the x, y and z directions We don’t need to read the coordinates for each point from a file The general header file to read in this data is: file =./pot_cart.dat grid = 101 x 101 x 101 format = ascii interleaving = field majority = row header = lines 0 field = potential structure = scalar type = float dependency = positions positions = regular, regular, regular, -50.0, 1.0, -50.0, 1.0, -50.0, 1.0 end We have a data set that has regular spacings in the x, y and z directions We don’t need to read the coordinates for each point from a file The general header file to read in this data is: file =./pot_cart.dat grid = 101 x 101 x 101 format = ascii interleaving = field majority = row header = lines 0 field = potential structure = scalar type = float dependency = positions positions = regular, regular, regular, -50.0, 1.0, -50.0, 1.0, -50.0, 1.0 end

60 Our Data Set the connections between the points are inferred when you tell OpenDX that the data are “row major” these are Cartesian connections the connections between the points are inferred when you tell OpenDX that the data are “row major” these are Cartesian connections

61 Our Data Set you can also work in non- Cartesian coordinates the grid is row major in cylindrical coordinates (r, phi, z) write Cartesian coordinates in the file and connections are inferred from the cylindrical grid you can also work in non- Cartesian coordinates the grid is row major in cylindrical coordinates (r, phi, z) write Cartesian coordinates in the file and connections are inferred from the cylindrical grid

62 Our Data Set

63

64 Data Import Start with a FileSelector module to browse to the general file describing the data set and connect it to an import module which actually does the reading Double click on the FileSelector to get a widget to browse the file system When the data is in the package we can start applying algorithms to it and look for interesting features Start with a FileSelector module to browse to the general file describing the data set and connect it to an import module which actually does the reading Double click on the FileSelector to get a widget to browse the file system When the data is in the package we can start applying algorithms to it and look for interesting features

65 Components of the visualization Isovalues of the electric potential The lower slice shows the electric potential with contour lines to give a sense of the shape change close to the cylinder –Use a slab module to extract a slice of the potential field –Use the Isosurface module to extract contour lines at values -1750, -1250, -750, -250, 250, 750, 1250, 1750 volts Isovalues of the electric potential The lower slice shows the electric potential with contour lines to give a sense of the shape change close to the cylinder –Use a slab module to extract a slice of the potential field –Use the Isosurface module to extract contour lines at values -1750, -1250, -750, -250, 250, 750, 1250, 1750 volts

66 Components of the visualization In the Slab module set the parameters: –dimension: “z” –position: 0 –thickness: (0 or 1) this is the default The AutoColor module generates a color map so that we have something to see In the Slab module set the parameters: –dimension: “z” –position: 0 –thickness: (0 or 1) this is the default The AutoColor module generates a color map so that we have something to see

67 Components of the visualization

68 Take the output of the Slab module and attach it to the input of an Isosurface module –The 2D slab data will result in contour lines –Set the isovalues at -1750, -1250, -750, -250, 250, 750, 1250, 1750 volts The contour lines are then passed to a Tube module –Set the diameter of the tube to 1.0 Take the output of the Slab module and attach it to the input of an Isosurface module –The 2D slab data will result in contour lines –Set the isovalues at -1750, -1250, -750, -250, 250, 750, 1250, 1750 volts The contour lines are then passed to a Tube module –Set the diameter of the tube to 1.0

69 Components of the visualization

70 Electric field lines The middle slice is color mapped to the magnitude of the electric field and shows some field lines –The lines are diverted in the region of the cylinder Use the Gradient module and the Compute module to calculate the elctric field from the electric potential E = -   Electric field lines The middle slice is color mapped to the magnitude of the electric field and shows some field lines –The lines are diverted in the region of the cylinder Use the Gradient module and the Compute module to calculate the elctric field from the electric potential E = -  

71 Components of the visualization –Use a Slab module to extract a slice of the electric field –Use the Streamline module to extract contour lines at values The Streamline module needs the vector field as one input, and a set of seed points as the next input –Use the Tube module to produce lines with some thickness –Use a Slab module to extract a slice of the electric field –Use the Streamline module to extract contour lines at values The Streamline module needs the vector field as one input, and a set of seed points as the next input –Use the Tube module to produce lines with some thickness

72 Components of the visualization Use the Compute module after the gradient to negate the vector components In the Compute module set “expression” to [-a.x, -a.y, -a.z] In Slab set –dimension: “z” –position: 50 –thickness: (0 or 1) this is the default Use the Compute module after the gradient to negate the vector components In the Compute module set “expression” to [-a.x, -a.y, -a.z] In Slab set –dimension: “z” –position: 50 –thickness: (0 or 1) this is the default

73 Components of the visualization

74 To calculate streamlines connect the Electric Field (output of Compute) to the left input of the Streamlines module Use another Slab module to extract a line of points to use as seeds for the stream line –Dimension: “x” –Position: 0 Use Reduce to decrease the number of points by 4 Use Tube with diameter 1.0 To calculate streamlines connect the Electric Field (output of Compute) to the left input of the Streamlines module Use another Slab module to extract a line of points to use as seeds for the stream line –Dimension: “x” –Position: 0 Use Reduce to decrease the number of points by 4 Use Tube with diameter 1.0

75 Components of the visualization

76 The top slice shows vector glyphs at some grid points of the electric field –The glyphs show the direction of the field –The size of the glyphs is scaled to the magnitude of the field The top slice shows vector glyphs at some grid points of the electric field –The glyphs show the direction of the field –The size of the glyphs is scaled to the magnitude of the field

77 Components of the visualization Insert a Reduce module and a Glyph module between Slab and Collect The Slab module parameters: –Dimension: “z” –Position: 100 The Reduce module has –Factor: 4.0 In the Glyph module –Type: “rocket” –Shape: 1.0 –Scale: 0.15 –Ratio: 0.1 Insert a Reduce module and a Glyph module between Slab and Collect The Slab module parameters: –Dimension: “z” –Position: 100 The Reduce module has –Factor: 4.0 In the Glyph module –Type: “rocket” –Shape: 1.0 –Scale: 0.15 –Ratio: 0.1

78 Components of the visualization

79 We have applied some visualization techniques to the data and created 3 slices pretty, but what does it mean?? this lacks context need some information to help the viewer understand what we are looking at We have applied some visualization techniques to the data and created 3 slices pretty, but what does it mean?? this lacks context need some information to help the viewer understand what we are looking at

80 Components of the visualization Annotations – add these to provide the context for the visualization ShowBox lets the viewer know the volume of space occupied by the data Text: titles, labels – explain a bit Axes provide orientation and scale ColorBar – shows how the numbers are mapped to color Draw the cylinder so we see the cause of all the trouble Annotations – add these to provide the context for the visualization ShowBox lets the viewer know the volume of space occupied by the data Text: titles, labels – explain a bit Axes provide orientation and scale ColorBar – shows how the numbers are mapped to color Draw the cylinder so we see the cause of all the trouble

81 Components of the visualization The ShowBox module draws a box around the extents of the data set –Use a Tube module to get nicely rendered lines Caption modules allow you to place text in the 2D plane of the screen –Set the text and location in the interface The ShowBox module draws a box around the extents of the data set –Use a Tube module to get nicely rendered lines Caption modules allow you to place text in the 2D plane of the screen –Set the text and location in the interface

82 Components of the visualization

83 A very useful annotation in this visualization is some indication of where the cylinder actually is –It is, after all, the source of all the disruption in the field A very useful annotation in this visualization is some indication of where the cylinder actually is –It is, after all, the source of all the disruption in the field

84 Components of the visualization Use the Construct module to create a line –Origin: {[0 0 -50]} –Deltas: {[0 0 1]} –Counts: [1 1 101] –Data: {1} The Tube module creates a cylinder around the line –Diameter: 20.0 –Ngon: 25 The Color module does just that –Color: “purple” –Opacity: 0.3 Use the Construct module to create a line –Origin: {[0 0 -50]} –Deltas: {[0 0 1]} –Counts: [1 1 101] –Data: {1} The Tube module creates a cylinder around the line –Diameter: 20.0 –Ngon: 25 The Color module does just that –Color: “purple” –Opacity: 0.3

85 Components of the visualization

86 When we put it all together and select the camera angle that we want we hopefully have what we want … My goals –Show a variety of techniques that I can apply to this data set –Provide enough annotation to orient the viewer –Make it look nice When we put it all together and select the camera angle that we want we hopefully have what we want … My goals –Show a variety of techniques that I can apply to this data set –Provide enough annotation to orient the viewer –Make it look nice

87

88 Debugging Sometimes things aren’t working and you just don’t know why OpenDX’s equivalent of the “print” statement is the Describe module Attach the Describe module to the output port of any module that is providing a field and Describe will give you a summary of what the module is providing in the Message Window. Debugging Sometimes things aren’t working and you just don’t know why OpenDX’s equivalent of the “print” statement is the Describe module Attach the Describe module to the output port of any module that is providing a field and Describe will give you a summary of what the module is providing in the Message Window.

89 Debugging

90 Scientific Visualization lots of info on the web we have some introductory pages at –http://sciviz.aict.ualberta.cahttp://sciviz.aict.ualberta.ca lots of info on the web we have some introductory pages at –http://sciviz.aict.ualberta.cahttp://sciviz.aict.ualberta.ca


Download ppt "Introduction to OpenDX Jon Johansson Academic Information and Communication Technologies November 20, 2006 Jon Johansson Academic Information and Communication."

Similar presentations


Ads by Google