VStar expression Language (VeLa) is a general purpose programming language that, within VStar, can be used to:
VeLa is a simple functional language with the following characteristics:
when
), iteration (while
)Here is the VeLa grammar specification (PDF).
Any text entry box in VStar that accepts a numeric value can instead receive a numeric VeLa expression.
Expressions such as 2457529.5-365.25*5
or today()-365.25*5
could be used as the minimum JD when loading a dataset from AID.
(obscode in ["CTIA" "SAH"] and band = "Johnson V" and uncertainty <= 0.01) OR (band = "Visual" and obscode = "BDJB")
This Boolean expression defines an observation filter in which:
Load eta Aquilae with a JD range of 2457529.5-365.25*5
to 2458259.5
and try this filter via View -> VeLa Filter...
This function defines a Fourier model obtained from a fundamental frequency of ~0.1393 (a period of 7.18) and two harmonics:
f(t:real) : real { 3.8893863 +0.1148971 * cos(2*PI*0.1392758*(t-2457506))-0.312022 * sin(2*PI*0.1392758*(t-2457506)) +0.0432131 * cos(2*PI*0.2785515*(t-2457506))-0.1196311 * sin(2*PI*0.2785515*(t-2457506)) +0.0370884 * cos(2*PI*0.4178273*(t-2457506))-0.0013007 * sin(2*PI*0.4178273*(t-2457506)) }
Applying DCDFT with Period Range to the eta Aql filtered observations above with a period range of 1 to 10 and a resolution of 0.01 will yield a period search top hit of 7.18.
In the future, modelling and period analysis plugins will be created to make use of such functions.
VeLa code can be entered into a dialog (Tools -> VeLa
) to test it before use in one of the contexts outlined above, e.g.
fact(n : integer) : integer { when n = 0 -> 1 true -> n*fact(n-1) } map(fact [1 2 3 4 5 6 7 8 9 10])
pi
e
A VeLa observation filter has access to the properties of the currently loaded observations, such as time/JD, magnitude, observer code, band, and any properties peculiar to a particular observation source.
A range of in-built functions are available in VeLa and categorised below.
EVAL (STRING) : LIST
CHR (INTEGER) : STRING
FORMAT (STRING LIST) : STRING
ORD (STRING) : INTEGER
TODAY () : REAL
PRINT(...)
PRINTLN(...)
NEXTCHAR () : STRING
APPEND (LIST ANY) : LIST
CONCAT (LIST LIST) : LIST
FILTER (FUNCTION LIST) : LIST
FOR (FUNCTION LIST) : ANY
HEAD (LIST) : ANY
LENGTH (LIST) : INTEGER
MAP (FUNCTION LIST) : LIST
NTH (LIST INTEGER) : ANY
REDUCE (FUNCTION LIST ANY) : ANY
TAIL (LIST) : LIST
ABS (INTEGER) : INTEGER
ABS (REAL) : REAL
SIN (REAL) : REAL
COS (REAL) : REAL
TAN (REAL) : REAL
ATAN2 (REAL REAL) : REAL
SQRT (REAL) : REAL
LOG (REAL) : REAL
LOG10 (REAL) : REAL
POW (REAL REAL) : REAL
EXP (REAL) : REAL
MIN (REAL REAL) : REAL
MIN (INTEGER INTEGER) : INTEGER
MAX (REAL REAL) : REAL
MAX (INTEGER INTEGER) : INTEGER
ADDEXACT (INTEGER INTEGER) : INTEGER
DECREMENTEXACT (INTEGER) : INTEGER
INCREMENTEXACT (INTEGER) : INTEGER
MULTIPLYEXACT (INTEGER INTEGER) : INTEGER
NEGATEEXACT (INTEGER) : INTEGER
SUBTRACTEXACT (INTEGER INTEGER) : INTEGER
SCALB (REAL INTEGER) : REAL
COPYSIGN (REAL REAL) : REAL
GETEXPONENT (REAL) : INTEGER
SIGNUM (REAL) : REAL
ASIN (REAL) : REAL
ACOS (REAL) : REAL
ATAN (REAL) : REAL
TORADIANS (REAL) : REAL
TODEGREES (REAL) : REAL
CBRT (REAL) : REAL
IEEEREMAINDER (REAL REAL) : REAL
CEIL (REAL) : REAL
FLOOR (REAL) : REAL
RINT (REAL) : REAL
FLOORDIV (INTEGER INTEGER) : INTEGER
FLOORMOD (INTEGER INTEGER) : INTEGER
ULP (REAL) : REAL
SINH (REAL) : REAL
COSH (REAL) : REAL
TANH (REAL) : REAL
HYPOT (REAL REAL) : REAL
EXPM1 (REAL) : REAL
LOG1P (REAL) : REAL
NEXTAFTER (REAL REAL) : REAL
NEXTUP (REAL) : REAL
NEXTDOWN (REAL) : REAL
POWEROFTWOD (INTEGER) : REAL
COMPARETO (STRING STRING) : INTEGER
INDEXOF (STRING STRING INTEGER) : INTEGER
INDEXOF (INTEGER INTEGER STRING INTEGER) : INTEGER
INDEXOF (INTEGER INTEGER INTEGER INTEGER INTEGER) : INTEGER
INDEXOF (STRING INTEGER) : INTEGER
INDEXOF (STRING STRING) : INTEGER
INDEXOF (STRING INTEGER INTEGER) : INTEGER
VALUEOF (BOOLEAN) : STRING
VALUEOF (INTEGER INTEGER) : STRING
VALUEOF (REAL) : STRING
VALUEOF (INTEGER) : STRING
CODEPOINTAT (STRING INTEGER) : INTEGER
CODEPOINTBEFORE (STRING INTEGER) : INTEGER
CODEPOINTCOUNT (STRING INTEGER INTEGER) : INTEGER
OFFSETBYCODEPOINTS (STRING INTEGER INTEGER) : INTEGER
CONTENTEQUALS (STRING STRING) : BOOLEAN
EQUALSIGNORECASE (STRING STRING) : BOOLEAN
COMPARETOIGNORECASE (STRING STRING) : INTEGER
REGIONMATCHES (STRING INTEGER STRING INTEGER INTEGER) : BOOLEAN
REGIONMATCHES (STRING BOOLEAN INTEGER STRING INTEGER INTEGER) : BOOLEAN
STARTSWITH (STRING STRING) : BOOLEAN
STARTSWITH (STRING STRING INTEGER) : BOOLEAN
ENDSWITH (STRING STRING) : BOOLEAN
INDEXOFSUPPLEMENTARY (STRING INTEGER INTEGER) : INTEGER
LASTINDEXOF (STRING INTEGER INTEGER) : INTEGER
LASTINDEXOF (INTEGER INTEGER INTEGER INTEGER INTEGER) : INTEGER
LASTINDEXOF (INTEGER INTEGER STRING INTEGER) : INTEGER
LASTINDEXOF (STRING STRING INTEGER) : INTEGER
LASTINDEXOF (STRING INTEGER) : INTEGER
LASTINDEXOF (STRING STRING) : INTEGER
LASTINDEXOFSUPPLEMENTARY (STRING INTEGER INTEGER) : INTEGER
SUBSTRING (STRING INTEGER) : STRING
SUBSTRING (STRING INTEGER INTEGER) : STRING
SUBSEQUENCE (STRING INTEGER INTEGER) : STRING
CONCAT (STRING STRING) : STRING
REPLACE (STRING STRING STRING) : STRING
MATCHES (STRING STRING) : BOOLEAN
CONTAINS (STRING STRING) : BOOLEAN
REPLACEFIRST (STRING STRING STRING) : STRING
REPLACEALL (STRING STRING STRING) : STRING
COPYVALUEOF (INTEGER INTEGER) : STRING
VeLa Grammar