Scalar functions return a single value, based on one or more input values.
Function | Arity | Description |
now() | 0 | Returns the current date and time |
date_now() | 0 | Returns the current date |
time_now() | 0 | Returns the current time |
year(date) | 1 | Returns the year part of a date |
month(date) | 1 | Returns the month part of a date |
day(date) | 1 | Returns the day part of a date |
hour(time) | 1 | Returns the hour part of a time |
minute(time) | 1 | Returns the minute part of a time |
second(time) | 1 | Returns the second part of a time |
timestamp(date, time) | 2 | returns the timestamp of a date and time (format: YYYYMMDDHHMMSS) |
tdiff(tgdate, tgtime, andate, antime) | 4 | Time difference in seconds (tgdate,tgtime) are target times from which the nominal analysis timestamp (andate,antime) is getting subtracted from |
cos(x) | 1 | Cosine (where x is in degrees) |
sin(x) | 1 | Sine (where x is in degrees) |
tan(x) | 1 | Tangent (where x is in degrees) |
acos(x) | 1 | Arc cosine (the result is in degrees) |
asin(x) | 1 | Arc sine (the result is in degrees) |
atan(x) | 1 | Arc tangent (the result is in degrees) |
atan2(x,y) | 2 | Arc tangent of two variables (the result in degrees) |
exp(x) | 1 | Exponent |
ldexp(x,n) | 2 | x 2n |
cosh(x) | 1 | Hyperbolic cosine |
sinh(x) | 1 | Hyperbolic sine |
tanh(x) | 1 | Hyperbolic tangent |
int(x), trunc(x) | 1 | Truncate to integer |
nint(x) | 1 | Round-up to integer |
floor(x) | 1 | Calculate floor value |
ceil(x) | 1 | Calculate ceiling value |
abs(x) | 1 | Absolute value |
ibits(x,pos,len) | 3 | Extract len bits from x offset pos |
mod(x,y) or x%y | 2 | x modulo y with floating point numbers accepted |
pow(x,y) or x**y or x^y | 2 | x power of y (xy) |
sqrt(x) | 1 | Square root (√x) |
log(x),ln(x) | 1 | Natural logarithm |
log10(x),lg(x) | 1 | Base-10 logarithm |
deg2rad(x), radians(x) | 1 | Convert degrees to radians |
rad2deg(x), degrees(x) | 1 | Convert radians to degrees |
celsius(x), k2c(x) | 1 | Convert Kelvin to Celsius |
c2k(x) | 1 | Convert Celcius to Kelvin |
fahrenheit(x), k2f(x) | 1 | Convert Kelvin to Fahrenheit |
f2k(x) | 1 | Convert Fahrenheit to Kelvin |
c2f(x) | 1 | Convert Celsius to Fahrenheit |
f2c(x) | 1 | Convert Fahrenheit to Celsius |
circle(x,x0,y,y0,r) | 4 | Returns 1, if the point (x,y) is inside (or on) the (planar) circle with origin at (x0,y0) and radius r |
rad(lat0, lon0, angle, lat, lon) | 4 | Returns 1, if the (lat,lon) is inside the great-circle (of any radius) with origin (lat0,lon0), and view angle (in degrees) |
distance(lat1, lon1, lat2, lon2) | 4 | Distance (expressed in metres) between two positions (lat1,lon1) and (lat2,lon2) along a great-circle of the Earth (R=6371km) |
km(lat1, lon1, lat2, lon2) | 4 | Synonym of distance-function but expressed in kilometres. |
dist(reflat, reflon, refdist_km, lat, lon) | 5 | return 1, if (lat,lon) is inside the great-circle of radius refdist_km (in kilometres) with origin (reflat,reflon) |
eq_boxlat(lat,lon,resol) | 3 | Compute the latitude by partitioning the unit spher into regions of equal area and small diameter (Algorithm by Paul Leopardi, School of Mathematics, University of South Wales) |
eq_boxlon(lat,lon,resol) | 3 | Same as eq_boxlat but compute the longitude instead |
rgg_boxlat(lat,lon,Txxxx) | 3 | Maps the latitude into its Reduced Gaussian Grid box at resolution Txxxx. (lat,lon) are assumed to be in degrees. Please note that some resolution may not be available. |
rgg_boxlon(lat,lon,Txxxx) | 3 | Maps the longitude into its Reduced Gaussian Grid box at resolution Txxxx. (lat,lon) are assumed to be in degrees. Please note that some resolution may not be available. |
thin(value,x) | 2 | x is a vector. It returns a new vector where only 1 over value is kept from x |