Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 803
News FAQ
Search Home


next up previous
Next: Constants Up: NOTE 223 - Lattice Expression Language Previous: Introduction


Expressions

A LEL expression can be as simple or as complex as one likes using the standard arithmetic, comparison, and logical operators. Parentheses can be used to group subexpressions.
The operands in an expression can be lattices, constants, functions, and condition masks. lattice regions and masks. E.g.

  lat1 + 10
  lat1 + 2 * max(lat2,1)
  amp(lat1, lat2)
  lat1 + mean(img[region1])
  lat1 + mean(lat2[lat2>5 && lat2<10])

The last example shows how a boolean expression can be used to form a mask on a lattice. Only the pixels fulfilling the boolean condition will be used when calculating the mean.


In general the result of a LEL expression is a lattice, but it can be a scalar too. If is is a scalar, it will be handled correctly by C++ and glish functions using it as the source in, say, an assignment to another lattice.


LEL fully supports masks. In most cases the mask of a subexpression is formed by and-ing the masks of its operands. It is fully explained in a later section.

LEL supports the following data types:

Bool
Float
single precision real (which includes integers)
Double
double precision real
Complex
single precision complex
DComplex
double precision complex
All these data types can be used for scalars and lattices.
LEL will do automatic data type promotion when needed. E.g. when a Double and a Complex are used in an operation, they will be promoted to DComplex. It is also possible to promote explicitly using the conversion functions (FLOAT, DOUBLE, COMPLEX and DCOMPLEX). These functions can also be used to demote a data type (e.g. convert from Double to Float), which can sometimes be useful for better performance.

Region is a specific data type. It indicates a region of any type (in pixel or world coordinates, relative, fractional). A region can only be applied to a lattice subexpression using operator [].



Subsections
next up previous
Next: Constants Up: NOTE 223 - Lattice Expression Language Previous: Introduction
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2004-08-28