Bin.Dat Plotting Tutorial

The SWIFT application is a powerful tool. However, its output method lacks some visualization options. Indeed, that was why SWIFTVis was initially written. SWIFTVis has native support for SWIFT's bin.dat output files and provides a solid foundation for filtering, interacting with, and plotting the output provided by SWIFT. This is a short tutorial outlining how to go about reading in and plotting these files.

Reading in File

In order to read in a bin.dat file in standard SWIFT format, select Insert > Data Source and select "Binary Position". Then, pick the appropriate file format from the drop-down box and click "Select File". Select the file to be read, click "Open", and then click "Read File". SWIFTVis should now read the data in from your selected .dat file. This may take several moments depending on the size of your input file. Once the file has been read, you can verify the contents by checking the "Output" tab.



Now that we have loaded the data from the bin.dat file, we can begin plotting it. When it comes to plotting, we have two major options: 2-D plots and 3-D plots. However, due to the nature of the SWIFT output, 3D plotting is somewhat pointless. Therefore, we will explore a few basic 2-D plotting methods that may be done with the given data. The first thing to do, however, is to create what is known as a Movie Filter - a filter that allows us to select a subsection of its input data based on the timestep. By default, movie filters play nicely with Binary Position sources, so configuration is unnecessary. To create a movie filter, right-click on the Binary Position box, select Insert > Filter, and then pick "Movie Filter". Select the new Movie Filter to bring up the options pane on the right.


Select the "Show Control Frame" option. This will pop up a small window with a slider bar that will let us control our position in the data, allowing us to control the playback in the plot.


Next, we will add the actual plot. Since this is our first plot done with a bin.dat file, let's starting with a fairly common example: Semimajor Orbit versus Eccentricity. In a default SWIFT file in SWIFTVis, these are expressed as v[1] and v[2] respectively. So, let's create a plot off of the Movie Filter by right-click on it and selected Insert > Plot, then selected "Add Plot" in the new Plot's context pane. We will work with the default scatter plot generated with the new plot. Select the default scatter plot and change the values to reflect the following:


Common Problems

If you are having trouble getting SWIFTVis to read a given bin.dat file, it may be the case that it was output in a non-standard fashion. Try using the General Data filter with a custom input parser to handle the data.

If you are having slow load times or SWIFTVis is freezing when you ask it to read a file, it may be because of SWIFTVis's limited memory allocation. To change the amount of system memory available to SWIFTVis, select File > Edit Options from the top menu. Then, select the tab labeled "Misc." and change the Source Buffer Size in MB to a larger number.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License