Open alex-s-gardner opened 2 years ago
You could use the following code to subset a cube with a boolean vector index
along a given dimension.
There might be a better way to do that when https://github.com/meggart/DiskArrays.jl/issues/49 is resolved.
function outerselect(cube, index; dims=:Time)
indims = InDims(dims)
oldax = getproperty(cube, dims)
newax = typeof(oldax)(oldax.values[index])
outdims = OutDims(newax)
mapCube(innerselect!, cube, index; indims, outdims)
end
innerselect!(xout, xin, index) = xout .= xin[index]
Is this a YAXArray issue or a DimensionalData issue? I also need this, but it seems that this issue should be closed and a new one should be opened at DimensionalData.jl.
This is a YAXArray issue, because this works on the DimensionalData level, but it does not work on the interaction of the YAXArray and the underlying DiskArray. The problem is, that YAXArrays tries to be as lazy as possible and then we get an error of trying to taking a view of a chunked DiskArray where we can't determine the chunksize of the underlying view.
Is it possible to subset a cube according to a BitVector index along a specific dimension?