Content deleted Content added
No edit summary |
m →Array querying: lang="text" |
||
Line 40:
The '''marray''' operator creates an array over some given ___domain extent and initializes its cells:
<syntaxhighlight lang="
marray index-range-specification
values cell-value-expression
Line 48:
'''Example:''' “A cutout of array A given by the corner points (10,20) and (40,50).”
<syntaxhighlight lang="
marray p in [10:20,40:50]
values A[p]
Line 54:
This special case, pure subsetting, can be abbreviated as
<syntaxhighlight lang="
A[10:20,40:50]
</syntaxhighlight>
Line 60:
'''Example:''' “A slice through an x/y/t timeseries at position t=100, retrieving all available data in x and y.”
<syntaxhighlight lang="
A[*:*,*:*,100]
</syntaxhighlight>
Line 69:
'''Example:''' “Array A, with a log() applied to each cell value.”
<syntaxhighlight lang="
marray p in ___domain(A)
values log( A[p] )
Line 75:
This can be abbreviated as:
<syntaxhighlight lang="
log( A )
</syntaxhighlight>
Line 82:
The '''condense''' operator aggregates cell values into one scalar result, similar to SQL aggregates. Its application has the general form:
<syntaxhighlight lang="
condense condense-op
over index-range-specification
Line 91:
'''Example:''' "The sum over all values in A."
<syntaxhighlight lang="
condense +
over p in sdom(A)
Line 98:
A shorthand for this operation is:
<syntaxhighlight lang="
add_cells( A )
</syntaxhighlight>
Line 107:
'''Example:''' "A histogram over 8-bit greyscale image A."
<syntaxhighlight lang="
marray bucket in [0:255]
values count_cells( A = bucket )
|