|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.func.Arrays
public class 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))
".
Method Summary | |
---|---|
static double[] |
array(double x1)
Returns a numeric array built from a given element. |
static double[] |
array(double x1,
double x2)
Returns a numeric array built from given elements. |
static double[] |
array(double x1,
double x2,
double x3)
Returns a numeric array built from given elements. |
static double[] |
array(double x1,
double x2,
double x3,
double x4)
Returns a numeric array built from given elements. |
static double[] |
array(double x1,
double x2,
double x3,
double x4,
double x5)
Returns a numeric array built from given elements. |
static double[] |
array(double x1,
double x2,
double x3,
double x4,
double x5,
double x6)
Returns a numeric array built from given elements. |
static double[] |
array(double x1,
double x2,
double x3,
double x4,
double x5,
double x6,
double x7)
Returns a numeric array built from given elements. |
static double[] |
array(double x1,
double x2,
double x3,
double x4,
double x5,
double x6,
double x7,
double x8)
Returns a numeric array built from given elements. |
static int |
count(Object array)
Returns the number of non-blank elements in the array. |
static String |
join(Object array,
String joiner)
Returns a string composed of concatenating all the elements of an array, separated by a joiner string. |
static double |
maximum(Object array)
Returns the largest of the non-blank elements in the array. |
static double |
mean(Object array)
Returns the mean of all the non-blank elements in the array. |
static double |
median(Object array)
Returns the median of the non-blank elements in the array. |
static double |
minimum(Object array)
Returns the smallest of the non-blank elements in the array. |
static double |
quantile(Object array,
double quant)
Returns a quantile value of the non-blank elements in the array. |
static int |
size(Object array)
Returns the number of elements in the array. |
static double |
stdev(Object array)
Returns the population standard deviation of all the non-blank elements in the array. |
static double |
sum(Object array)
Returns the sum of all the non-blank elements in the array. |
static double |
variance(Object array)
Returns the population variance of all the non-blank elements in the array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static double sum(Object array)
array
is not a numeric array, null
is returned.
array
- array of numbers
array
public static double mean(Object array)
array
is not a numeric array, null
is returned.
array
- array of numbers
array
public static double variance(Object array)
array
is not a numeric array,
null
is returned.
array
- array of numbers
array
public static double stdev(Object array)
array
is not a numeric array,
null
is returned.
array
- array of numbers
array
public static double minimum(Object array)
array
is not a numeric array, null
is returned.
array
- array of numbers
array
public static double maximum(Object array)
array
is not a numeric array, null
is returned.
array
- array of numbers
array
public static double median(Object array)
array
is not a numeric array, null
is returned.
array
- array of numbers
array
public static double quantile(Object array, double quant)
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.
array
- array of numbersquant
- number in the range 0-1 deterining which quantile
to calculate
quant
public static int size(Object array)
array
is not an array, zero is returned.
array
- array
array
public static int count(Object array)
array
is not an array, zero is returned.
array
- array (may or may not be numeric)
array
public static String join(Object array, String joiner)
array
is not an array, null is returned.
array
- array of numbers or stringsjoiner
- text string to interpose between adjacent elements
array
elements separated by
joiner
stringspublic static double[] array(double x1)
x1
- array element 1
public static double[] array(double x1, double x2)
x1
- array element 1x2
- array element 2
public static double[] array(double x1, double x2, double x3)
x1
- array element 1x2
- array element 2x3
- array element 3
public static double[] array(double x1, double x2, double x3, double x4)
x1
- array element 1x2
- array element 2x3
- array element 3x4
- array element 4
public static double[] array(double x1, double x2, double x3, double x4, double x5)
x1
- array element 1x2
- array element 2x3
- array element 3x4
- array element 4x5
- array element 5
public static double[] array(double x1, double x2, double x3, double x4, double x5, double x6)
x1
- array element 1x2
- array element 2x3
- array element 3x4
- array element 4x5
- array element 5x6
- array element 6
public static double[] array(double x1, double x2, double x3, double x4, double x5, double x6, double x7)
x1
- array element 1x2
- array element 2x3
- array element 3x4
- array element 4x5
- array element 5x6
- array element 6x7
- array element 7
public static double[] array(double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8)
x1
- array element 1x2
- array element 2x3
- array element 3x4
- array element 4x5
- array element 5x6
- array element 6x7
- array element 7x8
- array element 8
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |