Key Selection Filter

Key Selection Filter

Short Description: Selects elements from one source based on a condition from a different source
Threaded: Yes
Memory Usage: Light
Supports Streams: Yes

This filter is intended to be used with multiple inputs to do selections. It was born from a desire by users to be able to have a 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 Jupiter. If it is true, then the data formula is evaluated 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 element 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 selected 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].

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