The equation parser is case insensitive and all braces get converted to parenthesis. Whitespace is ignored. Currently, you must explicitly state all multiplication operations (e.g. 5x will not work, but 5*x will). The modulus (%), AND and OR operators are not implemented yet.

The following table shows all currently supported scalars/special tokens.

SCALARS |
||

Scalar | Description | Example |
---|---|---|

F# |
File operator | f3 denotes third file |

# or #.# or .# |
Any integer or double. | 12, 3.14, .007 are all valid. |

band | Current band number | f1 * band |

line | Current line number | line + f1 |

sample | Current sample number | sample / line + f1 |

pi | Pi (3.14159...) | f1 > (e^pi) |

e | Euler's number (2.71828...) | f1 == ln(e) |

The following table shows all currently supported operators sorted by precedence (0 = highest precedence). All examples are valid equations that assume one or two files (F1, F2) are loaded. All angles are in radians, not degrees.

OPERATORS |
|||

Precedence | Operator | Description | Example |
---|---|---|---|

0 | { [ ( ) ] } | Parenthesis, brackets, or braces | f2*(f1+[30-{line/pi}]) |

1 | -- | Negative sign | --f1 + f2 |

2 | > | Greater than | f1 > f2 |

3 | < | Less than | (f1 < f2) / f2 |

4 | <= | Less than or equal | .505 <= f1 |

5 | >= | Greater than or equal | f1 * (f1 >= 101) |

6 | == | Equal to | f1 == (f2/2) |

7 | != | Not equal to | f1 != f2 |

8 | abs | Absolute value | abs(f2 - f1) |

9 | min | Minimum of Two DNs | f1 + min(5, f2) + min(f2, f3) |

10 | linemin | Minimum of DNs on the current line | f1 + linemin(f2) |

11 | cubemin | Minimum of a Cube | f1 + mincube(f2) |

12 | max | Maximum of Two DNs | 20 * max(f1,f2) |

13 | linemax | Minimum of DNs on the current line | f1 + linemax(f2) |

14 | cubemax | Minimum of a Cube | f1 + maxcube(f2) |

15 | sin | Sine | f1 * sin(123/321) |

16 | cos | Cosine | cos(.02*50) |

17 | tan | Tangent | tan(f1/f2) |

18 | csc | Cosecant | 12.3 + csc(f1) |

19 | sec | Secant | sin(pi/60) + (sec(f2))^2 |

20 | cot | Cotangent | line + cot(f1) - 42 |

21 | asin | Arcsine | 0.006 ^ asin(f1*5) |

22 | acos | Arccosine | acos(1/[2*pi]) |

23 | atan | Arctangent | atan(f1/e) |

24 | atan2 | Arctangent2 | atan2(--10 5.5) |

25 | sinh | Hyperbolic sine | 55 + sinh(f2) |

26 | cosh | Hyperbolic cosine | cosh(sample^pi) |

27 | tanh | Hyperbolic tangent | tanh(f1) |

28 | log or ln | Natural log | ln(abs(1/[f2-f1])) |

29 | log10 | Log base 10 | 99 + log10(f1-160) |

30 | sqrt | Square root | sqrt(abs[1000 - f2]) |

31 | << | Left shift. Note: pixel shift, not bitwise |
f1 << 250 |

32 | >> | Right shift. Note: pixel shift, not bitwise |
f2 + (f1 >> 500) |

33 | ^ | Exponent | f1 ^ 3 |

34 | * | Multiplication | 10 * f1 |

35 | / | Division | f2 / f1 |

36 | + | Addition | 123 + 0.004 + f1 |

37 | - | Subtraction | 10 - (--f1) |