The Data Analysis and Visualization Package for Swift/Swifter

Written by Mark Lewis with support from a NASA AISRP grant (Hal Levison PI)


1/19/2015 - The page has now been translated to Ukranian and Russian courtesy of SciPosts.

10/27/2011 - It has been a while since the last update. Apparently someone has done a translation of the page. View this page in Romanian courtesy of azoft

9/1/2009 - Version 0.3.0 has been posted. There are lots of changes and bug fixes in there. The biggest change, and the reason for going to a higher version number, is the addition of streams.

3/26/2009 - We have started making a Wiki for SwiftVis so that users can contribute to the documentation. You can find the Wiki at http://swiftvis.wikidot.com

9/4/2008 - An updated JAR of 0.2.2 has been uploaded. It is file compatible with the old version. It now accepts format strings ending with d, o, or x for doing conversions of integers. Note that the conversion from double to int is a truncation. So now the format string %,d will give you an integer with proper localized separators inserted.

8/11/2008 - Version 0.2.2 has been posted. This has a lot of little upgrades and bug fixes. One thing you should notice is that drawing big plots will go a bit faster. There is also a non-linear fit filter to complement the linear fit filter. If you need to fit a linear function the linear fit filter will be more efficient, but the non-linear fit filter gives you the power to fit just about any function you want. It does help to have a decent guess of what the solution. A basic implementation of 3-D graphics has also been added. This is an early implmentation and more features will be added over time. We welcome feedback and suggestions. If you find bugs please report them so they can be fixed quickly. There is a tutorial on 3-D graphics in SwiftVis to help you get started.

1/7/2008 - Version 0.2.1 has been posted. There are a few significant new additions to this. The biggest one comes from a user request to be able to process lots of files without using the GUI. So there is now a batch processing option in SwiftVis. There are two different options for batch processing. You can read more on the new tutorial. For pulling data from multiple files into SwiftVis in a different way a new filter has been created called the Input Collection filter. This filter keeps track of the elements that come into it over several changes of the input. You can learn more about how to use it in a small tutorial. Along with a number of small enhancements, a PKDGRAV source has been added. This source doesn't currently support the tipsy format. Provide feedback if you would like that added. A new feature was added to formulas that is discussed in a new tutorial dealing with how to make movies that incorporate multiple parallel data sets.

9/2/2007 - Version 0.2.0 has been posted. This version includes more changes in the code behind the scenes than in what you are going to be using. The majority of the changes have been made to the plotting aspects of the code. The primary 2-D plotting routines were significantly refactored. This has also led to changes in the way the layout for complex plots works. Several pages of documnetation has been updated to reflect these changes (plot page, bin.dat tutorial). You should consider reading through one of them. By making these changes we were able to add some new functionality to plotting. This includes the ability to vary the sizes of rows or columns in grids of plots as well as the ability to make axes use log scales. Minor axis tick marks have also been put in. A new filter has been added that will help you produce a surface grid from sparse scatter data. It is called the interpolated surface filter. Lastly, some enhancements have been made to the scripting that was added in the last update. These allow you to use an external editor and to read from binary files, including those with Fortran formatting.

See older update items here.

Download jar file. Download the file this link points to to get the most recent version of SwiftVis. It is an executable JAR file. From the command line run "java -jar SwiftVis.jar". If you find that you are running out of memory you can use the -Xmx option. This code has been updated to use features of Java 6. You should have a version of it installed to run SwiftVis. If not, go here to get one (you only need the JRE unless you want to develop new components). At the time I'm writing this, Apple hasn't released Java 6 for the Mac so you'll have to use a version of SwiftVis prior to 0.2.0 or run SwiftVis on a non-Mac. In Windows you can simply click on the JAR file icon (but don't tell Hal you are running Windows). If you have a machine with 1+ GB of RAM and are willing to have SwiftVis use quite a bit of it (or if you get OutOfMemoryErrors otherwise) then use the -Xmx option. Placing -Xmx1000M before the -jar will allow Java to grow up to 1GB of memory if needed. You can go higher as well. As a rule of thumb, you can give Java about 70% of your system RAM safely. Going above that can lead to heavy swapping which will slow your machine down significantly. If you typically run a lot of other processes on the machine you might want to limit Java to 50% of your machine memory.

Check out the SwiftVis Wiki at http://swiftvis.wikidot.com

If you want to find an older version of SwiftVis, look for the JAR file here. In some implementations of Java you might also find that you get better performance if you use the -server option.

SwiftVis is an open source work in progress. If you find bugs or want to make contributions just contact me at mlewis@trinity.edu. Do not upgrade to a newer version of SwiftVis lightly. You should probably keep your older JAR file around. The reason is that if the data in certain elements has changed, your previous saved files and templates will likely be invalid in the newer version.

This documentation is available as a gzipped tarball here.

SwiftVis is a data analysis and visualization package that was written primarily for use with Swift and Swifter. However, the package also includes general functionality and expandability so that it can be used with other types of data as well (for example it has been used with planetary ring data). It has been written in Java to allow it to be usable across many platforms.

The SwiftVis package is built on the fundamental design of having data sources that connect through multiple filters to process elements of data and which go to plots that display the data. Individual elements contain vectors of parameters and values. Below are lists of the sources, filters, and plot styles that are part of the normal SwiftVis application. Others can be created by users to fill more specific needs. Users can submit these to the main package so that others can have access to them as well. The main SwiftVis environment is broken into two regions, one that shows a graph of the connected sources, filters, and plots, and a second that shows the properties of the element selected in the graph. A sample session in SwiftVis is shown below with the plot that is being generated.

The flexibility provided by the design of SwiftVis is significant, but as a result there can be a bit of a learning curve. For that reason, we provide some basic information and a number of tutorials that walk you through the steps of doing various things with SwiftVis.

Elements and SwiftVis basics

Basic bin.dat tutorial

Color models in plots

Binning and surface plots

Movies of evolution

Using discard information

Labels and formatted text

Considering initial conditions

General data files

Plotting functions (sequences and function filters)

Finding Particles in Resonance (*** Bill and Luke *** This is a draft so you can see how I'm thinking you could do this.)

Linear Fit Filter

Tips on reusing work and templates

Clickable tools

Using SVScheme

Options and Configurability (making your own sources, filters, and data sets)

Editing elements in a spreadsheet type of way

Histograms and Bar Plots

3-D Plotting

Automatic Processing

Batch Processing

Input Collection Filter

Box Car Filter

Element Split Filter

Making Movies from Multiple Parallel Inputs

Feedback and Bugs


Swift binary position data - This source reads in the primary output file from Swift

Swift discard data - This source reads in the discard data from Swift

Swift dump data - This source will read in the various dump files from Swift if all you need to analyze is the last timestep of a simulation.

Swift encounter data - This source reads in the encounter data from Swift

General data files - This allows the reading of virtually any text or binary file.

SPH source - A source to read in SPH binary data files.

Sequences - This source does not read a file, but instead produces a linear sequence of values that can be passed through filters without forcing users to create simple "dummy" files.

Scheme source - This source allows you to write SVScheme code to read in data from files and make SwiftVis elements from them. See Using SVScheme for usage details.

Fixed 2D binned source - This source reads in C style binary data files for data that is already binned.

Particle 2D binned source - This source reads in C style binary data files for data binned by particle instead of spatial location.

Cart and Rad Source - This reads a C style binary file that contains a binary dump of particle positions and radii.


Selection filter - This filter selects elements of the first source into it based on certain conditions provided by the user.

Thinning filter - This filter is designed to do more uniform cutting down of data. This can help you get a quick view of information without the overhead of processing all the data in a source.

Key selection filter - This another selection filter, but this one is intended to select items from one file based on values in another file.

Function filter - This filter will transform data using user specified functions. It can also be used to merge two parallel data sets into a single collection.

Coordinate conversion filter - Will convert from orbital elements to heliocentric and back. Also includes conversions for barycentric coordinates and guiding center coordinates used in local ring simulations.

Merge filter - This filter simply takes two or more data sets and produces and single one that is the concatenation of the two.

Mass filter - this filter adds masses from a planets data file to the elements read in from a Binary Position source. Can add elements for the central star.

SyMBA Mass filter - this filter will add mass and merger information to a Binary Position source.

Sort filter - This filter will sort all elements based on a specified formula or value.

Binned filter - This filter will produce hystogram-like data from a data set in multiple dimensions.

Movie filter - This filter lets through a window of data from the source. It has functionality so that you can easily have the window move through the data. This can be used for seeing how a system evolves over time.

Scheme filter - This filter allows you to write SVScheme code that does filtering of data. See Using SVScheme for usage details.

Group numbering filter - This is mainly for if you are pulling in outside data sets where the data is in groups but elements of the groups aren't numbered. It also numbers the groups themselves.

Wake peak filter - As one might guess from the name, this filter was intended to be used with planetary ring simulation data to pull the locations of wake peaks out of a surface plot. It finds local maxima along slices through a data set so could be used with other data as well to find things like points of maximum eccentricity for a particle.

Region selection filter (Listener) - This filter selects a rectangular region by only taking elements that fall in a certain range in two dimensions. It is also a listener so it can be set up to take click input from plots and move the viewing region or zoom in accordingly.

Slice selection filter (Listener) - This filter selects elements within a certain distance around a slice through the dataset. Slices are made in a 2-D space either vertically, horizontally, or along an arbitrary segment. Data is enhanced with the distance from and position along the slice. This is a listener so slices can be located by clicking on plots.

Rotation Filter (Listener) - This filter allows you to transform data through rotations or other transformations. It takes input as a listener to facilitate the usage.

Element Table Editor - Provides spreadsheet like abilities for quick tasks.

Count Rebin Filter - This will re-bin data along groups. You get to specify how much data should go into each of the new bins.

Linear Fit Filter - Does linear fits to data. This actually adds in two filters. One that outputs the fit parameters and another that outputs the fit values.


Statistics Sink Listener - This sink will provide statistics on the inputs it has including min, max, and std for each parameter and value. It is also a listener and will record the location of clicks in a text area that can be copied from.


Plot element - This is the element that you place in the graph. It has many options of its own in addition to being able to display multiple different plot styles.

Scatter plot - This is a standard plotting style set in the general 2-D SwiftVis plotting mechanism.

Rectangular surface - This is for basic surface plots. It is intended to be used with a binned filter.

Orbit plot - This will draw out the orbit of the bodies. It assumes the input is in the orbital elements of a Swift file.

Vector field - This style plots positions and lines off them to show vector fields.

Scheme style - This is a plot style that lets you write SVScheme code that will do custom plotting for you. See Using SVScheme for usage details.

Image adder - This plot style will add a scaled image into a plot. It is a handy way to add outside graphics into a plot, or even just to put axes on images created with other tools.

Streamlines - This plot style was developed for some work in ring dynamics. It basically connects points in a data set. This behavior can be mimicked with a group numbering filter and a scatter plot.

General surface - This was also developed for ring dynamics, but also serves as a more powerful form of surface plotter. While it can be used with a binned filter in the same way that a rectangular surface can, it has the ability to make the regions of the surface non-rectangular and can also plot up to three data sets on one surface.

Iso Line Surface - This draws lines of constant value across a surface. It can be overlaid on a rectangular surface, a general surface, or just drawn alone.


Slovakian translation created by Sciologness Team

This page was last updated on September 4, 2008 2:26 PM .