28 #ifndef TABLES_EXPRFUNCNODE_H
29 #define TABLES_EXPRFUNCNODE_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/TaQL/ExprNodeRep.h>
34 #include <casacore/casa/Quanta/MVAngle.h>
35 #include <casacore/casa/BasicMath/Math.h>
40 class TableExprNodeSet;
352 const vector<TENShPtr>& nodes,
378 std::vector<TENShPtr>&);
408 const std::vector<TENShPtr>&
operands,
428 const std::pair<int,int>& mvFormat,
436 const std::pair<int,int>& mvFormat);
451 static double angdist (
double ra1,
double dec1,
double ra2,
double dec2)
String: the storage and methods of handling collections of characters.
static Double string2Real(const String &)
Double getDouble(const TableExprId &id)
Double getScale() const
Get possible unit scale factor (needed for sqrt).
static double angdist(double ra1, double dec1, double ra2, double dec2)
Get the angular distance between two positions on a sphere.
String getString(const TableExprId &id)
void fillUnits()
Fill the result unit in the node.
static const Unit & makeEqualUnits(std::vector< TENShPtr > &nodes, uInt starg, uInt endarg)
Make the units of nodes from starg till endarg equal.
static String stringValue(const String &val, const String &fmt, Int width)
TaqlRegex getRegex(const TableExprId &id)
static std::pair< int, int > getMVFormat(const String &fmt)
Get the MVTime/Angle format and optional precision.
static String stringDateTime(const MVTime &dt, Int prec)
NodeDataType argDataType() const
static String stringValue(const MVTime &val, const String &fmt, Int width, const std::pair< int, int > &mvFormat)
@ sinFUNC
for Int, Double or DComplex returning Double or Complex
@ complexFUNC
for DComplex or String returning DComplex
@ isdefFUNC
for any array returning Bool scalar
@ stringFUNC
return values as strings
@ boolFUNC
for Int, Double, Complex or String returning Bool
@ angdistFUNC
angular distance returning radians
@ iifFUNC
special function resembling if statement
@ realFUNC
for Int, Double, DComplex, Bool or String returning Double
@ hmsFUNC
return angles as hms strings
@ arrsumFUNC
for Int, Double or Complex array returning the same
@ asinFUNC
for Int, Double or Complex returning Double or Complex
@ arranyFUNC
for Bool array returning Bool
@ arrmeanFUNC
for Int or Double array returning Double
@ rowidFUNC
special function returning Int row id (meant for GIVING)
@ arrayFUNC
for any type returning array of that type
@ shapeFUNC
for any array returning Int array
@ near2FUNC
for Int, or Double or Complex returning Bool (2 is with default tolerance)
@ conesFUNC
cone search functions, implemented in derived class
@ isnanFUNC
for Int, Double or DComplex array returning Bool
@ intFUNC
for Int, Double, Bool or String returning Int (using floor)
@ normangleFUNC
normalize angle between -pi and pi
@ rownrFUNC
special function returning Int row number
@ argFUNC
for Int, Double or DComplex returning Double
@ arrminFUNC
for Int or Double array returning Int or Double
@ nullarrayFUNC
masked array functions
@ hdmsFUNC
return angles as hms/dms strings
@ arrntrueFUNC
for Bool array returning Int scalar
@ imagFUNC
for Double or DComplex returning Double
@ ndimFUNC
for any array returning Int scalar
@ randFUNC
special function returning a random Double number
@ normFUNC
for Int, Double or DComplex returning Int or Double
@ dmsFUNC
return angles as dms strings
@ strlengthFUNC
for String
@ signFUNC
for Int or Double returning Int or Double
@ squareFUNC
for Int, Double or DComplex returning Int, Double or Complex
static String stringValue(Bool val, const String &fmt, Int width)
Convert a value to a string.
static String stringValue(Int64 val, const String &fmt, Int width)
const std::vector< TENShPtr > & operands() const
Some functions to be used by TableExprNodeFuncArray.
static String stringValue(Double val, const String &fmt, Int width, Int prec, const std::pair< int, int > &mvFormat, const Unit &unit)
DComplex getDComplex(const TableExprId &id)
static String stringAngle(double val, Int prec, MVAngle::formatTypes type)
Convert angle to a string (hms or dms).
static Int64 string2Int(const String &)
Read a string as an integer, double, complex or bool.
TableExprFuncNode(FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, const Table &=Table())
Constructor.
static String stringDT(const MVTime &dt, Int prec, MVTime::formatTypes)
Convert the date and/or time to a string.
Table table_p
(needed for sqrt)
static String stringValue(const DComplex &val, const String &fmt, Int width, Int prec)
static String stringDate(const MVTime &dt)
static NodeDataType checkOperands(Block< Int > &dtypeOper, ValueType &resVT, Block< Int > &vtypeOper, FunctionType, std::vector< TENShPtr > &)
Check the data and value types of the operands.
~TableExprFuncNode()
Destructor.
static Bool string2Bool(const String &)
static String stringDMS(double val, Int prec)
void fillChildNodes(const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper)
Link the children to the node and convert the children to constants if possible.
static String stringHMS(double val, Int prec)
FunctionType funcType() const
static void getPrintFormat(String &fmt, Int &width, Int &prec, const std::vector< TENShPtr > &operands, const TableExprId &id)
Get the possible print format, width, and/or precision.
static DComplex string2Complex(const String &)
void tryToConst()
Try if the function gives a constant result.
static String stringTime(const MVTime &dt, Int prec)
std::vector< TENShPtr > & rwOperands()
NodeDataType argDataType_p
MVTime getDate(const TableExprId &id)
Bool getBool(const TableExprId &id)
'get' Functions to get the desired result of a function
Int64 getInt(const TableExprId &id)
Abstract base class for a node having multiple child nodes.
std::vector< TENShPtr > operands_p
const Unit & unit() const
Get the unit.
NodeDataType
Define the data types of a node.
ValueType
Define the value types.
Class to hold multiple table expression nodes.
std::complex< Double > DComplex
this file contains all the compiler specific defines
LatticeExprNode acos(const LatticeExprNode &expr)
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
bool Bool
Define the standard types used by Casacore.
LatticeExprNode cos(const LatticeExprNode &expr)