Subsections

38.2 xflash3: A Widget Interface to Plotting FLASH Datasets

The main interface to the fidlr3.0 routines for plotting FLASH datasets is xflash3. Typing xflash3 at the IDL command prompt will launch the main xflash3 widget, shown in Figure 38.1.  

IDL> xflash3
xflash3 produces colormap plots of FLASH data with optional overlays of velocity vectors, contours, and the block structure. The basic operation of xflash3 is to specify a single output file (either checkpoint or plotfile) as a prototype for the FLASH simulation. The prototype is probed for the list of variables it contains, and then the remaining plot options become active.

xflash3 can output to the screen, Postscript, or a PNG image file. If the data is significantly higher resolution than the output device, xflash3 will sub-sample the image by one or more levels of refinement before plotting.

Once the image is plotted, the query (2-d data only) and 1-d slice buttons will become active. Pressing query and then clicking anywhere in the domain will pop up a window containing the values of all the FLASH variables in the cell nearest the cursor. The query function uses the actual FLASH data--not the interpolated/uniformly gridded data generated for the plots. Pressing 1-d slice and then left-clicking on the plot will produce a 1-d slice vertically through the point. Right-clicking on the domain produces a horizontal slice through the data.

Figure 38.1: The main xflash3 widget.
Image quickstart_xflash3_main

The widget is broken into several sections, with some features initially disabled. Not all options are available in all dimensions, or in this release of FLASH4. These sections are explained below.

38.2.1 File Menu

The file to be visualized is composed of the path, the basename (the same base name used in the flash.par file) with any file type information appended to it (e.g. 'hdf5_chk_') and the range of suffixes through which to loop. By default, xflash3 sets the path to the working directory from which IDL was started. xflash3 requires a prototype file to work on a dataset. The prototype can be any of the files in the dataset that has the same name structure (i.e. everything is the same but the suffix) and contains the same variables.

38.2.1.1 File/Open prototype...

The Open prototype... menu option will bring up the file selection dialog box (see Figure 38.2). Once a plotfile or checkpoint prototype is selected, the remaining options on the xflash widget become active, and the variable list box “Mesh Variables” is populated with the list of variables in the file (see Figure 38.3).

xflash3 will automatically determine if the file is an HDF5 or netCDF file and read the `unknown names' dataset to get the variable list. Some derived variables will also appear on the list (for example, sound speed), if the dependent variables are contained in the datafile. These derived variables are currently inoperable in 3-D.

Figure 38.2: The xflash3 file selection dialog.
Image fidlr_xflash_file_select

Figure 38.3: The xflash3 main window after a prototype has been selected, showing the variable list.
Image fidlr_xflash_vars

38.2.2 Defaults Menu

The Defaults menu allows you to select one of the predefined problem defaults. This choice is provided for the convenience of users who want to plot the same problem repeated using the same data ranges. This menu item will load the options (data ranges, velocity parameters, and contour options) for the problem as specified in the xflash_defaults procedure. When xflash3 is started, xflash_defaults is executed to read in the known problem names. The data ranges and velocity defaults are then updated. To add a problem to xflash3, only the xflash_defaults procedure needs to be modified. The details of this procedure are provided in the comment header in xflash_defaults. It is not necessary to add a problem in order to plot a dataset, since all default values can be overridden through the widget.

38.2.3 Colormap Menu

The colormap menu lists the colormaps available to xflash3. These colormaps are stored in the file flash_colors.tbl in the fidlr3.0 directory and differ from the standard IDL colormaps. The first 12 colors in the colormaps are reserved by xflash3 to hold the primary colors used for different aspects of the plotting. These colormaps are used for 2-d and 3-d data only. At present, there is no control over the line color in 1-d.

38.2.4 X/Y plot count Menu

The X/Y plot count menu specifies how many plots to put on a single page when looping over suffixes in a dataset. At present, this only works for 2-d data. Note, the query and 1-d slice operations will not work if there are multiple plots per page.

38.2.5 Plotting options available from the GUI

Various options are available on the xflash3 user interface to change the appearance of the plots.

38.2.5.1 File Options

The first section below the menu bar specifies the file options. This allows you to specify the range of files in the dataset (i.e. the suffixes) to loop over. The optional step parameter can be used to skip over files when looping through the dataset. For example, to generate a “movie” of the checkpoint files from initial conditions to checkpoint number 17, enter 0000 in the first suffix: box, and enter 0017 in the box following to. Leave the step at the default of 1 to visualize every output.

38.2.5.2 Output Options

A plot can be output to the screen (default), a Postscript file, or a PNG file. The output filenames are composed from the basename + variable name + suffix. For outputs to the screen or PNG, the plot size options allow you to specify the image size in pixels. For Postscript output, xflash3 chooses portrait or landscape orientation depending on the aspect ratio of the domain.

38.2.5.3 Parallel Block Distribution Options

A plot of the parallel block distribution on the physical domain can be created. To use this feature, select the “Enable" toggle button located in the “Parallel Block Distribution" row of the xflash GUI. If more than one processor has been used to generate the simulation results, the different levels of refinement in the simulation can then be selected from a drop down menu. The menu shows which processors hold which blocks at a given level of refinement. Each processor is denoted by a unique color. Additionally, the processor number can be superimposed on the plot by selecting the ”Show Plot Numbers“ checkbox.

38.2.5.4 Mesh Variables

The variables dropbox lists the mesh, or grid variables stored in the `unknown names' record in the data file and any derived variables that xflash3 knows how to construct from these variables (e.g. sound speed). This selection allows you to choose the variable to be plotted. By default, xflash3 reads all the variables in a file in 1- and 2-d datasets, so switching the variable to plot can be done without re-reading. At present, there is no easy way to add a derived variable. Both the widget routine (xflash3.pro) and the plotting backend (xplot#d_amr.pro) will need to be told about any new derived variables. Users wishing to add derived variables should look at how the total velocity (tot_vel) is computed.

38.2.5.5 Options

The options block allows you to toggle various options on/off. Table 38.1 lists the various options available.


Table 38.1: xflash3 options
log Plot the base-10 log of the variable.
max When a sequence of files is defined in the file options, plot the maximum of the variable in each cell over all the files.
annotate Toggle the title and time information on the plot.
show ticks Show the axis tick marks on the plot.
abs. value Plot the absolute value of the dataset. This operation is performed before taking the log.
show blocks Draw the zone boundaries on the plot.
colorbar Plot the colorbar legend for the data range.

38.2.5.6 Data Range

These fields allow you to specify the range of the variable to plot. Data outside of the range will be set to the minimum or maximum values of the colormap. If the auto box is checked, the limits will be ignored, and the data will be scaled to the minimum and maximum values of the variable in the dataset.

38.2.5.7 Slice Plane

The slice plane group is only active for 3-d datasets. This option allows you to select a plane for plotting in ($ x$-$ y$, $ x$-$ z$, $ y$-$ z$).

38.2.5.8 Zoom

The zoom options allow you to set the domain limits for the plot. A value of -1 uses the actual limit of the domain. For 3-d plots, only one field will be available in the direction perpendicular to the slice plane. The zoom box button puts a box cursor on the plot and allows you to select a region to zoom in on by positioning and resizing the box with the mouse. Use the left mouse button to move the center of the zoom box. Use the middle button to resize the box. Finally, right-click with the mouse when you are satisfied with the zoom box selection. (Note that you must choose the ”Plot“ button again to see the results of the selected zoom. The reset button will reset the zoom limits.

38.2.6 Plotting buttons

Several buttons are located at the bottom of the xflash3 user interface which pop up additional windows. Most of these set additional groups of options, but the actual commands to create plots are located on the bottom row.

38.2.6.1 Contour Options Button

This button launches a dialog box that allows you to select up to 4 contour lines to plot on top of the colormap plot (see Figure 38.4). The variable, value, and color are specified for each reference contour. To plot a contour, select the check box next to the contour number. This will allow you to set the variable from which to make the contour, the value of the contour, and the color. This option is available in 2-d only at present.

Figure 38.4: The xflash3 contour option subwidget.
Image fidlr2_xflash_contour

38.2.6.2 Vector Options Button

This button launches a dialog box that allows you to set the options used to plot vectors on the plot (see Figure 38.5). This option is usually utilized to overplot velocity vectors. First select the plot vectors checkbox to enable the other options. Choose the variables to generate vectors with the x-component and y-component pull-down boxes. These choices are set to velx and vely by default. typical vector sets the vector length to which to scale the vectors, and minimum vector and maximum vector specify the range of vectors for which to plot. xskip and yskip allow you to thin out the arrows. This option is available in 2-d only.

Figure 38.5: The xflash3 velocity option subwidget.
Image fidlr2_xflash_vel

38.2.6.3 Particle Options Button

This button enables the user to set options for plotting particles. Since particle-handling routines are not present in this release of FLASH4, this option is disabled in xflash3.

38.2.6.4 Histogram Options Button

This button pops up a dialog box that allows you to set the histogram options. Currently, only the number of bins and the scale of the $ y$-axis can be set. This option is disabled in this release of FLASH3.

38.2.6.5 Floating Label Button

This button pops up a dialog box that allows you to add annotation to the plot. First select the use floating label checkbox to enable the other options. Choose the size of the text in pixels, the thickness of the font, and the color of the text. Also select the relative position on the screen. The multiple plots button allows different annotation to be placed on each of plot displayed.

38.2.6.6 Plot Button

Create the colormap plot after selecting the desired options described above. The status of the plot will appear on the status bar at the bottom.

38.2.6.7 Histogram Button

Create a histogram of the data. This option is disabled in this release of FLASH3.

38.2.6.8 Query Button

The query button becomes active once the plot is created. Click on Query and then click somewhere in the domain to generate a popup window listing the data values at the cursor location (see Figure 38.6). Use the Close button to dismiss the results.

Figure 38.6: The xflash3 query widget, displaying information for a cell.
Image fidlr2_xflash_query

38.2.6.9 1-d Slice Button

This button is available for 2-d and 3-d datasets only. Clicking on 1-d Slice and then left-clicking in the domain will plot a one-dimensional slice of the current variable vertically through the point selected. A right-click will produce a horizontal slice. This function inherits the options chosen in the Options block.