Subselection in `ncread` does not work if an index is integer
Opened this issue · 1 comments
Datseris commented
E.g., ncread(file, "w", (:, :, 1))
will fail, because it tries to instantiate an array that has 3 named dimensions but only 2 actual dimensions, as w[:, :, 1]
is a Matrix.
@rafaqz by the way, I think Rasters.jl has this subselection feature implemented already right? Because it first makes an "image" of the full dimensional array without actually loading numeric data, and then you could subselect this image.
rafaqz commented
Its all lazy in Rasters.jl, so that indexing also reduces the number of named dims before the load happens.
The original array just holds a string path for the file, and what type it is, the size etc. Its loaded the first time you use getindex
, Array
or collect
.