|
|
Column calculator tool
This page aims at describing how ColumnManipulations required for the demo are obtained in the AVO prototype interface.
GUI
1. Once you loaded one or several catalog planes, right click on the plane you are interested in, and select Add new column
2. A new window will pop up. Enter the name of the new column. You may also want to enter the UCD and the unit.
3. The syntax for expressing the new column value is quite similar to the one used for the filters (filters documentation is available here).
Basically, ${col} will point out the column whose name is col.
Under the expression textfield, there are several buttons reflecting all fields of the chosen catalog plane. Pressing one of this button will write the corresponding name into the expression textfield.
You can use the traditional arithmetical operators : + - * / ^, as well as the following functions : sin, cos, tan, log (base 10 logarithm), ln (natural logarithm), abs (absolute value), deg2rad, rad2deg
Furthermore, you can use C-like ternary condition operator with the following syntax :
[condition statement] ? [expr1] : [expr2]
If the condition statement is evaluated to true, expr1 will be used to compute the new column, else expr2 is used.
eg:
${otyp}="Galaxy" ? 1 : -1
${Bmag}-${Vmag} > 0 ? ${Bmag} : ${Vmag}
Note that nested conditions are not supported.
The predefined expressions drop-list will give you examples of valid expressions.
4. Once you field out these fields, click on Add new column.
The new computed column will appear in the measurement frame at the end of the row
Script mode
This tool can also be used through a script command, which may be useful to integrate in a script.
The syntax of this command is:
adddcol( [plane index or plane name], [new column name], [ucd], [unit], [expression] )
You can refer to the plane either by its index (first plane at the bottom of the stack has index 1), or by its name
|
|