-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Is your feature request related to a problem?
Sometimes, a variable in a nc file is corrupted or not "xarray friendly" and crashes opening a file (see for example #8072 ; I solved this on my machine by just drop_variables
ing the problematic variables in practice), or reading and parsing the full file or mf-file may be expensive and time consuming, while only a couple of variables are needed.
Describe the solution you'd like
We already can exclude variables with the drop_variables
arg to open_dataset
(note: this is not present for now in open_mfdataset
, should it be added there?), but could we also instead of saying "read all the variables instead of this list", be able to say "read only these variables"? In most case, this would be equivalent of using drop_variables=list(set(all_vars)-set(list_insteresting_vars)
, but in case some (many vars) may be corrupted, just getting the file opened to list these all_vars
may be problematic.
Describe alternatives you've considered
drop_variables=list(set(all_vars)-set(list_insteresting_vars)
, but this is a lot more verbose.
Additional context
No response