You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A convenience operator, used as `a ⊘ b`, for creating a windowed view of a `DimArrayOrStack` where one or more dimensions are treated as a single, complete window. This is equivalent to calling `windows(a, b => Whole())`.
25
+
26
+
This operator is particularly useful with `xmap`, where it specifies that a function should be applied over an entire dimension (or multiple dimensions) at once. For example, `xmap(mean, a ⊘ :time)` will compute the mean over the entire `:time` dimension.
27
+
28
+
# How to type
29
+
30
+
The `⊘` symbol can be typed in the Julia REPL or compatible editors by typing `\\oslash` and then pressing the Tab key.
31
+
32
+
# Arguments
33
+
- `a`: A `YAXArray` or other `DimArrayOrStack`.
34
+
- `b`: A `Symbol` or a `Tuple` of `Symbol`s representing the dimension(s) to be treated as a single window.
35
+
36
+
# Returns
37
+
A `DimWindowArray` which can be passed to `xmap` for windowed processing.
38
+
39
+
# Examples
40
+
```julia
41
+
using YAXArrays, Dates, Statistics
42
+
using YAXArrays: YAXArrays as YAX
43
+
44
+
a = YAXArray((YAX.time(1:5), lon(1:3)), rand(5,3))
45
+
46
+
# Create a windowed view where the `:time` dimension is a single window
47
+
w = a ⊘ :time
48
+
49
+
# Use this view with xmap to calculate the mean over the time dimension.
0 commit comments