Next Previous Up Contents
Next: Strings
Up: Functions
Previous: Distances

9.5.10 Arrays

Functions which perform aggregating operations on array-valued cells. The functions in this class such as mean, sum, maximum etc can only be used on values which are already arrays. In most cases that means on values in table columns which are declared as array-valued. FITS and VOTable tables can have columns which contain array values, but other formats such as CSV cannot.

There is also a set of functions named array with various numbers of arguments, which let you assemble an array value from a list of scalar numbers. This can be used for instance to get the mean of a set of three magnitudes by using an expression like "mean(array(jmag, hmag, kmag))".

sum( array )
Returns the sum of all the non-blank elements in the array. If array is not a numeric array, null is returned.
mean( array )
Returns the mean of all the non-blank elements in the array. If array is not a numeric array, null is returned.
variance( array )
Returns the population variance of all the non-blank elements in the array. If array is not a numeric array, null is returned.
stdev( array )
Returns the population standard deviation of all the non-blank elements in the array. If array is not a numeric array, null is returned.
minimum( array )
Returns the smallest of the non-blank elements in the array. If array is not a numeric array, null is returned.
maximum( array )
Returns the largest of the non-blank elements in the array. If array is not a numeric array, null is returned.
median( array )
Returns the median of the non-blank elements in the array. If array is not a numeric array, null is returned.
quantile( array, quant )
Returns a quantile value of the non-blank elements in the array. Which quantile is determined by the quant value; values of 0, 0.5 and 1 give the minimum, median and maximum respectively. A value of 0.99 would give the 99th percentile.
size( array )
Returns the number of elements in the array. If array is not an array, zero is returned.
count( array )
Returns the number of non-blank elements in the array. If array is not an array, zero is returned.
join( array, joiner )
Returns a string composed of concatenating all the elements of an array, separated by a joiner string. If array is not an array, null is returned.
array( x1 )
Returns a numeric array built from a given element.
array( x1, x2 )
Returns a numeric array built from given elements.
array( x1, x2, x3 )
Returns a numeric array built from given elements.
array( x1, x2, x3, x4 )
Returns a numeric array built from given elements.
array( x1, x2, x3, x4, x5 )
Returns a numeric array built from given elements.
array( x1, x2, x3, x4, x5, x6 )
Returns a numeric array built from given elements.
array( x1, x2, x3, x4, x5, x6, x7 )
Returns a numeric array built from given elements.
array( x1, x2, x3, x4, x5, x6, x7, x8 )
Returns a numeric array built from given elements.


Next Previous Up Contents
Next: Strings
Up: Functions
Previous: Distances

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@bristol.ac.uk