Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subselection in ncread does not work if an index is integer #90

Open
Datseris opened this issue Feb 22, 2022 · 1 comment
Open

Subselection in ncread does not work if an index is integer #90

Datseris opened this issue Feb 22, 2022 · 1 comment
Labels
bug Something isn't working io Input/output from/to disk.

Comments

@Datseris
Copy link
Member

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.

@Datseris Datseris added bug Something isn't working io Input/output from/to disk. labels Feb 22, 2022
@rafaqz
Copy link

rafaqz commented Feb 22, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working io Input/output from/to disk.
Projects
None yet
Development

No branches or pull requests

2 participants