Filter Script Functions
Filter expressions can quickly become fairly complex and tedious, especially when longitudinal ranges span 0°. Functions are our saviours in this regard.
To call a function in the filter script, you enter the function name followed by an opening parenthesis '(', followed by one or more arguments separated by commas, and complete the function call by appending a closing parenthesis ')'. For example,
InSign(Mars, Aries)
Some points regarding the above example follow.
- The function name is InSign and the function requires 2 arguments to be passed to it.
- The first argument is the name of the body (object) and the second is the name of the sign (object).
- The InSign function returns a boolean value (either true or false), just as the comparison and logical operators do.
- If Mars is in Aries then true will be returned and the event will be added to the table of events. If Mars isn't in Aries then false will be returned and the event will not be added to the table of events.
- Expressions like
InSign(Mars, Aries) || InSign(Mars, Libra)
are possible because the InSign function returns a boolean value and, therefore, can be used as an operand (LHS or RHS of a logical operator).
The functions that are available when writing filter expressions all return a boolean value. The list of available functions follows.
- IsAspecting(InnerBody, OuterBody, Aspect, Orb). To require Mars to be making an aspect of 120° with Jupiter within an orb of 3°, use
IsAspecting(Mars, Jupiter, 120, 3)
. - IsParallel(InnerBody, OuterBody, Orb). To require that the Moon is parallel with the Sun within an orb of 0.5°, use
IsParallel(Moon, Sun, 0.5)
. - IsContraParallel(InnerBody, OuterBody, Orb). To require that the Moon is contra-parallel with the Sun within an orb of 1°, use
IsContraParallel(Moon, Sun, 1)
. - InSign(Body, Sign). To require that Mars is in Aries, use
InSign(Mars, Aries)
. - InRange(Body, StartLongitude, EndLongitude). To require that the longitude of Venus is in the range 200° to 215°, use
InRange(Venus, 200, 215)
.