Data browser


The data browser lets you look at the actual numbers in your loaded data file. Earlier versions of ChomboVis called this the "spreadsheet", but we have decided to call it a data browser, at least for now.

1. Data browser launcher

You get at the data browser by pulling down the "Tools" menu. Click on "Data browsers" and up pops a window that lets you select a component, a level and a box; one data browser (you can bring up more than one) displays all the data in one box, and for one component. (See below under "Mouse controls" for more ways to select a level and component.)

For a 3D dataset, we display the numbers one plane at a time. The radiobuttons opposite "normal:" are for selecting the orientation of that plane; the default is 'z', which means you get the x-y plane.

The "format:" entry field accepts strings of the sort you would pass to the first argument of the C printf function. Good choices typically end in 'f', 'e', or 'g'. If your data is mostly zeros, then 'g' is an especially good choice because it brings out your non-zero data.

The "synchronized" checkbutton enables several sorts of synchronization. Data browsers corresponding to the same box but different data components move their data planes together. Movements of the slicing plane (or, in 2D reslice mode, the reslice position) cause the databrowser to display the corresponding plane of data.

The "Picked particle" area appears if your dataset includes particles. See below under "particle picking" for more details.

The "Go" button brings up a data browser. You can bring up as many data browsers as you like. To see data for another component, select that component in the "Data selection" control (under the "Visualization" menu).

The fields labeled "hilite cell" are blank until you use the mouse to pick a cell, whereupon they display the picked cell's coordinate and value. See below about cell picking. If you started ChomboVis with "slices_off=1" on the command line, i.e. no data component has been loaded yet (a good way to begin if your dataset is huge), then picking will still display the picked cell's box and coordinates within that box, but not value of any field data component in that cell. To obtain such values, select, in the databrowser launcher dialog, one of the data components.

2. Data browsers

You might want to press the "Go" button (above) before reading on.

The data browser's title bar identifies the level and box of the data you see in there.

In the VTK rendering window, the edges of the box associated with your data browser are colored pink. Pink turns to dark red if you open another data browser; the box associated with the data browser that has the mouse focus is pink, while all the others are dark red.

2.1. 3D-specific features

A data browser for 3D data displays one plane of data at a time, as mentioned above. To move among the planes, either move the slider at the top left, or click on the tabs immediately below. You will see a semi-transparent red plane that corresponds to the currently displayed plane of data; move the plane-selection slider or choose another radiobutton opposite "normal:" to see this transparent plane change its position. You can turn the semi-transparent red plane off from a checkbutton on the data browser.

The data browser planes also move in response to changes in the position of the slicing plane (3D) or reslice position (2D reslice mode), if you have checked the "synchronized" checkbox on the data browser launcher.

3. Mouse controls

3.1. Box picking

As mentioned above, one data browser displays all the numbers for one component within a single box, and you can select that box with the sliders of the data browser launch window. The other way to select the box is with your mouse.

Place your mouse over the box of interest, and make sure the level that box belongs to has been selected in the "Data selection" control (under the "Visualization" menu). Now hold down "Ctrl" on your keyboard, and press the left mouse button. You have just "shot" a selector ray (a skewer as it were) through that box. In 3D mode you can rotate (left mouse-button, move mouse) the display a little to better see the selector ray. (In 2D mode you can't rotate.)

If you don't see the box you expected to see, double-check that you selected the appropriate level of refinement in the "Data selection" control, under the "Visualization" menu. It may also help to select "Bounding boxes" in the "Grids" control (as indeed we have done to create the picture above).

Notice that the "level" and "box" sliders of your data browser launcher now indicate the box highlighted in green.

The box you want may not be on the outside of your domain box (3D only), or (3D and 2D) may belong to another level than that of the currently-highlighted box. You can get to the box you want by holding down "Ctrl" on your keyboard and pressing the right mouse button; this cycles through all the boxes you have skewered. The order is, first, by increasing refinement level, and, second, by increasing distance from your viewpoint.

To turn off the selector ray, do a "Ctrl-middle-mouse-button" or "Ctrl-shift-left-mouse-button".

3.2. Cell picking

The selector ray and the data browsers are integrated so that you can conveniently find the numerical value corresponding to any cell in the render window. This feature works in both 2D and 3D mode, but as the 3D semantics are a little tricky, we will begin with 2D mode.

Thus, on a 2D file, open a data browser. Now place your mouse over any cell within the box the data browser corresponds to. Do a ctrl-left-button to turn on the selector ray. The box itself is highlighted in pink, and within the box, you have a blue highlight around the specific cell you skewered (you may need to zoom in to see it).

The corresponding cell of the data browser should also be highlighted. If it is not, make sure the data browser's box is the one that is highlighted. The highlighted box should be pink. If it is green, that means it is not the box the data browser is on. If you have more than one level visible, try cycling through the levels with ctrl-button-3. If that fails too, then look at the data browser launcher; its level and box scales will identify the box you have selected: compare that to the level and box numbers on the title bar of the data browser. If they do not match, go ahead and press the "Go" button on the launcher widget again; this will bring up a second data browser, this one corresponding to the box you have actually selected. If you now ctrl-left-button over the desired cell again, you should see a blue highlight in your new data browser.

The same sort of thing happens in 3D mode. It's trickier only because the selector ray, on its course through three-dimensional space, may be thought of as passing through many cells. Accordingly, we needed to impose a few rules to define which cell to actually highlight. The rules are as follows.

As mentioned earlier, the picked cell's coordinate and value are also shown in the data browser launcher widget. Thus it is not necessary to open an entire data browser at all, if all you need to do is check a few values here or there.

3.3. Particle picking

If your dataset has particles, and the particles are being rendered as glyphs (spheres or cones, but not mere points) the familiar ctrl-button1 motion will, subject to some limitations discussed below, pick a particle, if one is rendered under your current mouse position. That particle's value, along its various components, can be seen in the data browser launcher widget. To confirm which particle you have picked, ChomboVis draws a pale blue sphere around the picked particle's marker (sphere or cone).

Picking particles is at times a tricky business. If you do not see the pale blue sphere around your desired particle, then try zooming and perhaps rotating the scene so that the particle you want to pick stands fairly isolated -- away from other particles, and away from any grid lines. If you zoom in far enough, your particle might disappear; in that case reduce the position of the inner clipping plane (pull down "Tools", select "Camera parameters", and type something small into the first box to the right of "clipping range").

Sometimes you see the pale blue sphere, but it is around the wrong particle. At other times, the pale blue sphere does not appear at all, but instead ChomboVis draws the green highlight around one of your boxes: that means you hit a box boundary instead of a particle. If you keep hitting box boundaries, try turning them off (pull down "Visualization" and select "Grid detail").

Particle picking does not work at all -- you will get an error message -- if particle opacity is at anything less than 1.0. (This is because our method of calculating which particle was picked depends on an assumption about how VTK orders elements of rendered geometry, and setting particle opacity to less than 1.0 tends to scramble that ordering.)

4. Embedded boundaries

The databrowser can, optionally, blank covered cells and regular cells, as well as colorcode irregular cells. When you load an old-style embedded boundaries file (i.e. one with components names "fraction-0", "fraction-1", etc), databrowsers come up with buttons to control such blanking and coloring:

If, however, you are working from a new-style embedded boundaries file, you will not see this special databrowser interface unless your file provides, for each boundary, a special data component that tells ChomboVis which cells are covered, regular and irregular.

That component needs to be named __covered-n (that's two underscores) (where n=0,1,... indexes your boundaries), and the component must equal 0 on covered cells, 1 on irregular cells, and 2 on regular cells. If you like, you may define these __covered-n components at runtime, using c.reader.defineNewComponent().

If that is too restricting, you can use any other component (except one whose name begins with __covered-!) and any other encoding scheme, and call c.eb.registerCoveredCellsDiscriminator(). This function generates those __covered-n components for you.


ChomboVis Development Team