Hi,
I’m still getting to grips with practical use of DimensionalData.jl DimArray types.
Suppose I’m using eachslice
to iterate over the time dimension of a 3D array, but I want to get the time value at each slice. What property can I access? In other words what could I use for the gettime
function in this example?
t = Ti(0.01:0.01:1)
x = X(10:10:100);
y = Y(1:20);
mydata = DimArray(rand(10, 20, 100), (x, y, t), name="example")
for slice in eachslice(mydata, dims=3)
timevalue = gettime(slice)
println("the time of this slice is ", timevalue)
end
Currently my clunky workaround would be like this:
for (timevalue, slice) in zip(dims(mydata)[3], eachslice(mydata, dims=3))
println("the time of this slice is ", timevalue)
end
Hopefully there’s a better answer?