edu.swri.swiftvis.filters
Class SelectFilter

java.lang.Object
  extended by edu.swri.swiftvis.filters.AbstractMultipleSourceFilter
      extended by edu.swri.swiftvis.filters.SelectFilter
All Implemented Interfaces:
DataSink, DataSource, Filter, GraphElement, java.io.Serializable

public class SelectFilter
extends AbstractMultipleSourceFilter

This class provides a way for the user to select specific elements from inputs. It supports multiple inputs for the selection expressions, but only elements from the first input are passed through. If you want elements strung together in serial you should use a MergeFilter. If you want them in parallel with elements that have some values from one input and some from others then a FunctionFilter can do the job. This filter has several "modes" of operation. The simplest one allows the user to type in a simple boolean expression. If that expression is true for a given index number then the element with that index from the first input is passed through. To quickly thin out a SWIFT file with a large number of particles you can use % operator in the expression with the particle number so p[1]%10==0 would only pass through every tenth particle from a SWIFT binary file. This is enhanced by working with what we call subsets (taking all elements that have the same value for a certain expression). You can toggle whether you want to use subsets or groups in a selection. To see the value of this, let's look at an example of doing a selection based with subsets but not using groups. You provide an expression like in the simple form as well as a subset expression. In this case it is not just single elements that are selected. Instead, all elements for which the provided subset expression match that of any matching element will be taken. This requires two passes through the data. First, the subsets that will be used are identified then all the elements in those subsets are selected. In SWIFT this can be used to select all particles which matched some simple expression at some time during the simulation. So the subset expression could be p[1] and if we only want particles whose eccentricity was greater than 0.3 the selection expression could be v[2]>0.3. Sometimes you want the selection to be based on a comparison of one element to another one. The normal expression model allows you do do this with an offset or using a fixed element to compare to. Sometimes you want the selection of element to be data driven. For example, you want to compare all the bodies in a given timestep to one particular body. To do this we use groups. For a group to be used, the input data must be sorted by the value you want things grouped by. In the example of comparing particles at a timestep, the time is what you would want it sorted by. A group is defined as all elements that have the same value of the sorted expression. A SortFilter can be used to choose different sort orders. The basic DataFormula class provides functionality for goring grouping. If you wanted to find instances where a particle was close to Jupiter and Jupiter had a particle ID of -2 then your special element selection would be p[1]=-2. If the expression doesn't pick a unique element in a group, the first one that satisfies it will be used. If no elements in a group satisfy it, the entire group is ignored. The values and parameters for the selected element are significied in the formula with primes (single quotes). So just comparing the difference between the semimajor axes might look like abs(v[1]-v'[1])<0.1. The subset formula can not involve the selected group member. If grouping is used without subsets in this case you would only get the elements for particles close to Jupiter at the time they were close to Jupiter. Combining it with a subset expression of particle ID would select the entire histories of any particles that had close encounters. If no element in a group matches the selection criteria then the entire group will be ignored. The selection filter can take more than one input, and formulas can refer to the other inputs. The data in the different inputs needs to be parallel to have meaning though and elements are only selected from the first input.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.swri.swiftvis.filters.AbstractMultipleSourceFilter
dataVect, inputVector, propPanel, sinkVector
 
Constructor Summary
SelectFilter()
           
 
Method Summary
 SelectFilter copy(java.util.List<GraphElement> l)
           
protected  boolean doingInThreads()
          Method implemented to inform the AbstractFilter whether the Filter is handling threading threading or if if the AbstractFilter should put the work into the ThreadHandler itself.
 java.lang.String getDescription()
           
 int getNumParameters()
           
 int getNumValues()
           
 java.lang.String getParameterDescription(int which)
          Tells you what a particular parameter is used for.
static java.lang.String getTypeDescription()
           
 java.lang.String getValueDescription(int which)
          Tells you what a particular value is used for.
protected  void redoAllElements()
          This method is intended to reprocess all the input elements to redo the output.
protected  void setupSpecificPanelProperties()
          This method should add any tabbed panes to the propPanel that are specific to the given filter.
 
Methods inherited from class edu.swri.swiftvis.filters.AbstractMultipleSourceFilter
abstractRedoAllElements, addInput, addOutput, clearData, drawNode, getBounds, getElement, getNumElements, getNumOutputs, getNumSources, getOutput, getOutputInfoPanel, getPaint, getPropertiesPanel, getSource, getSourceInfoPanel, localRedo, moveUpInput, redo, relink, removeInput, removeOutput, sourceAltered, toString, translate, validInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectFilter

public SelectFilter()
Method Detail

getDescription

public java.lang.String getDescription()

getTypeDescription

public static java.lang.String getTypeDescription()

setupSpecificPanelProperties

protected void setupSpecificPanelProperties()
Description copied from class: AbstractMultipleSourceFilter
This method should add any tabbed panes to the propPanel that are specific to the given filter. This is called when the propPanel is created. After it is called, the source and output info panels are added.

Specified by:
setupSpecificPanelProperties in class AbstractMultipleSourceFilter

getParameterDescription

public java.lang.String getParameterDescription(int which)
Tells you what a particular parameter is used for.


getValueDescription

public java.lang.String getValueDescription(int which)
Tells you what a particular value is used for.


getNumParameters

public int getNumParameters()
Specified by:
getNumParameters in interface DataSource
Overrides:
getNumParameters in class AbstractMultipleSourceFilter

getNumValues

public int getNumValues()
Specified by:
getNumValues in interface DataSource
Overrides:
getNumValues in class AbstractMultipleSourceFilter

copy

public SelectFilter copy(java.util.List<GraphElement> l)

doingInThreads

protected boolean doingInThreads()
Description copied from class: AbstractMultipleSourceFilter
Method implemented to inform the AbstractFilter whether the Filter is handling threading threading or if if the AbstractFilter should put the work into the ThreadHandler itself.

Specified by:
doingInThreads in class AbstractMultipleSourceFilter
Returns:
True if redoAllElements() is threaded; False if redoAllElements() should be threaded by AbstractFilter

redoAllElements

protected void redoAllElements()
Description copied from class: AbstractMultipleSourceFilter
This method is intended to reprocess all the input elements to redo the output. It must be properly implemented by all extending classes.

Specified by:
redoAllElements in class AbstractMultipleSourceFilter