# Tag Info

## Hot answers tagged visualization

22

If your only worry is file size, then you want binary files. For an illustrative example, lets assume you are writing 1 double precision floating point number to a file. Let's assume that the file system can handle this perfectly and holding the file, headers, and padding are all 0. For a binary file, that number would take the exact size of the number in ...

16

The easiest way I could find to subtract two fields from different VTK files with the same structured grid is to use a programmable filter in Paraview, which lets you manipulate data using Python scripts. In the programmable filter dialogue box, you can subtract the two arrays and write to output with the code: phi_0 = inputs[0].CellData['Phi'] phi_1 ...

16

In practice, you rarely need data in visualization files that's more accurate than, say, 3 valid digits. In that case, ASCII is -- maybe surprisingly -- often more compact than binary form. If you're thinking about archiving, then bzip-ing these ASCII files is likely going to yield the smallest files you can get. That said, Paraview reads VTU format which ...

10

Here I have an example: x = linspace(-5,5,100); y = linspace(-5,5,100); z = linspace(-5,5,100); [X, Y, Z] = meshgrid(x, y, z); Ex = sin(2*pi/5*Z); Ey = 0*X; Ez = 0*X; [Bx, By, Bz, V] = curl(X, Y, Z, Ex, Ey, Ez); Eplot = 0*x; Bplot = 0*x; for i=1:100 %% Integration-like procedure Eplot(i) = mean(mean(Ex(:,:,i),1),2); Bplot(i) = mean(mean(By(:,:,...

9

I think the speed and simplicity of visualizing data is largely dependent on how fluent you are with visualization tools and preprocessing tools. I'm a big advocate of scripting for this purpose, because you can figure out how to do a task once and then copy and repurpose the script on similar tasks, which saves you time. For visualization, it really ...

9

I doubt there is a standard tool/technique for this kind of task. Nevertheless, there are some approaches. You would need at least one of the following strategies, according to ref. 1 (ch. 8): dimension subsetting: selecting some of the dimensions to display. dimension reduction: transforming the data into a lower-dimensional dataset. dimension embedding: ...

9

Since your figure is a closed loop, its parametric curves $x(t)$ and $y(t)$ must be periodic functions. This suggests one way to generate such figures, by constructing random smooth periodic functions $x(t)$ and $y(t)$ via summation of sinusoids/harmonics with randomized amplitude and phase. Unfortunately, it would be difficult to guarantee such a figure ...

8

I would suggest that a full database may be overkill for your purposes, though it would certainly work. Even $5 \cdot 10^5$ rows should be no more than around 25mb of data. I would strongly recommend doing the analysis/plotting/etc with the same tool that you will use for querying your data. It is my experience that when changing what to analyse only takes ...

8

[I took your sample program as a starting point and adapted Colormap Normalization from the matplotlib wiki.] Almost everything of the picture just looks red. Indeed. They problem is that there is a very narrow divergence in your data and because the colormap is scaled linearly almost all of the plot will be mapped to the lower limit of the colorbar. Q ...

8

You can try Geogebra (it is free). With SolveODE command and sliders you can do what yo want. For the usage of SolveODE command see. For example by using following command SolveODE[ <f'(x, y)>, <Start x>, <Start y>, <End x>, <Step> ] with SolveODE[A + B y + C sin(y), l, m, 10, 0.1] I got the solution curve below. You can vary ...

7

Have you had a look at VMD? I used it ages ago to produce movies from simulation snapshots. Way back then, it could read a sequence of PDB files, render them (or generate POV-Ray scripts to raytrace them), and store them as individual images. I then used mencoder to generate MPEG-4 files out of the stills. Those were the days. I haven't used VMD since, but ...

7

I think you could use the "marching cubes" algorithm. If memory serves, it requires a grid of samples as input, so at the very least you should be able to sample your function and run the algorithm as-is. You also might be able to modify the algorithm to callback to f directly. There's a popular implementation at http://paulbourke.net/geometry/polygonise/ ...

6

Gnuplot does a good job here. You might also try this command line interface to Matplotlib. The interface of the latter resembles that of GNU plotutils, which gives you a third alternative.

6

The selection of colormap should be based on your dataset and audience, e.g., you do not want to use a colormap that have some cultural background for a group of people. Also, if your images are going to be printed (in grey scale), you should consider using a colormap that will preserve the ordering after the color transformation. Then, you should take into ...

6

I'd venture the guess that most people in computational science use either Visit or Paraview for flow visualizations. These are simply the two most widely used programs I use. It's true that there is a bit of a barrier in the beginning, but my students are quite proficient after using it for a class period or two. If you want to see an interactive ...

6

Problem Formulation I can't guarantee that this is a perfect (or smallest-possible) formulation of the problem, but maybe it will help guide a better one. The road network is a directed graph consisting of intersections (nodes) connected by roads (edges). As input information, assume that you have an adjacency matrix $\mathcal{A}$ enumerating the edges. $\... 5 It's pretty hard to do what you want to do. The method that comes to mind for me is to first calculate a "'blue noise" point distribution on your mesh, then take the bin cells to be the Voronoi regions of those points. Here is a paper that talks about computing such point sets. An easier approach is to simply choose the barycenter of each triangle (average ... 5 I highly recommend using a tool such as Sumatra for this. I used to have a similar "pedestrian" approach to yours for keeping track of many simulation runs with varying parameters, but in the end it just becomes a huge mess because it's next to impossible to design such an ad-hoc approach correctly upfront and to anticipate all the use cases and extensions ... 5 The program VisIt can do plots of tensor ellipsoids, but I don't think it has anything for hyperstreamlines. While it does make nice plots, I've found VisIt hard to install, if not impossible on some platforms; I know people who have been desperate enough to set up a virtual machine for it, but I haven't done that myself. When it does work, I have found it ... 5 In addition to the voxel-based approach that rchilton suggests, you could also look at Delaunay-type algorithms. For example, the Computational Geometry Algorithms Library (CGAL) has some built-in functionality for surface mesh generation with examples here. You could also try distmesh, the essential idea of which has been ported to a number of other ... 4 I don't know about "in the bash terminal itself", but I use python scripting with Visit. See here or here for some examples. Below I have pasted a simple script I use to make an image of a 2D slice along y = 0.5 of a 3D cube. The script is named "script.py" and "ysolution" refers to a variable name with the .vtk file. # invoke like so: visit -cli -nowin ... 4 ParaView should be your best bet. I would try different versions as each behaves differently (go back as far as 3.12) You also need to make sure that parallel is switched on (New versions have a "Use Multi-core" checkbox in settings) You might need to compile your own version if you are unlucky (I had to do this once to get 64 bit headers working) 4 You would need to change the output format, but this sort of data (a layered graph) works well with graphviz, specifically dot. 4 I don't have time to get all the details down, but maybe this answer can give some helpful intuition. Basically, something that will work is taking the first$N$binary binary of your number in$[0,1]$and assigning them as the most significant digits for each of the$N$dimensions (so, the first decimal digit is the most significant digit in the first ... 4 For higher order elements, I refine each element a few times so I have more points to work with. If I just need to visualize the solution for myself. Let's use quadratic Lagrange elements as examples. You need the mesh data, points p and triangles t, also the numerical solution$u_h\$. For visualization purpose, we merely need the nodal values from the ...

4

This is actually a standard modeling problem if you consider the medium that flows through the network to be incompressible (e.g., liquids, or gases at low velocity). Then, you formulate everything in terms of fluxes (liters or kg per second) rather than in discrete parcels. The key realization is that the flux that goes into one end of the pipe equals the ...

4

Programs like Visit and Paraview can do "volume rendering", which is what you show in your figure. You just need to export the data you have in a format that either of these programs can read.

4

{Assuming you still need the code} Let A1.wrl is your wrl file. import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import re holder = [] with open("A1.wrl", "rb") as vrml: for lines in vrml: a = re.findall("[-0-9]{1,3}.[0-9]{6}", lines) if len(a) == 3: holder.append(map(float, a)) ...

4

Reading the Paraview python API, found the following solution to convert back and forth between VTKArray and numpy arrays. This uses the numpy_support and vtk.dataset_adapter modules : from paraview.numpy_support import vtk_to_numpy from paraview.vtk.dataset_adapter import numpyTovtkDataArray, vtkDataArrayToVTKArray import numpy as np # get paraview.vtk....

4

I agree that using the same color scale is generally good practice. Not doing so is confusing. Now, as you note, there are cases where this doesn't leave very much information in each picture. In such cases, you should at least make it clear in the caption that you are using different color scales for different panels of a figure.

Only top voted, non community-wiki answers of a minimum length are eligible