KeySelectionFilter

Description - As the name implies, this type of filter selects data elements based on certain criteria, like its cousin the basic Selection Filter. However, this filter is intended to be used with multiple inputs. It was born from a desire by users to be able to have discard file and select all of the particles that collide with a particular body. For example, you want to take a discard file and a bin.dat file and select from the bin.dat only the particles that wound up colliding with Jupiter.

The way this works is that you enter a boolean formula and a data formula for the data file you are using for the selection. In this case, the discard file. The boolean expression tells if that index in the selecting input should be used. In this example, it would be an expression asking if the body that was hit was Juptier. If it is true, then the data formula is evalutated to produce a "key". For this example, the "key" would be the particle number that ran into Jupiter. The first step is that the entire selecting input has is run through and all the keys are collected. The user also provides a formula for the selected input that needs to match the keys. The filter then passes through the selected input and every index for which the selected formula matches a stored key, that element is kept. In the example, the selected data formula would simply be p[0], the number of the particle in the bin.dat input.

The user specifies which input is the selecting input just with the formulas. The one that is being selected must also be specified with a drop box. If the first input is for selecting, then the boolean formula and the key formula should use d[0] while the key matching formula should use d[1].

Inputs - This filter accepts multiple inputs that can be used in the selection formula, but only passes on the elements from one of the inputs. The user can specify which one.

Elements - These match the format of the selected input.

Memory - Because this filter does not alter elements, it only has to keep references to the elements of the first input that it is passing through. It also typically reduces the number of elements significantly. However, it should be noted that using this filter with a large source as the first input and a formula that accepts nearly all elements will negate the buffering that the large source might do.